alchemy 2.0.0-beta.76 → 2.0.0-beta.78

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 (3442) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_LICENSES.md +11 -11
  3. package/bin/alchemy.js +1 -1
  4. package/bin/alchemy.js.map +1 -1
  5. package/bin/alchemy.ts +1 -1
  6. package/bin/cli.js +166 -35
  7. package/bin/exec.js +12863 -6308
  8. package/bin/exec.js.map +1 -1
  9. package/bin/exec.ts +1 -1
  10. package/bin/register-oxc.js +38 -0
  11. package/lib/AWS/AMP/Scraper.js +1 -1
  12. package/lib/AWS/AMP/Scraper.js.map +1 -1
  13. package/lib/AWS/ApiGateway/common.d.ts +1 -1
  14. package/lib/AWS/ApiGateway/common.d.ts.map +1 -1
  15. package/lib/AWS/ApiGatewayV2/common.d.ts +1 -1
  16. package/lib/AWS/ApiGatewayV2/common.d.ts.map +1 -1
  17. package/lib/AWS/AppRunner/Service.d.ts +11 -27
  18. package/lib/AWS/AppRunner/Service.d.ts.map +1 -1
  19. package/lib/AWS/AppRunner/Service.js +7 -21
  20. package/lib/AWS/AppRunner/Service.js.map +1 -1
  21. package/lib/AWS/AppSync/common.d.ts +1 -1
  22. package/lib/AWS/AppSync/common.d.ts.map +1 -1
  23. package/lib/AWS/Assets.d.ts +2 -2
  24. package/lib/AWS/Assets.d.ts.map +1 -1
  25. package/lib/AWS/Assets.js +2 -2
  26. package/lib/AWS/Assets.js.map +1 -1
  27. package/lib/AWS/AuthProvider.d.ts +40 -53
  28. package/lib/AWS/AuthProvider.d.ts.map +1 -1
  29. package/lib/AWS/AuthProvider.js +480 -215
  30. package/lib/AWS/AuthProvider.js.map +1 -1
  31. package/lib/AWS/Batch/JobDefinition.d.ts +11 -27
  32. package/lib/AWS/Batch/JobDefinition.d.ts.map +1 -1
  33. package/lib/AWS/Batch/JobDefinition.js +7 -21
  34. package/lib/AWS/Batch/JobDefinition.js.map +1 -1
  35. package/lib/AWS/Bedrock/LanguageModel.d.ts +2 -2
  36. package/lib/AWS/Bedrock/LanguageModel.d.ts.map +1 -1
  37. package/lib/AWS/Bedrock/LanguageModel.js +1 -1
  38. package/lib/AWS/Bedrock/LanguageModel.js.map +1 -1
  39. package/lib/AWS/Bootstrap.d.ts +2 -2
  40. package/lib/AWS/Bootstrap.d.ts.map +1 -1
  41. package/lib/AWS/Budgets/BindingHttp.d.ts +1 -8
  42. package/lib/AWS/Budgets/BindingHttp.d.ts.map +1 -1
  43. package/lib/AWS/Budgets/BindingHttp.js +2 -7
  44. package/lib/AWS/Budgets/BindingHttp.js.map +1 -1
  45. package/lib/AWS/Budgets/DescribeBudgetActionsForBudgetHttp.d.ts.map +1 -1
  46. package/lib/AWS/Budgets/DescribeBudgetActionsForBudgetHttp.js +0 -3
  47. package/lib/AWS/Budgets/DescribeBudgetActionsForBudgetHttp.js.map +1 -1
  48. package/lib/AWS/CloudFront/KvRoutesUpdate.d.ts.map +1 -1
  49. package/lib/AWS/CloudFront/KvRoutesUpdate.js +9 -1
  50. package/lib/AWS/CloudFront/KvRoutesUpdate.js.map +1 -1
  51. package/lib/AWS/CloudMap/internal.d.ts +2 -2
  52. package/lib/AWS/CloudMap/internal.d.ts.map +1 -1
  53. package/lib/AWS/Connection/DbAuthToken.d.ts +2 -1
  54. package/lib/AWS/Connection/DbAuthToken.d.ts.map +1 -1
  55. package/lib/AWS/Credentials.d.ts +2 -2
  56. package/lib/AWS/Credentials.d.ts.map +1 -1
  57. package/lib/AWS/Credentials.js +1 -1
  58. package/lib/AWS/Credentials.js.map +1 -1
  59. package/lib/AWS/DSQL/Connect.d.ts +2 -2
  60. package/lib/AWS/DSQL/Connect.d.ts.map +1 -1
  61. package/lib/AWS/DynamoDB/Table.d.ts.map +1 -1
  62. package/lib/AWS/DynamoDB/Table.js +22 -11
  63. package/lib/AWS/DynamoDB/Table.js.map +1 -1
  64. package/lib/AWS/EC2/GetAmi.d.ts +2 -0
  65. package/lib/AWS/EC2/GetAmi.d.ts.map +1 -1
  66. package/lib/AWS/EC2/Instance.d.ts +11 -27
  67. package/lib/AWS/EC2/Instance.d.ts.map +1 -1
  68. package/lib/AWS/EC2/Instance.js +17 -22
  69. package/lib/AWS/EC2/Instance.js.map +1 -1
  70. package/lib/AWS/EC2/SecurityGroup.d.ts +70 -2
  71. package/lib/AWS/EC2/SecurityGroup.d.ts.map +1 -1
  72. package/lib/AWS/EC2/SecurityGroup.js +256 -66
  73. package/lib/AWS/EC2/SecurityGroup.js.map +1 -1
  74. package/lib/AWS/EC2/SecurityGroupRule.d.ts +43 -9
  75. package/lib/AWS/EC2/SecurityGroupRule.d.ts.map +1 -1
  76. package/lib/AWS/EC2/SecurityGroupRule.js +102 -22
  77. package/lib/AWS/EC2/SecurityGroupRule.js.map +1 -1
  78. package/lib/AWS/EC2/hosted.d.ts +6 -7
  79. package/lib/AWS/EC2/hosted.d.ts.map +1 -1
  80. package/lib/AWS/EC2/hosted.js.map +1 -1
  81. package/lib/AWS/ECR/Image.d.ts +23 -12
  82. package/lib/AWS/ECR/Image.d.ts.map +1 -1
  83. package/lib/AWS/ECR/Image.js +26 -5
  84. package/lib/AWS/ECR/Image.js.map +1 -1
  85. package/lib/AWS/ECR/ImageSource.d.ts +5 -6
  86. package/lib/AWS/ECR/ImageSource.d.ts.map +1 -1
  87. package/lib/AWS/ECR/ImageSource.js.map +1 -1
  88. package/lib/AWS/ECS/EcsDevWatch.d.ts +1 -1
  89. package/lib/AWS/ECS/EcsDevWatch.d.ts.map +1 -1
  90. package/lib/AWS/ECS/FlociServiceProvider.js +2 -2
  91. package/lib/AWS/ECS/FlociTaskProvider.js +2 -2
  92. package/lib/AWS/ECS/Service.d.ts +7 -21
  93. package/lib/AWS/ECS/Service.d.ts.map +1 -1
  94. package/lib/AWS/ECS/Service.js +14 -28
  95. package/lib/AWS/ECS/Service.js.map +1 -1
  96. package/lib/AWS/ECS/Task.d.ts +12 -26
  97. package/lib/AWS/ECS/Task.d.ts.map +1 -1
  98. package/lib/AWS/ECS/Task.js +7 -21
  99. package/lib/AWS/ECS/Task.js.map +1 -1
  100. package/lib/AWS/EKS/KubernetesAdapter.js +4 -4
  101. package/lib/AWS/EKS/internal/podIdentity.d.ts +4 -4
  102. package/lib/AWS/EKS/internal/podIdentity.d.ts.map +1 -1
  103. package/lib/AWS/ElastiCache/CacheCluster.d.ts +60 -0
  104. package/lib/AWS/ElastiCache/CacheCluster.d.ts.map +1 -0
  105. package/lib/AWS/ElastiCache/CacheCluster.js +199 -0
  106. package/lib/AWS/ElastiCache/CacheCluster.js.map +1 -0
  107. package/lib/AWS/ElastiCache/ConnectCacheCluster.d.ts +46 -0
  108. package/lib/AWS/ElastiCache/ConnectCacheCluster.d.ts.map +1 -0
  109. package/lib/AWS/ElastiCache/ConnectCacheCluster.js +5 -0
  110. package/lib/AWS/ElastiCache/ConnectCacheCluster.js.map +1 -0
  111. package/lib/AWS/ElastiCache/ConnectCacheClusterHttp.d.ts +4 -0
  112. package/lib/AWS/ElastiCache/ConnectCacheClusterHttp.d.ts.map +1 -0
  113. package/lib/AWS/ElastiCache/ConnectCacheClusterHttp.js +52 -0
  114. package/lib/AWS/ElastiCache/ConnectCacheClusterHttp.js.map +1 -0
  115. package/lib/AWS/ElastiCache/ConnectReplicationGroup.d.ts +47 -0
  116. package/lib/AWS/ElastiCache/ConnectReplicationGroup.d.ts.map +1 -0
  117. package/lib/AWS/ElastiCache/ConnectReplicationGroup.js +5 -0
  118. package/lib/AWS/ElastiCache/ConnectReplicationGroup.js.map +1 -0
  119. package/lib/AWS/ElastiCache/ConnectReplicationGroupHttp.d.ts +4 -0
  120. package/lib/AWS/ElastiCache/ConnectReplicationGroupHttp.d.ts.map +1 -0
  121. package/lib/AWS/ElastiCache/ConnectReplicationGroupHttp.js +77 -0
  122. package/lib/AWS/ElastiCache/ConnectReplicationGroupHttp.js.map +1 -0
  123. package/lib/AWS/ElastiCache/ReplicationGroup.d.ts +95 -0
  124. package/lib/AWS/ElastiCache/ReplicationGroup.d.ts.map +1 -0
  125. package/lib/AWS/ElastiCache/ReplicationGroup.js +383 -0
  126. package/lib/AWS/ElastiCache/ReplicationGroup.js.map +1 -0
  127. package/lib/AWS/ElastiCache/SubnetGroup.d.ts +39 -0
  128. package/lib/AWS/ElastiCache/SubnetGroup.d.ts.map +1 -0
  129. package/lib/AWS/ElastiCache/SubnetGroup.js +136 -0
  130. package/lib/AWS/ElastiCache/SubnetGroup.js.map +1 -0
  131. package/lib/AWS/ElastiCache/index.d.ts +7 -0
  132. package/lib/AWS/ElastiCache/index.d.ts.map +1 -1
  133. package/lib/AWS/ElastiCache/index.js +7 -0
  134. package/lib/AWS/ElastiCache/index.js.map +1 -1
  135. package/lib/AWS/ElastiCache/internal.d.ts +13 -0
  136. package/lib/AWS/ElastiCache/internal.d.ts.map +1 -0
  137. package/lib/AWS/ElastiCache/internal.js +19 -0
  138. package/lib/AWS/ElastiCache/internal.js.map +1 -0
  139. package/lib/AWS/Environment.d.ts +2 -3
  140. package/lib/AWS/Environment.d.ts.map +1 -1
  141. package/lib/AWS/Environment.js +17 -47
  142. package/lib/AWS/Environment.js.map +1 -1
  143. package/lib/AWS/IAM/actions.generated.js +1 -1
  144. package/lib/AWS/IAM/actions.generated.js.map +1 -1
  145. package/lib/AWS/IdentityCenter/AccountAssignment.js +6 -0
  146. package/lib/AWS/IdentityCenter/AccountAssignment.js.map +1 -1
  147. package/lib/AWS/IdentityCenter/common.d.ts +2 -2
  148. package/lib/AWS/IdentityCenter/common.d.ts.map +1 -1
  149. package/lib/AWS/Lambda/BindingHttp.d.ts +62 -10
  150. package/lib/AWS/Lambda/BindingHttp.d.ts.map +1 -1
  151. package/lib/AWS/Lambda/BindingHttp.js +161 -22
  152. package/lib/AWS/Lambda/BindingHttp.js.map +1 -1
  153. package/lib/AWS/Lambda/EventInvokeConfig.d.ts +1 -1
  154. package/lib/AWS/Lambda/EventInvokeConfig.d.ts.map +1 -1
  155. package/lib/AWS/Lambda/FlociFunctionProvider.js +2 -2
  156. package/lib/AWS/Lambda/FlociMicrovmImageProvider.js +2 -2
  157. package/lib/AWS/Lambda/Function.d.ts +14 -23
  158. package/lib/AWS/Lambda/Function.d.ts.map +1 -1
  159. package/lib/AWS/Lambda/Function.js +38 -35
  160. package/lib/AWS/Lambda/Function.js.map +1 -1
  161. package/lib/AWS/Lambda/FunctionImage.d.ts +1 -1
  162. package/lib/AWS/Lambda/GetFunctionHttp.d.ts +1 -1
  163. package/lib/AWS/Lambda/GetFunctionHttp.d.ts.map +1 -1
  164. package/lib/AWS/Lambda/InvokeFunctionHttp.d.ts +1 -1
  165. package/lib/AWS/Lambda/InvokeFunctionHttp.d.ts.map +1 -1
  166. package/lib/AWS/Lambda/InvokeWithResponseStreamHttp.d.ts +1 -1
  167. package/lib/AWS/Lambda/InvokeWithResponseStreamHttp.d.ts.map +1 -1
  168. package/lib/AWS/Lambda/MicrovmBinding.d.ts.map +1 -1
  169. package/lib/AWS/Lambda/MicrovmBinding.js +11 -214
  170. package/lib/AWS/Lambda/MicrovmBinding.js.map +1 -1
  171. package/lib/AWS/Lambda/MicrovmBundle.d.ts +1 -1
  172. package/lib/AWS/Lambda/MicrovmBundle.d.ts.map +1 -1
  173. package/lib/AWS/Lambda/MicrovmBundle.js +1 -12
  174. package/lib/AWS/Lambda/MicrovmBundle.js.map +1 -1
  175. package/lib/AWS/Lambda/MicrovmImage.d.ts +12 -28
  176. package/lib/AWS/Lambda/MicrovmImage.d.ts.map +1 -1
  177. package/lib/AWS/Lambda/MicrovmImage.js +8 -22
  178. package/lib/AWS/Lambda/MicrovmImage.js.map +1 -1
  179. package/lib/AWS/Lambda/MicrovmRuntimeContext.js +1 -1
  180. package/lib/AWS/Local/DevWatchProvider.d.ts +4 -4
  181. package/lib/AWS/Local/DevWatchProvider.d.ts.map +1 -1
  182. package/lib/AWS/Local/DevWatchProvider.js +16 -6
  183. package/lib/AWS/Local/DevWatchProvider.js.map +1 -1
  184. package/lib/AWS/Local/Local.d.ts +13 -1
  185. package/lib/AWS/Local/Local.d.ts.map +1 -1
  186. package/lib/AWS/Local/Local.js +10 -9
  187. package/lib/AWS/Local/Local.js.map +1 -1
  188. package/lib/AWS/Logs/LogGroup.d.ts.map +1 -1
  189. package/lib/AWS/Logs/LogGroup.js +6 -2
  190. package/lib/AWS/Logs/LogGroup.js.map +1 -1
  191. package/lib/AWS/MediaPackageV2/internal.d.ts +1 -1
  192. package/lib/AWS/MediaPackageV2/internal.d.ts.map +1 -1
  193. package/lib/AWS/Notifications/internal.d.ts +1 -1
  194. package/lib/AWS/Notifications/internal.d.ts.map +1 -1
  195. package/lib/AWS/OAM/internal.d.ts +1 -1
  196. package/lib/AWS/OAM/internal.d.ts.map +1 -1
  197. package/lib/AWS/Organizations/Account.d.ts +2 -2
  198. package/lib/AWS/Organizations/Account.d.ts.map +1 -1
  199. package/lib/AWS/Organizations/Account.js +16 -8
  200. package/lib/AWS/Organizations/Account.js.map +1 -1
  201. package/lib/AWS/Organizations/DelegatedAdministrator.d.ts +2 -3
  202. package/lib/AWS/Organizations/DelegatedAdministrator.d.ts.map +1 -1
  203. package/lib/AWS/Organizations/DelegatedAdministrator.js +5 -5
  204. package/lib/AWS/Organizations/DelegatedAdministrator.js.map +1 -1
  205. package/lib/AWS/Organizations/Organization.d.ts +1 -1
  206. package/lib/AWS/Organizations/Organization.d.ts.map +1 -1
  207. package/lib/AWS/Organizations/Organization.js +2 -2
  208. package/lib/AWS/Organizations/Organization.js.map +1 -1
  209. package/lib/AWS/Organizations/common.d.ts +9 -0
  210. package/lib/AWS/Organizations/common.d.ts.map +1 -1
  211. package/lib/AWS/Organizations/common.js +17 -1
  212. package/lib/AWS/Organizations/common.js.map +1 -1
  213. package/lib/AWS/Personalize/internal.d.ts +1 -1
  214. package/lib/AWS/Personalize/internal.d.ts.map +1 -1
  215. package/lib/AWS/Providers.d.ts.map +1 -1
  216. package/lib/AWS/Providers.js +4 -1
  217. package/lib/AWS/Providers.js.map +1 -1
  218. package/lib/AWS/RDS/Connect.d.ts +3 -3
  219. package/lib/AWS/RDS/Connect.d.ts.map +1 -1
  220. package/lib/AWS/RDS/DBInstance.d.ts +226 -11
  221. package/lib/AWS/RDS/DBInstance.d.ts.map +1 -1
  222. package/lib/AWS/RDS/DBInstance.js +692 -36
  223. package/lib/AWS/RDS/DBInstance.js.map +1 -1
  224. package/lib/AWS/RDS/DBParameterGroup.d.ts +8 -9
  225. package/lib/AWS/RDS/DBParameterGroup.d.ts.map +1 -1
  226. package/lib/AWS/RDS/DBParameterGroup.js +53 -27
  227. package/lib/AWS/RDS/DBParameterGroup.js.map +1 -1
  228. package/lib/AWS/Route53/HostedZoneLookup.d.ts +1 -1
  229. package/lib/AWS/Route53/HostedZoneLookup.d.ts.map +1 -1
  230. package/lib/AWS/S3/AbortMultipartUploadHttp.d.ts +1 -1
  231. package/lib/AWS/S3/AbortMultipartUploadHttp.d.ts.map +1 -1
  232. package/lib/AWS/S3/BindingHttp.d.ts +13 -5
  233. package/lib/AWS/S3/BindingHttp.d.ts.map +1 -1
  234. package/lib/AWS/S3/BindingHttp.js +28 -30
  235. package/lib/AWS/S3/BindingHttp.js.map +1 -1
  236. package/lib/AWS/S3/Bucket.d.ts +95 -5
  237. package/lib/AWS/S3/Bucket.d.ts.map +1 -1
  238. package/lib/AWS/S3/Bucket.js +165 -47
  239. package/lib/AWS/S3/Bucket.js.map +1 -1
  240. package/lib/AWS/S3/CompleteMultipartUploadHttp.d.ts +1 -1
  241. package/lib/AWS/S3/CompleteMultipartUploadHttp.d.ts.map +1 -1
  242. package/lib/AWS/S3/CopyObjectHttp.d.ts +1 -1
  243. package/lib/AWS/S3/CopyObjectHttp.d.ts.map +1 -1
  244. package/lib/AWS/S3/CreateMultipartUploadHttp.d.ts +1 -1
  245. package/lib/AWS/S3/CreateMultipartUploadHttp.d.ts.map +1 -1
  246. package/lib/AWS/S3/DeleteObjectHttp.d.ts +1 -1
  247. package/lib/AWS/S3/DeleteObjectHttp.d.ts.map +1 -1
  248. package/lib/AWS/S3/DeleteObjectTaggingHttp.d.ts +1 -1
  249. package/lib/AWS/S3/DeleteObjectTaggingHttp.d.ts.map +1 -1
  250. package/lib/AWS/S3/DeleteObjectsHttp.d.ts +1 -1
  251. package/lib/AWS/S3/DeleteObjectsHttp.d.ts.map +1 -1
  252. package/lib/AWS/S3/GetObjectAttributesHttp.d.ts +1 -1
  253. package/lib/AWS/S3/GetObjectAttributesHttp.d.ts.map +1 -1
  254. package/lib/AWS/S3/GetObjectHttp.d.ts +1 -1
  255. package/lib/AWS/S3/GetObjectHttp.d.ts.map +1 -1
  256. package/lib/AWS/S3/GetObjectLegalHoldHttp.d.ts +1 -1
  257. package/lib/AWS/S3/GetObjectLegalHoldHttp.d.ts.map +1 -1
  258. package/lib/AWS/S3/GetObjectRetentionHttp.d.ts +1 -1
  259. package/lib/AWS/S3/GetObjectRetentionHttp.d.ts.map +1 -1
  260. package/lib/AWS/S3/GetObjectTaggingHttp.d.ts +1 -1
  261. package/lib/AWS/S3/GetObjectTaggingHttp.d.ts.map +1 -1
  262. package/lib/AWS/S3/HeadObjectHttp.d.ts +1 -1
  263. package/lib/AWS/S3/HeadObjectHttp.d.ts.map +1 -1
  264. package/lib/AWS/S3/ListMultipartUploadsHttp.d.ts +1 -1
  265. package/lib/AWS/S3/ListMultipartUploadsHttp.d.ts.map +1 -1
  266. package/lib/AWS/S3/ListObjectVersionsHttp.d.ts +1 -1
  267. package/lib/AWS/S3/ListObjectVersionsHttp.d.ts.map +1 -1
  268. package/lib/AWS/S3/ListObjectsV2Http.d.ts +1 -1
  269. package/lib/AWS/S3/ListObjectsV2Http.d.ts.map +1 -1
  270. package/lib/AWS/S3/ListPartsHttp.d.ts +1 -1
  271. package/lib/AWS/S3/ListPartsHttp.d.ts.map +1 -1
  272. package/lib/AWS/S3/PresignGetObject.d.ts +2 -2
  273. package/lib/AWS/S3/PresignGetObject.d.ts.map +1 -1
  274. package/lib/AWS/S3/PresignGetObject.js.map +1 -1
  275. package/lib/AWS/S3/PresignPutObject.d.ts +2 -2
  276. package/lib/AWS/S3/PresignPutObject.d.ts.map +1 -1
  277. package/lib/AWS/S3/PresignPutObject.js.map +1 -1
  278. package/lib/AWS/S3/PutObjectHttp.d.ts +1 -1
  279. package/lib/AWS/S3/PutObjectHttp.d.ts.map +1 -1
  280. package/lib/AWS/S3/PutObjectLegalHoldHttp.d.ts +1 -1
  281. package/lib/AWS/S3/PutObjectLegalHoldHttp.d.ts.map +1 -1
  282. package/lib/AWS/S3/PutObjectRetentionHttp.d.ts +1 -1
  283. package/lib/AWS/S3/PutObjectRetentionHttp.d.ts.map +1 -1
  284. package/lib/AWS/S3/PutObjectTaggingHttp.d.ts +1 -1
  285. package/lib/AWS/S3/PutObjectTaggingHttp.d.ts.map +1 -1
  286. package/lib/AWS/S3/RestoreObjectHttp.d.ts +1 -1
  287. package/lib/AWS/S3/RestoreObjectHttp.d.ts.map +1 -1
  288. package/lib/AWS/S3/UploadPartCopyHttp.d.ts +1 -1
  289. package/lib/AWS/S3/UploadPartCopyHttp.d.ts.map +1 -1
  290. package/lib/AWS/S3/UploadPartHttp.d.ts +1 -1
  291. package/lib/AWS/S3/UploadPartHttp.d.ts.map +1 -1
  292. package/lib/AWS/SNS/Subscription.d.ts.map +1 -1
  293. package/lib/AWS/SNS/Subscription.js +21 -5
  294. package/lib/AWS/SNS/Subscription.js.map +1 -1
  295. package/lib/AWS/StateStore/State.d.ts +24 -4
  296. package/lib/AWS/StateStore/State.d.ts.map +1 -1
  297. package/lib/AWS/StateStore/State.js +19 -27
  298. package/lib/AWS/StateStore/State.js.map +1 -1
  299. package/lib/AWS/Synthetics/Canary.d.ts.map +1 -1
  300. package/lib/AWS/Synthetics/Canary.js +4 -9
  301. package/lib/AWS/Synthetics/Canary.js.map +1 -1
  302. package/lib/Alchemist/Entrypoint.d.ts +22 -0
  303. package/lib/Alchemist/Entrypoint.d.ts.map +1 -0
  304. package/lib/Alchemist/Entrypoint.js +27 -0
  305. package/lib/Alchemist/Entrypoint.js.map +1 -0
  306. package/lib/Alchemist/Errors.d.ts +31 -0
  307. package/lib/Alchemist/Errors.d.ts.map +1 -0
  308. package/lib/Alchemist/Errors.js +19 -0
  309. package/lib/Alchemist/Errors.js.map +1 -0
  310. package/lib/Alchemist/Progress.d.ts +16 -0
  311. package/lib/Alchemist/Progress.d.ts.map +1 -0
  312. package/lib/Alchemist/Progress.js +129 -0
  313. package/lib/Alchemist/Progress.js.map +1 -0
  314. package/lib/Alchemist/Runtime.d.ts +22 -0
  315. package/lib/Alchemist/Runtime.d.ts.map +1 -0
  316. package/lib/Alchemist/Runtime.js +28 -0
  317. package/lib/Alchemist/Runtime.js.map +1 -0
  318. package/lib/Alchemist/Session.d.ts +114 -0
  319. package/lib/Alchemist/Session.d.ts.map +1 -0
  320. package/lib/Alchemist/Session.js +214 -0
  321. package/lib/Alchemist/Session.js.map +1 -0
  322. package/lib/Alchemist/index.d.ts +15 -0
  323. package/lib/Alchemist/index.d.ts.map +1 -0
  324. package/lib/Alchemist/index.js +15 -0
  325. package/lib/Alchemist/index.js.map +1 -0
  326. package/lib/Alchemist/routes/aws.d.ts +21 -0
  327. package/lib/Alchemist/routes/aws.d.ts.map +1 -0
  328. package/lib/Alchemist/routes/aws.js +54 -0
  329. package/lib/Alchemist/routes/aws.js.map +1 -0
  330. package/lib/Alchemist/routes/cloudflare.d.ts +63 -0
  331. package/lib/Alchemist/routes/cloudflare.d.ts.map +1 -0
  332. package/lib/Alchemist/routes/cloudflare.js +113 -0
  333. package/lib/Alchemist/routes/cloudflare.js.map +1 -0
  334. package/lib/Alchemist/routes/cloudflareToken.d.ts +93 -0
  335. package/lib/Alchemist/routes/cloudflareToken.d.ts.map +1 -0
  336. package/lib/Alchemist/routes/cloudflareToken.js +111 -0
  337. package/lib/Alchemist/routes/cloudflareToken.js.map +1 -0
  338. package/lib/Alchemist/routes/drift.d.ts +55 -0
  339. package/lib/Alchemist/routes/drift.d.ts.map +1 -0
  340. package/lib/Alchemist/routes/drift.js +52 -0
  341. package/lib/Alchemist/routes/drift.js.map +1 -0
  342. package/lib/Alchemist/routes/logs.d.ts +41 -0
  343. package/lib/Alchemist/routes/logs.d.ts.map +1 -0
  344. package/lib/Alchemist/routes/logs.js +112 -0
  345. package/lib/Alchemist/routes/logs.js.map +1 -0
  346. package/lib/Alchemist/routes/nuke.d.ts +46 -0
  347. package/lib/Alchemist/routes/nuke.d.ts.map +1 -0
  348. package/lib/Alchemist/routes/nuke.js +80 -0
  349. package/lib/Alchemist/routes/nuke.js.map +1 -0
  350. package/lib/Alchemist/routes/profile.d.ts +133 -0
  351. package/lib/Alchemist/routes/profile.d.ts.map +1 -0
  352. package/lib/Alchemist/routes/profile.js +257 -0
  353. package/lib/Alchemist/routes/profile.js.map +1 -0
  354. package/lib/Alchemist/routes/provider.d.ts +33 -0
  355. package/lib/Alchemist/routes/provider.d.ts.map +1 -0
  356. package/lib/Alchemist/routes/provider.js +65 -0
  357. package/lib/Alchemist/routes/provider.js.map +1 -0
  358. package/lib/Alchemist/routes/stack.d.ts +78 -0
  359. package/lib/Alchemist/routes/stack.d.ts.map +1 -0
  360. package/lib/Alchemist/routes/stack.js +67 -0
  361. package/lib/Alchemist/routes/stack.js.map +1 -0
  362. package/lib/Alchemist/routes/state.d.ts +35 -0
  363. package/lib/Alchemist/routes/state.d.ts.map +1 -0
  364. package/lib/Alchemist/routes/state.js +46 -0
  365. package/lib/Alchemist/routes/state.js.map +1 -0
  366. package/lib/Apply.d.ts +8 -6
  367. package/lib/Apply.d.ts.map +1 -1
  368. package/lib/Apply.js +209 -103
  369. package/lib/Apply.js.map +1 -1
  370. package/lib/Auth/AuthProvider.d.ts +201 -25
  371. package/lib/Auth/AuthProvider.d.ts.map +1 -1
  372. package/lib/Auth/AuthProvider.js +180 -40
  373. package/lib/Auth/AuthProvider.js.map +1 -1
  374. package/lib/Auth/BrowserOAuth.d.ts +27 -0
  375. package/lib/Auth/BrowserOAuth.d.ts.map +1 -0
  376. package/lib/Auth/BrowserOAuth.js +41 -0
  377. package/lib/Auth/BrowserOAuth.js.map +1 -0
  378. package/lib/Auth/Credentials.d.ts +11 -6
  379. package/lib/Auth/Credentials.d.ts.map +1 -1
  380. package/lib/Auth/Credentials.js +62 -23
  381. package/lib/Auth/Credentials.js.map +1 -1
  382. package/lib/Auth/CredentialsCache.d.ts +15 -0
  383. package/lib/Auth/CredentialsCache.d.ts.map +1 -0
  384. package/lib/Auth/CredentialsCache.js +34 -0
  385. package/lib/Auth/CredentialsCache.js.map +1 -0
  386. package/lib/Auth/Demand.d.ts +59 -34
  387. package/lib/Auth/Demand.d.ts.map +1 -1
  388. package/lib/Auth/Demand.js +151 -61
  389. package/lib/Auth/Demand.js.map +1 -1
  390. package/lib/Auth/Env.d.ts +4 -4
  391. package/lib/Auth/Env.d.ts.map +1 -1
  392. package/lib/Auth/Env.js +18 -9
  393. package/lib/Auth/Env.js.map +1 -1
  394. package/lib/Auth/Inspect.d.ts +33 -0
  395. package/lib/Auth/Inspect.d.ts.map +1 -0
  396. package/lib/Auth/Inspect.js +67 -0
  397. package/lib/Auth/Inspect.js.map +1 -0
  398. package/lib/Auth/Lock.d.ts +6 -0
  399. package/lib/Auth/Lock.d.ts.map +1 -1
  400. package/lib/Auth/Lock.js +26 -14
  401. package/lib/Auth/Lock.js.map +1 -1
  402. package/lib/Auth/OAuthFlow.d.ts +119 -0
  403. package/lib/Auth/OAuthFlow.d.ts.map +1 -0
  404. package/lib/Auth/OAuthFlow.js +314 -0
  405. package/lib/Auth/OAuthFlow.js.map +1 -0
  406. package/lib/Auth/Paths.d.ts +18 -0
  407. package/lib/Auth/Paths.d.ts.map +1 -0
  408. package/lib/Auth/Paths.js +20 -0
  409. package/lib/Auth/Paths.js.map +1 -0
  410. package/lib/Auth/Profile.d.ts +91 -67
  411. package/lib/Auth/Profile.d.ts.map +1 -1
  412. package/lib/Auth/Profile.js +449 -92
  413. package/lib/Auth/Profile.js.map +1 -1
  414. package/lib/Auth/Resolve.d.ts +42 -0
  415. package/lib/Auth/Resolve.d.ts.map +1 -0
  416. package/lib/Auth/Resolve.js +90 -0
  417. package/lib/Auth/Resolve.js.map +1 -0
  418. package/lib/Auth/StoredAuthProvider.d.ts +84 -0
  419. package/lib/Auth/StoredAuthProvider.d.ts.map +1 -0
  420. package/lib/Auth/StoredAuthProvider.js +179 -0
  421. package/lib/Auth/StoredAuthProvider.js.map +1 -0
  422. package/lib/Auth/index.d.ts +1 -0
  423. package/lib/Auth/index.d.ts.map +1 -1
  424. package/lib/Auth/index.js +1 -0
  425. package/lib/Auth/index.js.map +1 -1
  426. package/lib/Axiom/AuthProvider.d.ts +17 -26
  427. package/lib/Axiom/AuthProvider.d.ts.map +1 -1
  428. package/lib/Axiom/AuthProvider.js +89 -172
  429. package/lib/Axiom/AuthProvider.js.map +1 -1
  430. package/lib/Axiom/Credentials.d.ts +2 -4
  431. package/lib/Axiom/Credentials.d.ts.map +1 -1
  432. package/lib/Axiom/Credentials.js +5 -10
  433. package/lib/Axiom/Credentials.js.map +1 -1
  434. package/lib/Axiom/Providers.d.ts +2 -2
  435. package/lib/Axiom/Providers.d.ts.map +1 -1
  436. package/lib/Axiom/Providers.js +3 -3
  437. package/lib/Axiom/Providers.js.map +1 -1
  438. package/lib/Bundle/Bundle.d.ts +3 -5
  439. package/lib/Bundle/Bundle.d.ts.map +1 -1
  440. package/lib/Bundle/Bundle.js.map +1 -1
  441. package/lib/Cli/CliKit/CliKit.d.ts +92 -0
  442. package/lib/Cli/CliKit/CliKit.d.ts.map +1 -0
  443. package/lib/Cli/CliKit/CliKit.js +27 -0
  444. package/lib/Cli/CliKit/CliKit.js.map +1 -0
  445. package/lib/Cli/CliKit/index.d.ts +9 -0
  446. package/lib/Cli/CliKit/index.d.ts.map +1 -0
  447. package/lib/Cli/CliKit/index.js +9 -0
  448. package/lib/Cli/CliKit/index.js.map +1 -0
  449. package/lib/Cli/CliKit/interaction.d.ts +13 -0
  450. package/lib/Cli/CliKit/interaction.d.ts.map +1 -0
  451. package/lib/Cli/CliKit/interaction.js +17 -0
  452. package/lib/Cli/CliKit/interaction.js.map +1 -0
  453. package/lib/Cli/CliKit/layer.d.ts +7 -0
  454. package/lib/Cli/CliKit/layer.d.ts.map +1 -0
  455. package/lib/Cli/CliKit/layer.js +34 -0
  456. package/lib/Cli/CliKit/layer.js.map +1 -0
  457. package/lib/Cli/DevOptions.d.ts +17 -0
  458. package/lib/Cli/DevOptions.d.ts.map +1 -0
  459. package/lib/Cli/DevOptions.js +16 -0
  460. package/lib/Cli/DevOptions.js.map +1 -0
  461. package/lib/Cli/Format.d.ts +5 -0
  462. package/lib/Cli/Format.d.ts.map +1 -0
  463. package/lib/Cli/Format.js +27 -0
  464. package/lib/Cli/Format.js.map +1 -0
  465. package/lib/Cli/GlobalLog.d.ts +41 -0
  466. package/lib/Cli/GlobalLog.d.ts.map +1 -0
  467. package/lib/Cli/GlobalLog.js +112 -0
  468. package/lib/Cli/GlobalLog.js.map +1 -0
  469. package/lib/Cli/LoggingCli.d.ts +4 -3
  470. package/lib/Cli/LoggingCli.d.ts.map +1 -1
  471. package/lib/Cli/LoggingCli.js +240 -100
  472. package/lib/Cli/LoggingCli.js.map +1 -1
  473. package/lib/Cli/ModeTag.d.ts +1 -1
  474. package/lib/Cli/ModeTag.js +1 -1
  475. package/lib/Cli/NamespaceTree.d.ts +18 -8
  476. package/lib/Cli/NamespaceTree.d.ts.map +1 -1
  477. package/lib/Cli/NamespaceTree.js +52 -11
  478. package/lib/Cli/NamespaceTree.js.map +1 -1
  479. package/lib/Cli/PlainCliFormatter.d.ts +11 -0
  480. package/lib/Cli/PlainCliFormatter.d.ts.map +1 -0
  481. package/lib/Cli/PlainCliFormatter.js +70 -0
  482. package/lib/Cli/PlainCliFormatter.js.map +1 -0
  483. package/lib/Cli/PropertyDiff.d.ts +37 -0
  484. package/lib/Cli/PropertyDiff.d.ts.map +1 -0
  485. package/lib/Cli/PropertyDiff.js +162 -0
  486. package/lib/Cli/PropertyDiff.js.map +1 -0
  487. package/lib/Cli/checkVersion.d.ts.map +1 -1
  488. package/lib/Cli/checkVersion.js +10 -6
  489. package/lib/Cli/checkVersion.js.map +1 -1
  490. package/lib/Cli/commands/aws.d.ts +2 -4
  491. package/lib/Cli/commands/aws.d.ts.map +1 -1
  492. package/lib/Cli/commands/aws.js +44 -56
  493. package/lib/Cli/commands/aws.js.map +1 -1
  494. package/lib/Cli/commands/cloudflare.d.ts +6 -7
  495. package/lib/Cli/commands/cloudflare.d.ts.map +1 -1
  496. package/lib/Cli/commands/cloudflare.js +156 -314
  497. package/lib/Cli/commands/cloudflare.js.map +1 -1
  498. package/lib/Cli/commands/compat.d.ts +11 -0
  499. package/lib/Cli/commands/compat.d.ts.map +1 -0
  500. package/lib/Cli/commands/compat.js +19 -0
  501. package/lib/Cli/commands/compat.js.map +1 -0
  502. package/lib/Cli/commands/confirm.d.ts +33 -0
  503. package/lib/Cli/commands/confirm.d.ts.map +1 -0
  504. package/lib/Cli/commands/confirm.js +39 -0
  505. package/lib/Cli/commands/confirm.js.map +1 -0
  506. package/lib/Cli/commands/deploy.d.ts +20 -32
  507. package/lib/Cli/commands/deploy.d.ts.map +1 -1
  508. package/lib/Cli/commands/deploy.js +141 -141
  509. package/lib/Cli/commands/deploy.js.map +1 -1
  510. package/lib/Cli/commands/dev.d.ts +5 -4
  511. package/lib/Cli/commands/dev.d.ts.map +1 -1
  512. package/lib/Cli/commands/dev.js +55 -26
  513. package/lib/Cli/commands/dev.js.map +1 -1
  514. package/lib/Cli/commands/drift.d.ts +12 -0
  515. package/lib/Cli/commands/drift.d.ts.map +1 -0
  516. package/lib/Cli/commands/drift.js +68 -0
  517. package/lib/Cli/commands/drift.js.map +1 -0
  518. package/lib/Cli/commands/errors.d.ts +35 -0
  519. package/lib/Cli/commands/errors.d.ts.map +1 -0
  520. package/lib/Cli/commands/errors.js +106 -0
  521. package/lib/Cli/commands/errors.js.map +1 -0
  522. package/lib/Cli/commands/flags.d.ts +48 -0
  523. package/lib/Cli/commands/flags.d.ts.map +1 -0
  524. package/lib/Cli/commands/flags.js +100 -0
  525. package/lib/Cli/commands/flags.js.map +1 -0
  526. package/lib/Cli/commands/instrument.d.ts +10 -0
  527. package/lib/Cli/commands/instrument.d.ts.map +1 -0
  528. package/lib/Cli/commands/instrument.js +14 -0
  529. package/lib/Cli/commands/instrument.js.map +1 -0
  530. package/lib/Cli/commands/logs.d.ts +5 -4
  531. package/lib/Cli/commands/logs.d.ts.map +1 -1
  532. package/lib/Cli/commands/logs.js +64 -89
  533. package/lib/Cli/commands/logs.js.map +1 -1
  534. package/lib/Cli/commands/nuke.d.ts +3 -2
  535. package/lib/Cli/commands/nuke.d.ts.map +1 -1
  536. package/lib/Cli/commands/nuke.js +89 -588
  537. package/lib/Cli/commands/nuke.js.map +1 -1
  538. package/lib/Cli/commands/profile/commands.d.ts +9 -0
  539. package/lib/Cli/commands/profile/commands.d.ts.map +1 -0
  540. package/lib/Cli/commands/profile/commands.js +276 -0
  541. package/lib/Cli/commands/profile/commands.js.map +1 -0
  542. package/lib/Cli/commands/profile/flows.d.ts +36 -0
  543. package/lib/Cli/commands/profile/flows.d.ts.map +1 -0
  544. package/lib/Cli/commands/profile/flows.js +155 -0
  545. package/lib/Cli/commands/profile/flows.js.map +1 -0
  546. package/lib/Cli/commands/profile/hub.d.ts +8 -0
  547. package/lib/Cli/commands/profile/hub.d.ts.map +1 -0
  548. package/lib/Cli/commands/profile/hub.js +154 -0
  549. package/lib/Cli/commands/profile/hub.js.map +1 -0
  550. package/lib/Cli/commands/profile/index.d.ts +2 -0
  551. package/lib/Cli/commands/profile/index.d.ts.map +1 -0
  552. package/lib/Cli/commands/profile/index.js +2 -0
  553. package/lib/Cli/commands/profile/index.js.map +1 -0
  554. package/lib/Cli/commands/provider.d.ts +17 -0
  555. package/lib/Cli/commands/provider.d.ts.map +1 -0
  556. package/lib/Cli/commands/provider.js +44 -0
  557. package/lib/Cli/commands/provider.js.map +1 -0
  558. package/lib/Cli/commands/render.d.ts +12 -0
  559. package/lib/Cli/commands/render.d.ts.map +1 -0
  560. package/lib/Cli/commands/render.js +82 -0
  561. package/lib/Cli/commands/render.js.map +1 -0
  562. package/lib/Cli/commands/state.d.ts +8 -1
  563. package/lib/Cli/commands/state.d.ts.map +1 -1
  564. package/lib/Cli/commands/state.js +125 -248
  565. package/lib/Cli/commands/state.js.map +1 -1
  566. package/lib/Cli/components/types.d.ts +104 -0
  567. package/lib/Cli/components/types.d.ts.map +1 -0
  568. package/lib/Cli/components/types.js +4 -0
  569. package/lib/Cli/components/types.js.map +1 -0
  570. package/lib/Cli/components/ui/Data.d.ts +15 -0
  571. package/lib/Cli/components/ui/Data.d.ts.map +1 -0
  572. package/lib/Cli/components/ui/Data.js +8 -0
  573. package/lib/Cli/components/ui/Data.js.map +1 -0
  574. package/lib/Cli/components/ui/Environment.d.ts +45 -0
  575. package/lib/Cli/components/ui/Environment.d.ts.map +1 -0
  576. package/lib/Cli/components/ui/Environment.js +38 -0
  577. package/lib/Cli/components/ui/Environment.js.map +1 -0
  578. package/lib/Cli/components/ui/Feedback.d.ts +57 -0
  579. package/lib/Cli/components/ui/Feedback.d.ts.map +1 -0
  580. package/lib/Cli/components/ui/Feedback.js +83 -0
  581. package/lib/Cli/components/ui/Feedback.js.map +1 -0
  582. package/lib/Cli/components/ui/Interactive.d.ts +157 -0
  583. package/lib/Cli/components/ui/Interactive.d.ts.map +1 -0
  584. package/lib/Cli/components/ui/Interactive.js +527 -0
  585. package/lib/Cli/components/ui/Interactive.js.map +1 -0
  586. package/lib/Cli/components/ui/Layout.d.ts +74 -0
  587. package/lib/Cli/components/ui/Layout.d.ts.map +1 -0
  588. package/lib/Cli/components/ui/Layout.js +91 -0
  589. package/lib/Cli/components/ui/Layout.js.map +1 -0
  590. package/lib/Cli/components/ui/Live.d.ts +49 -0
  591. package/lib/Cli/components/ui/Live.d.ts.map +1 -0
  592. package/lib/Cli/components/ui/Live.js +43 -0
  593. package/lib/Cli/components/ui/Live.js.map +1 -0
  594. package/lib/Cli/components/ui/ProgressBar.d.ts +16 -0
  595. package/lib/Cli/components/ui/ProgressBar.d.ts.map +1 -0
  596. package/lib/Cli/components/ui/ProgressBar.js +17 -0
  597. package/lib/Cli/components/ui/ProgressBar.js.map +1 -0
  598. package/lib/Cli/components/ui/Transcript.d.ts +12 -0
  599. package/lib/Cli/components/ui/Transcript.d.ts.map +1 -0
  600. package/lib/Cli/components/ui/Transcript.js +14 -0
  601. package/lib/Cli/components/ui/Transcript.js.map +1 -0
  602. package/lib/Cli/components/ui/Typography.d.ts +17 -0
  603. package/lib/Cli/components/ui/Typography.d.ts.map +1 -0
  604. package/lib/Cli/components/ui/Typography.js +21 -0
  605. package/lib/Cli/components/ui/Typography.js.map +1 -0
  606. package/lib/Cli/components/ui/index.d.ts +16 -0
  607. package/lib/Cli/components/ui/index.d.ts.map +1 -0
  608. package/lib/Cli/components/ui/index.js +16 -0
  609. package/lib/Cli/components/ui/index.js.map +1 -0
  610. package/lib/Cli/components/view/ApprovePlan.d.ts +16 -0
  611. package/lib/Cli/components/view/ApprovePlan.d.ts.map +1 -0
  612. package/lib/Cli/components/view/ApprovePlan.js +59 -0
  613. package/lib/Cli/components/view/ApprovePlan.js.map +1 -0
  614. package/lib/Cli/components/view/Help.d.ts +4 -0
  615. package/lib/Cli/components/view/Help.d.ts.map +1 -0
  616. package/lib/Cli/components/view/Help.js +116 -0
  617. package/lib/Cli/components/view/Help.js.map +1 -0
  618. package/lib/Cli/components/view/Logo.d.ts +7 -0
  619. package/lib/Cli/components/view/Logo.d.ts.map +1 -0
  620. package/lib/Cli/components/view/Logo.js +118 -0
  621. package/lib/Cli/components/view/Logo.js.map +1 -0
  622. package/lib/Cli/components/view/Nuke.d.ts +36 -0
  623. package/lib/Cli/components/view/Nuke.d.ts.map +1 -0
  624. package/lib/Cli/components/view/Nuke.js +148 -0
  625. package/lib/Cli/components/view/Nuke.js.map +1 -0
  626. package/lib/Cli/components/view/PlanDecision.d.ts +15 -0
  627. package/lib/Cli/components/view/PlanDecision.d.ts.map +1 -0
  628. package/lib/Cli/components/view/PlanDecision.js +26 -0
  629. package/lib/Cli/components/view/PlanDecision.js.map +1 -0
  630. package/lib/Cli/components/view/PlanRow.d.ts +17 -0
  631. package/lib/Cli/components/view/PlanRow.d.ts.map +1 -0
  632. package/lib/Cli/components/view/PlanRow.js +14 -0
  633. package/lib/Cli/components/view/PlanRow.js.map +1 -0
  634. package/lib/Cli/components/view/PlanTree.d.ts +116 -0
  635. package/lib/Cli/components/view/PlanTree.d.ts.map +1 -0
  636. package/lib/Cli/components/view/PlanTree.js +207 -0
  637. package/lib/Cli/components/view/PlanTree.js.map +1 -0
  638. package/lib/Cli/components/view/PlanView.d.ts +23 -0
  639. package/lib/Cli/components/view/PlanView.d.ts.map +1 -0
  640. package/lib/Cli/components/view/PlanView.js +310 -0
  641. package/lib/Cli/components/view/PlanView.js.map +1 -0
  642. package/lib/Cli/components/view/Profile.d.ts +130 -0
  643. package/lib/Cli/components/view/Profile.d.ts.map +1 -0
  644. package/lib/Cli/components/view/Profile.js +147 -0
  645. package/lib/Cli/components/view/Profile.js.map +1 -0
  646. package/lib/Cli/components/view/ProfileDashboard.d.ts +152 -0
  647. package/lib/Cli/components/view/ProfileDashboard.d.ts.map +1 -0
  648. package/lib/Cli/components/view/ProfileDashboard.js +485 -0
  649. package/lib/Cli/components/view/ProfileDashboard.js.map +1 -0
  650. package/lib/Cli/components/view/Prompts.d.ts +10 -0
  651. package/lib/Cli/components/view/Prompts.d.ts.map +1 -0
  652. package/lib/Cli/components/view/Prompts.js +440 -0
  653. package/lib/Cli/components/view/Prompts.js.map +1 -0
  654. package/lib/Cli/components/view/Runtime.d.ts +8 -0
  655. package/lib/Cli/components/view/Runtime.d.ts.map +1 -0
  656. package/lib/Cli/components/view/Runtime.js +670 -0
  657. package/lib/Cli/components/view/Runtime.js.map +1 -0
  658. package/lib/Cli/components/view/SigilCli.d.ts +5 -0
  659. package/lib/Cli/components/view/SigilCli.d.ts.map +1 -0
  660. package/lib/Cli/components/view/SigilCli.js +134 -0
  661. package/lib/Cli/components/view/SigilCli.js.map +1 -0
  662. package/lib/Cli/components/view/StackOutputs.d.ts +10 -0
  663. package/lib/Cli/components/view/StackOutputs.d.ts.map +1 -0
  664. package/lib/Cli/components/view/StackOutputs.js +14 -0
  665. package/lib/Cli/components/view/StackOutputs.js.map +1 -0
  666. package/lib/Cli/components/view/StateExplorer.d.ts +118 -0
  667. package/lib/Cli/components/view/StateExplorer.d.ts.map +1 -0
  668. package/lib/Cli/components/view/StateExplorer.js +664 -0
  669. package/lib/Cli/components/view/StateExplorer.js.map +1 -0
  670. package/lib/Cli/components/view/statusStyle.d.ts +18 -0
  671. package/lib/Cli/components/view/statusStyle.d.ts.map +1 -0
  672. package/lib/Cli/components/view/statusStyle.js +69 -0
  673. package/lib/Cli/components/view/statusStyle.js.map +1 -0
  674. package/lib/Cli/components/view/usePlanPresentation.d.ts +25 -0
  675. package/lib/Cli/components/view/usePlanPresentation.d.ts.map +1 -0
  676. package/lib/Cli/components/view/usePlanPresentation.js +54 -0
  677. package/lib/Cli/components/view/usePlanPresentation.js.map +1 -0
  678. package/lib/Cli/components/view/usePlanViewport.d.ts +31 -0
  679. package/lib/Cli/components/view/usePlanViewport.d.ts.map +1 -0
  680. package/lib/Cli/components/view/usePlanViewport.js +113 -0
  681. package/lib/Cli/components/view/usePlanViewport.js.map +1 -0
  682. package/lib/Cli/exec.d.ts +5 -1
  683. package/lib/Cli/exec.d.ts.map +1 -1
  684. package/lib/Cli/exec.js +174 -19
  685. package/lib/Cli/exec.js.map +1 -1
  686. package/lib/Cli/main.d.ts +4 -1
  687. package/lib/Cli/main.d.ts.map +1 -1
  688. package/lib/Cli/main.js +129 -38
  689. package/lib/Cli/main.js.map +1 -1
  690. package/lib/Cli/selectCli.d.ts +5 -3
  691. package/lib/Cli/selectCli.d.ts.map +1 -1
  692. package/lib/Cli/selectCli.js +16 -9
  693. package/lib/Cli/selectCli.js.map +1 -1
  694. package/lib/Cloudflare/AI/GatewayProvider.d.ts +1 -1
  695. package/lib/Cloudflare/AI/GatewayProvider.js +1 -1
  696. package/lib/Cloudflare/AI/LanguageModel.d.ts +2 -2
  697. package/lib/Cloudflare/AI/LanguageModel.d.ts.map +1 -1
  698. package/lib/Cloudflare/AI/LanguageModel.js +1 -1
  699. package/lib/Cloudflare/AI/ProviderKey.d.ts +3 -3
  700. package/lib/Cloudflare/AI/ProviderKey.js +3 -3
  701. package/lib/Cloudflare/AI/SearchToken.d.ts.map +1 -1
  702. package/lib/Cloudflare/AI/SearchToken.js +3 -6
  703. package/lib/Cloudflare/AI/SearchToken.js.map +1 -1
  704. package/lib/Cloudflare/Access.js +1 -1
  705. package/lib/Cloudflare/Alerting/Webhook.d.ts +1 -1
  706. package/lib/Cloudflare/Alerting/Webhook.js +1 -1
  707. package/lib/Cloudflare/ApiToken/UserApiToken.d.ts +1 -1
  708. package/lib/Cloudflare/ApiToken/UserApiToken.js +1 -1
  709. package/lib/Cloudflare/Auth/AuthConfig.d.ts +60 -0
  710. package/lib/Cloudflare/Auth/AuthConfig.d.ts.map +1 -0
  711. package/lib/Cloudflare/Auth/AuthConfig.js +68 -0
  712. package/lib/Cloudflare/Auth/AuthConfig.js.map +1 -0
  713. package/lib/Cloudflare/Auth/AuthProvider.d.ts +2 -142
  714. package/lib/Cloudflare/Auth/AuthProvider.d.ts.map +1 -1
  715. package/lib/Cloudflare/Auth/AuthProvider.js +473 -327
  716. package/lib/Cloudflare/Auth/AuthProvider.js.map +1 -1
  717. package/lib/Cloudflare/Auth/OAuthClient.d.ts +16 -48
  718. package/lib/Cloudflare/Auth/OAuthClient.d.ts.map +1 -1
  719. package/lib/Cloudflare/Auth/OAuthClient.js +25 -260
  720. package/lib/Cloudflare/Auth/OAuthClient.js.map +1 -1
  721. package/lib/Cloudflare/Auth/OAuthScopes.d.ts +88 -0
  722. package/lib/Cloudflare/Auth/OAuthScopes.d.ts.map +1 -0
  723. package/lib/Cloudflare/Auth/OAuthScopes.js +887 -0
  724. package/lib/Cloudflare/Auth/OAuthScopes.js.map +1 -0
  725. package/lib/Cloudflare/Auth/TokenPolicy.d.ts +34 -0
  726. package/lib/Cloudflare/Auth/TokenPolicy.d.ts.map +1 -0
  727. package/lib/Cloudflare/Auth/TokenPolicy.js +51 -0
  728. package/lib/Cloudflare/Auth/TokenPolicy.js.map +1 -0
  729. package/lib/Cloudflare/Bridge.d.ts +7 -0
  730. package/lib/Cloudflare/Bridge.d.ts.map +1 -1
  731. package/lib/Cloudflare/Bridge.js +8 -0
  732. package/lib/Cloudflare/Bridge.js.map +1 -1
  733. package/lib/Cloudflare/CloudflareEnvironment.d.ts +3 -10
  734. package/lib/Cloudflare/CloudflareEnvironment.d.ts.map +1 -1
  735. package/lib/Cloudflare/CloudflareEnvironment.js +10 -16
  736. package/lib/Cloudflare/CloudflareEnvironment.js.map +1 -1
  737. package/lib/Cloudflare/CloudflareEnvironmentService.d.ts +9 -0
  738. package/lib/Cloudflare/CloudflareEnvironmentService.d.ts.map +1 -0
  739. package/lib/Cloudflare/CloudflareEnvironmentService.js +5 -0
  740. package/lib/Cloudflare/CloudflareEnvironmentService.js.map +1 -0
  741. package/lib/Cloudflare/Containers/Container.d.ts +10 -25
  742. package/lib/Cloudflare/Containers/Container.d.ts.map +1 -1
  743. package/lib/Cloudflare/Containers/Container.js +9 -23
  744. package/lib/Cloudflare/Containers/Container.js.map +1 -1
  745. package/lib/Cloudflare/Containers/ContainerApplication.d.ts +23 -31
  746. package/lib/Cloudflare/Containers/ContainerApplication.d.ts.map +1 -1
  747. package/lib/Cloudflare/Containers/ContainerApplication.js +0 -1
  748. package/lib/Cloudflare/Containers/ContainerApplication.js.map +1 -1
  749. package/lib/Cloudflare/Containers/ContainerPlatform.d.ts +2 -2
  750. package/lib/Cloudflare/Containers/ContainerPlatform.d.ts.map +1 -1
  751. package/lib/Cloudflare/Containers/ContainerPlatform.js +1 -2
  752. package/lib/Cloudflare/Containers/ContainerPlatform.js.map +1 -1
  753. package/lib/Cloudflare/Containers/ContainerProvider.d.ts.map +1 -1
  754. package/lib/Cloudflare/Containers/ContainerProvider.js +122 -65
  755. package/lib/Cloudflare/Containers/ContainerProvider.js.map +1 -1
  756. package/lib/Cloudflare/Containers/ContainerPublication.d.ts +4 -0
  757. package/lib/Cloudflare/Containers/ContainerPublication.d.ts.map +1 -0
  758. package/lib/Cloudflare/Containers/ContainerPublication.js +8 -0
  759. package/lib/Cloudflare/Containers/ContainerPublication.js.map +1 -0
  760. package/lib/Cloudflare/Containers/LocalContainerProvider.d.ts.map +1 -1
  761. package/lib/Cloudflare/Containers/LocalContainerProvider.js +3 -2
  762. package/lib/Cloudflare/Containers/LocalContainerProvider.js.map +1 -1
  763. package/lib/Cloudflare/Containers/StartContainer.d.ts +1 -1
  764. package/lib/Cloudflare/Containers/StartContainer.d.ts.map +1 -1
  765. package/lib/Cloudflare/Credentials.d.ts +6 -20
  766. package/lib/Cloudflare/Credentials.d.ts.map +1 -1
  767. package/lib/Cloudflare/Credentials.js +12 -54
  768. package/lib/Cloudflare/Credentials.js.map +1 -1
  769. package/lib/Cloudflare/D1/CloneDatabase.d.ts +1 -1
  770. package/lib/Cloudflare/D1/CloneDatabase.d.ts.map +1 -1
  771. package/lib/Cloudflare/D1/Database.js +3 -3
  772. package/lib/Cloudflare/D1/Database.js.map +1 -1
  773. package/lib/Cloudflare/D1/ImportDatabase.d.ts +1 -1
  774. package/lib/Cloudflare/D1/ImportDatabase.d.ts.map +1 -1
  775. package/lib/Cloudflare/DNS/ReadDnsLocal.d.ts +1 -1
  776. package/lib/Cloudflare/DNS/ReadDnsLocal.d.ts.map +1 -1
  777. package/lib/Cloudflare/DNS/ReadWriteDnsLocal.d.ts +1 -1
  778. package/lib/Cloudflare/DNS/ReadWriteDnsLocal.d.ts.map +1 -1
  779. package/lib/Cloudflare/DNS/WriteDnsLocal.d.ts +1 -1
  780. package/lib/Cloudflare/DNS/WriteDnsLocal.d.ts.map +1 -1
  781. package/lib/Cloudflare/EdgeSession.d.ts +1 -1
  782. package/lib/Cloudflare/EdgeSession.d.ts.map +1 -1
  783. package/lib/Cloudflare/EdgeSession.js +1 -1
  784. package/lib/Cloudflare/EdgeSession.js.map +1 -1
  785. package/lib/Cloudflare/Fetcher.d.ts.map +1 -1
  786. package/lib/Cloudflare/Fetcher.js +58 -116
  787. package/lib/Cloudflare/Fetcher.js.map +1 -1
  788. package/lib/Cloudflare/Flagship/Flag.d.ts +8 -1
  789. package/lib/Cloudflare/Flagship/Flag.d.ts.map +1 -1
  790. package/lib/Cloudflare/Flagship/Flag.js.map +1 -1
  791. package/lib/Cloudflare/HostnameTlsSetting/HostnameTlsSetting.d.ts.map +1 -1
  792. package/lib/Cloudflare/HostnameTlsSetting/HostnameTlsSetting.js +10 -24
  793. package/lib/Cloudflare/HostnameTlsSetting/HostnameTlsSetting.js.map +1 -1
  794. package/lib/Cloudflare/Hyperdrive/Connection.d.ts +1 -1
  795. package/lib/Cloudflare/Hyperdrive/Connection.d.ts.map +1 -1
  796. package/lib/Cloudflare/Hyperdrive/Connection.js +10 -7
  797. package/lib/Cloudflare/Hyperdrive/Connection.js.map +1 -1
  798. package/lib/Cloudflare/KV/ReadNamespaceHttp.d.ts +1 -1
  799. package/lib/Cloudflare/KV/ReadNamespaceLocal.d.ts +1 -1
  800. package/lib/Cloudflare/KV/ReadNamespaceLocal.d.ts.map +1 -1
  801. package/lib/Cloudflare/KV/ReadWriteNamespaceHttp.d.ts +1 -1
  802. package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.d.ts +1 -1
  803. package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.d.ts.map +1 -1
  804. package/lib/Cloudflare/KV/WriteNamespaceHttp.d.ts +1 -1
  805. package/lib/Cloudflare/KV/WriteNamespaceLocal.d.ts +1 -1
  806. package/lib/Cloudflare/KV/WriteNamespaceLocal.d.ts.map +1 -1
  807. package/lib/Cloudflare/LoadBalancer/LoadBalancer.js +1 -1
  808. package/lib/Cloudflare/LoadBalancer/LoadBalancer.js.map +1 -1
  809. package/lib/Cloudflare/LoadBalancer/Monitor.js.map +1 -1
  810. package/lib/Cloudflare/Local.d.ts +8 -1
  811. package/lib/Cloudflare/Local.d.ts.map +1 -1
  812. package/lib/Cloudflare/Local.js +6 -2
  813. package/lib/Cloudflare/Local.js.map +1 -1
  814. package/lib/Cloudflare/LocalGateway.d.ts +1 -1
  815. package/lib/Cloudflare/LocalGateway.d.ts.map +1 -1
  816. package/lib/Cloudflare/LocalRuntime.d.ts +7 -2
  817. package/lib/Cloudflare/LocalRuntime.d.ts.map +1 -1
  818. package/lib/Cloudflare/LocalRuntime.js +8 -2
  819. package/lib/Cloudflare/LocalRuntime.js.map +1 -1
  820. package/lib/Cloudflare/Logs.d.ts.map +1 -1
  821. package/lib/Cloudflare/Logs.js +18 -13
  822. package/lib/Cloudflare/Logs.js.map +1 -1
  823. package/lib/Cloudflare/MagicTransit/IpsecTunnel.d.ts +1 -1
  824. package/lib/Cloudflare/MagicTransit/IpsecTunnel.js +1 -1
  825. package/lib/Cloudflare/MtlsCertificate/MtlsCertificate.d.ts +1 -1
  826. package/lib/Cloudflare/MtlsCertificate/MtlsCertificate.js +1 -1
  827. package/lib/Cloudflare/Organization/Organization.js +1 -1
  828. package/lib/Cloudflare/Organization/Organization.js.map +1 -1
  829. package/lib/Cloudflare/OriginTlsClientAuth/Certificate.d.ts +2 -2
  830. package/lib/Cloudflare/OriginTlsClientAuth/Certificate.js +2 -2
  831. package/lib/Cloudflare/OriginTlsClientAuth/HostnameAssociation.d.ts +1 -1
  832. package/lib/Cloudflare/OriginTlsClientAuth/HostnameAssociation.js +1 -1
  833. package/lib/Cloudflare/OriginTlsClientAuth/HostnameCertificate.d.ts +2 -2
  834. package/lib/Cloudflare/OriginTlsClientAuth/HostnameCertificate.js +2 -2
  835. package/lib/Cloudflare/OriginTlsClientAuth/Setting.d.ts +1 -1
  836. package/lib/Cloudflare/OriginTlsClientAuth/Setting.js +1 -1
  837. package/lib/Cloudflare/Pages/Project.d.ts +1 -1
  838. package/lib/Cloudflare/Pages/Project.js +1 -1
  839. package/lib/Cloudflare/Pipelines/LegacyPipeline.d.ts +2 -2
  840. package/lib/Cloudflare/Pipelines/LegacyPipeline.js +2 -2
  841. package/lib/Cloudflare/Pipelines/Sink.d.ts +3 -3
  842. package/lib/Cloudflare/Pipelines/Sink.js +3 -3
  843. package/lib/Cloudflare/Providers.d.ts +12 -18
  844. package/lib/Cloudflare/Providers.d.ts.map +1 -1
  845. package/lib/Cloudflare/Providers.js +15 -21
  846. package/lib/Cloudflare/Providers.js.map +1 -1
  847. package/lib/Cloudflare/Queues/Consumer.js +2 -2
  848. package/lib/Cloudflare/Queues/Consumer.js.map +1 -1
  849. package/lib/Cloudflare/Queues/Queue.js +2 -2
  850. package/lib/Cloudflare/Queues/Queue.js.map +1 -1
  851. package/lib/Cloudflare/Queues/WriteQueueHttp.d.ts +1 -1
  852. package/lib/Cloudflare/R2/Bucket.d.ts.map +1 -1
  853. package/lib/Cloudflare/R2/Bucket.js +15 -2
  854. package/lib/Cloudflare/R2/Bucket.js.map +1 -1
  855. package/lib/Cloudflare/R2/BucketBinding.d.ts.map +1 -1
  856. package/lib/Cloudflare/R2/BucketBinding.js +1 -0
  857. package/lib/Cloudflare/R2/BucketBinding.js.map +1 -1
  858. package/lib/Cloudflare/R2/BucketSippy.d.ts +7 -7
  859. package/lib/Cloudflare/R2/BucketSippy.js +7 -7
  860. package/lib/Cloudflare/R2/BucketTypes.d.ts +8 -0
  861. package/lib/Cloudflare/R2/BucketTypes.d.ts.map +1 -1
  862. package/lib/Cloudflare/R2/BucketTypes.js.map +1 -1
  863. package/lib/Cloudflare/R2/ReadBucketHttp.d.ts +1 -1
  864. package/lib/Cloudflare/R2/ReadBucketLocal.d.ts +1 -1
  865. package/lib/Cloudflare/R2/ReadBucketLocal.d.ts.map +1 -1
  866. package/lib/Cloudflare/R2/ReadWriteBucketHttp.d.ts +1 -1
  867. package/lib/Cloudflare/R2/ReadWriteBucketLocal.d.ts +1 -1
  868. package/lib/Cloudflare/R2/ReadWriteBucketLocal.d.ts.map +1 -1
  869. package/lib/Cloudflare/R2/WriteBucketBinding.d.ts.map +1 -1
  870. package/lib/Cloudflare/R2/WriteBucketBinding.js +9 -6
  871. package/lib/Cloudflare/R2/WriteBucketBinding.js.map +1 -1
  872. package/lib/Cloudflare/R2/WriteBucketHttp.d.ts +1 -1
  873. package/lib/Cloudflare/R2/WriteBucketLocal.d.ts +1 -1
  874. package/lib/Cloudflare/R2/WriteBucketLocal.d.ts.map +1 -1
  875. package/lib/Cloudflare/R2/index.d.ts +1 -0
  876. package/lib/Cloudflare/R2/index.d.ts.map +1 -1
  877. package/lib/Cloudflare/R2/index.js +1 -0
  878. package/lib/Cloudflare/R2/index.js.map +1 -1
  879. package/lib/Cloudflare/SecretsStore/Secret.js +3 -3
  880. package/lib/Cloudflare/SecretsStore/Secret.js.map +1 -1
  881. package/lib/Cloudflare/Snippets/SnippetRules.d.ts.map +1 -1
  882. package/lib/Cloudflare/Snippets/SnippetRules.js +5 -3
  883. package/lib/Cloudflare/Snippets/SnippetRules.js.map +1 -1
  884. package/lib/Cloudflare/StateStore/Api.d.ts +18 -0
  885. package/lib/Cloudflare/StateStore/Api.d.ts.map +1 -1
  886. package/lib/Cloudflare/StateStore/Api.js +2 -2
  887. package/lib/Cloudflare/StateStore/Api.js.map +1 -1
  888. package/lib/Cloudflare/StateStore/CredentialsFile.d.ts +10 -6
  889. package/lib/Cloudflare/StateStore/CredentialsFile.d.ts.map +1 -1
  890. package/lib/Cloudflare/StateStore/CredentialsFile.js +23 -1
  891. package/lib/Cloudflare/StateStore/CredentialsFile.js.map +1 -1
  892. package/lib/Cloudflare/StateStore/State.d.ts +11 -9
  893. package/lib/Cloudflare/StateStore/State.d.ts.map +1 -1
  894. package/lib/Cloudflare/StateStore/State.js +138 -113
  895. package/lib/Cloudflare/StateStore/State.js.map +1 -1
  896. package/lib/Cloudflare/Tunnel/ReadTunnelBinding.d.ts +1 -1
  897. package/lib/Cloudflare/Tunnel/ReadTunnelBinding.d.ts.map +1 -1
  898. package/lib/Cloudflare/Tunnel/ReadTunnelLocal.d.ts +1 -1
  899. package/lib/Cloudflare/Tunnel/ReadTunnelLocal.d.ts.map +1 -1
  900. package/lib/Cloudflare/Tunnel/ReadWriteTunnelBinding.d.ts +1 -1
  901. package/lib/Cloudflare/Tunnel/ReadWriteTunnelBinding.d.ts.map +1 -1
  902. package/lib/Cloudflare/Tunnel/ReadWriteTunnelLocal.d.ts +1 -1
  903. package/lib/Cloudflare/Tunnel/ReadWriteTunnelLocal.d.ts.map +1 -1
  904. package/lib/Cloudflare/Tunnel/WriteTunnelBinding.d.ts +1 -1
  905. package/lib/Cloudflare/Tunnel/WriteTunnelBinding.d.ts.map +1 -1
  906. package/lib/Cloudflare/Tunnel/WriteTunnelLocal.d.ts +1 -1
  907. package/lib/Cloudflare/Tunnel/WriteTunnelLocal.d.ts.map +1 -1
  908. package/lib/Cloudflare/Vectorize/SearchIndexHttpClient.js +1 -1
  909. package/lib/Cloudflare/Vectorize/SearchIndexHttpClient.js.map +1 -1
  910. package/lib/Cloudflare/Website/Nextjs.d.ts.map +1 -1
  911. package/lib/Cloudflare/Website/Nextjs.js +4 -12
  912. package/lib/Cloudflare/Website/Nextjs.js.map +1 -1
  913. package/lib/Cloudflare/Website/Nuxt.d.ts +1 -1
  914. package/lib/Cloudflare/Website/Nuxt.js +1 -1
  915. package/lib/Cloudflare/Website/Octane.d.ts +1 -1
  916. package/lib/Cloudflare/Website/Octane.js +1 -1
  917. package/lib/Cloudflare/Website/SvelteKit.d.ts +1 -1
  918. package/lib/Cloudflare/Website/SvelteKit.js +1 -1
  919. package/lib/Cloudflare/Website/Vocs.d.ts +1 -1
  920. package/lib/Cloudflare/Website/Vocs.d.ts.map +1 -1
  921. package/lib/Cloudflare/Website/Vocs.js +3 -7
  922. package/lib/Cloudflare/Website/Vocs.js.map +1 -1
  923. package/lib/Cloudflare/Workers/AIBinding.d.ts +1 -1
  924. package/lib/Cloudflare/Workers/AIBinding.d.ts.map +1 -1
  925. package/lib/Cloudflare/Workers/Assets.d.ts +2 -2
  926. package/lib/Cloudflare/Workers/Assets.d.ts.map +1 -1
  927. package/lib/Cloudflare/Workers/Assets.js +74 -26
  928. package/lib/Cloudflare/Workers/Assets.js.map +1 -1
  929. package/lib/Cloudflare/Workers/BrowserBinding.d.ts +1 -1
  930. package/lib/Cloudflare/Workers/BrowserBinding.d.ts.map +1 -1
  931. package/lib/Cloudflare/Workers/BrowserHttpClient.d.ts +2 -2
  932. package/lib/Cloudflare/Workers/BrowserHttpClient.d.ts.map +1 -1
  933. package/lib/Cloudflare/Workers/BrowserHttpClient.js +10 -3
  934. package/lib/Cloudflare/Workers/BrowserHttpClient.js.map +1 -1
  935. package/lib/Cloudflare/Workers/CloudflareTracer.d.ts +9 -0
  936. package/lib/Cloudflare/Workers/CloudflareTracer.d.ts.map +1 -0
  937. package/lib/Cloudflare/Workers/CloudflareTracer.js +87 -0
  938. package/lib/Cloudflare/Workers/CloudflareTracer.js.map +1 -0
  939. package/lib/Cloudflare/Workers/Compatibility.d.ts +13 -0
  940. package/lib/Cloudflare/Workers/Compatibility.d.ts.map +1 -1
  941. package/lib/Cloudflare/Workers/Compatibility.js +31 -6
  942. package/lib/Cloudflare/Workers/Compatibility.js.map +1 -1
  943. package/lib/Cloudflare/Workers/DurableObject.d.ts +72 -7
  944. package/lib/Cloudflare/Workers/DurableObject.d.ts.map +1 -1
  945. package/lib/Cloudflare/Workers/DurableObject.js +48 -7
  946. package/lib/Cloudflare/Workers/DurableObject.js.map +1 -1
  947. package/lib/Cloudflare/Workers/DurableObjectBridge.d.ts.map +1 -1
  948. package/lib/Cloudflare/Workers/DurableObjectBridge.js +5 -1
  949. package/lib/Cloudflare/Workers/DurableObjectBridge.js.map +1 -1
  950. package/lib/Cloudflare/Workers/DurableObjectState.d.ts +25 -2
  951. package/lib/Cloudflare/Workers/DurableObjectState.d.ts.map +1 -1
  952. package/lib/Cloudflare/Workers/DurableObjectState.js +7 -2
  953. package/lib/Cloudflare/Workers/DurableObjectState.js.map +1 -1
  954. package/lib/Cloudflare/Workers/DurableObjectStorage.d.ts +7 -1
  955. package/lib/Cloudflare/Workers/DurableObjectStorage.d.ts.map +1 -1
  956. package/lib/Cloudflare/Workers/DurableObjectStorage.js +27 -22
  957. package/lib/Cloudflare/Workers/DurableObjectStorage.js.map +1 -1
  958. package/lib/Cloudflare/Workers/HttpServer.d.ts +1 -1
  959. package/lib/Cloudflare/Workers/HttpServer.d.ts.map +1 -1
  960. package/lib/Cloudflare/Workers/HttpServer.js +1 -1
  961. package/lib/Cloudflare/Workers/HttpServer.js.map +1 -1
  962. package/lib/Cloudflare/Workers/InferEnv.d.ts +1 -1
  963. package/lib/Cloudflare/Workers/InferEnv.d.ts.map +1 -1
  964. package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
  965. package/lib/Cloudflare/Workers/LocalWorkerProvider.js +155 -68
  966. package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
  967. package/lib/Cloudflare/Workers/RateLimitBinding.d.ts +1 -1
  968. package/lib/Cloudflare/Workers/RateLimitBinding.d.ts.map +1 -1
  969. package/lib/Cloudflare/Workers/Rpc.d.ts +9 -1
  970. package/lib/Cloudflare/Workers/Rpc.d.ts.map +1 -1
  971. package/lib/Cloudflare/Workers/Rpc.js +4 -3
  972. package/lib/Cloudflare/Workers/Rpc.js.map +1 -1
  973. package/lib/Cloudflare/Workers/RpcAsync.js +1 -1
  974. package/lib/Cloudflare/Workers/RpcAsync.js.map +1 -1
  975. package/lib/Cloudflare/Workers/RpcWorker.d.ts +12 -5
  976. package/lib/Cloudflare/Workers/RpcWorker.d.ts.map +1 -1
  977. package/lib/Cloudflare/Workers/RpcWorker.js +8 -2
  978. package/lib/Cloudflare/Workers/RpcWorker.js.map +1 -1
  979. package/lib/Cloudflare/Workers/SecretKeyBinding.d.ts +1 -1
  980. package/lib/Cloudflare/Workers/SecretKeyBinding.d.ts.map +1 -1
  981. package/lib/Cloudflare/Workers/Source.d.ts +3 -0
  982. package/lib/Cloudflare/Workers/Source.d.ts.map +1 -1
  983. package/lib/Cloudflare/Workers/Source.js +3 -1
  984. package/lib/Cloudflare/Workers/Source.js.map +1 -1
  985. package/lib/Cloudflare/Workers/Sources/Prebuilt.d.ts.map +1 -1
  986. package/lib/Cloudflare/Workers/Sources/Prebuilt.js +3 -2
  987. package/lib/Cloudflare/Workers/Sources/Prebuilt.js.map +1 -1
  988. package/lib/Cloudflare/Workers/Sources/Python.d.ts +2 -0
  989. package/lib/Cloudflare/Workers/Sources/Python.d.ts.map +1 -1
  990. package/lib/Cloudflare/Workers/Sources/Python.js +19 -14
  991. package/lib/Cloudflare/Workers/Sources/Python.js.map +1 -1
  992. package/lib/Cloudflare/Workers/Sources/Rolldown.d.ts.map +1 -1
  993. package/lib/Cloudflare/Workers/Sources/Rolldown.js +25 -10
  994. package/lib/Cloudflare/Workers/Sources/Rolldown.js.map +1 -1
  995. package/lib/Cloudflare/Workers/Sources/Vite.d.ts +1 -1
  996. package/lib/Cloudflare/Workers/Sources/Vite.d.ts.map +1 -1
  997. package/lib/Cloudflare/Workers/Sources/Vite.js +6 -4
  998. package/lib/Cloudflare/Workers/Sources/Vite.js.map +1 -1
  999. package/lib/Cloudflare/Workers/Sources/WorkerModulePlugin.d.ts +23 -0
  1000. package/lib/Cloudflare/Workers/Sources/WorkerModulePlugin.d.ts.map +1 -0
  1001. package/lib/Cloudflare/Workers/Sources/WorkerModulePlugin.js +52 -0
  1002. package/lib/Cloudflare/Workers/Sources/WorkerModulePlugin.js.map +1 -0
  1003. package/lib/Cloudflare/Workers/Telemetry.d.ts +113 -0
  1004. package/lib/Cloudflare/Workers/Telemetry.d.ts.map +1 -0
  1005. package/lib/Cloudflare/Workers/Telemetry.js +129 -0
  1006. package/lib/Cloudflare/Workers/Telemetry.js.map +1 -0
  1007. package/lib/Cloudflare/Workers/VersionMetadataBinding.d.ts +1 -1
  1008. package/lib/Cloudflare/Workers/VersionMetadataBinding.d.ts.map +1 -1
  1009. package/lib/Cloudflare/Workers/ViteBuildChildRunner.js +6 -1
  1010. package/lib/Cloudflare/Workers/ViteBuildChildRunner.js.map +1 -1
  1011. package/lib/Cloudflare/Workers/ViteChild.d.ts +2 -2
  1012. package/lib/Cloudflare/Workers/ViteChild.d.ts.map +1 -1
  1013. package/lib/Cloudflare/Workers/ViteChild.js +21 -18
  1014. package/lib/Cloudflare/Workers/ViteChild.js.map +1 -1
  1015. package/lib/Cloudflare/Workers/ViteChild.shared.d.ts +2 -0
  1016. package/lib/Cloudflare/Workers/ViteChild.shared.d.ts.map +1 -1
  1017. package/lib/Cloudflare/Workers/ViteChild.shared.js.map +1 -1
  1018. package/lib/Cloudflare/Workers/ViteChildRunner.js +2 -1
  1019. package/lib/Cloudflare/Workers/ViteChildRunner.js.map +1 -1
  1020. package/lib/Cloudflare/Workers/Worker.d.ts +269 -150
  1021. package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
  1022. package/lib/Cloudflare/Workers/Worker.js +137 -147
  1023. package/lib/Cloudflare/Workers/Worker.js.map +1 -1
  1024. package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts +9 -1
  1025. package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts.map +1 -1
  1026. package/lib/Cloudflare/Workers/WorkerAsyncBindings.js +23 -0
  1027. package/lib/Cloudflare/Workers/WorkerAsyncBindings.js.map +1 -1
  1028. package/lib/Cloudflare/Workers/WorkerBinding.d.ts +37 -1
  1029. package/lib/Cloudflare/Workers/WorkerBinding.d.ts.map +1 -1
  1030. package/lib/Cloudflare/Workers/WorkerBridge.js +5 -5
  1031. package/lib/Cloudflare/Workers/WorkerBridge.js.map +1 -1
  1032. package/lib/Cloudflare/Workers/WorkerEntrypoint.d.ts +42 -13
  1033. package/lib/Cloudflare/Workers/WorkerEntrypoint.d.ts.map +1 -1
  1034. package/lib/Cloudflare/Workers/WorkerEntrypoint.js +36 -10
  1035. package/lib/Cloudflare/Workers/WorkerEntrypoint.js.map +1 -1
  1036. package/lib/Cloudflare/Workers/WorkerLoader.d.ts +30 -4
  1037. package/lib/Cloudflare/Workers/WorkerLoader.d.ts.map +1 -1
  1038. package/lib/Cloudflare/Workers/WorkerLoader.js +36 -5
  1039. package/lib/Cloudflare/Workers/WorkerLoader.js.map +1 -1
  1040. package/lib/Cloudflare/Workers/WorkerProvider.d.ts +20 -0
  1041. package/lib/Cloudflare/Workers/WorkerProvider.d.ts.map +1 -1
  1042. package/lib/Cloudflare/Workers/WorkerProvider.js +486 -72
  1043. package/lib/Cloudflare/Workers/WorkerProvider.js.map +1 -1
  1044. package/lib/Cloudflare/Workers/WorkerRuntime.d.ts +82 -0
  1045. package/lib/Cloudflare/Workers/WorkerRuntime.d.ts.map +1 -0
  1046. package/lib/Cloudflare/Workers/WorkerRuntime.js +77 -0
  1047. package/lib/Cloudflare/Workers/WorkerRuntime.js.map +1 -0
  1048. package/lib/Cloudflare/Workers/WorkerRuntimeContext.d.ts.map +1 -1
  1049. package/lib/Cloudflare/Workers/WorkerRuntimeContext.js +9 -6
  1050. package/lib/Cloudflare/Workers/WorkerRuntimeContext.js.map +1 -1
  1051. package/lib/Cloudflare/Workers/cloudflare_workers.d.ts.map +1 -1
  1052. package/lib/Cloudflare/Workers/cloudflare_workers.js +4 -1
  1053. package/lib/Cloudflare/Workers/cloudflare_workers.js.map +1 -1
  1054. package/lib/Cloudflare/Workers/index.d.ts +1 -0
  1055. package/lib/Cloudflare/Workers/index.d.ts.map +1 -1
  1056. package/lib/Cloudflare/Workers/index.js +1 -0
  1057. package/lib/Cloudflare/Workers/index.js.map +1 -1
  1058. package/lib/Cloudflare/Workflows/Workflow.d.ts +79 -31
  1059. package/lib/Cloudflare/Workflows/Workflow.d.ts.map +1 -1
  1060. package/lib/Cloudflare/Workflows/Workflow.js +49 -21
  1061. package/lib/Cloudflare/Workflows/Workflow.js.map +1 -1
  1062. package/lib/Cloudflare/Workflows/WorkflowBridge.d.ts +2 -1
  1063. package/lib/Cloudflare/Workflows/WorkflowBridge.d.ts.map +1 -1
  1064. package/lib/Cloudflare/Workflows/WorkflowBridge.js +9 -6
  1065. package/lib/Cloudflare/Workflows/WorkflowBridge.js.map +1 -1
  1066. package/lib/Cloudflare/Workflows/WorkflowRuntime.d.ts +42 -0
  1067. package/lib/Cloudflare/Workflows/WorkflowRuntime.d.ts.map +1 -0
  1068. package/lib/Cloudflare/Workflows/WorkflowRuntime.js +20 -0
  1069. package/lib/Cloudflare/Workflows/WorkflowRuntime.js.map +1 -0
  1070. package/lib/Cloudflare/index.d.ts.map +1 -1
  1071. package/lib/Cloudflare/index.js +3 -1
  1072. package/lib/Cloudflare/index.js.map +1 -1
  1073. package/lib/Command/Command.d.ts +1 -1
  1074. package/lib/Command/Command.d.ts.map +1 -1
  1075. package/lib/Command/Command.js +2 -2
  1076. package/lib/Command/Command.js.map +1 -1
  1077. package/lib/Command/Dev.d.ts +5 -2
  1078. package/lib/Command/Dev.d.ts.map +1 -1
  1079. package/lib/Command/Dev.js +33 -8
  1080. package/lib/Command/Dev.js.map +1 -1
  1081. package/lib/Command/Local.d.ts +7 -1
  1082. package/lib/Command/Local.d.ts.map +1 -1
  1083. package/lib/Command/Local.js +5 -2
  1084. package/lib/Command/Local.js.map +1 -1
  1085. package/lib/Command/Memo.d.ts.map +1 -1
  1086. package/lib/Command/Memo.js +6 -7
  1087. package/lib/Command/Memo.js.map +1 -1
  1088. package/lib/Command/Providers.d.ts +1 -1
  1089. package/lib/Command/Providers.d.ts.map +1 -1
  1090. package/lib/Deploy.d.ts +1 -1
  1091. package/lib/Deploy.d.ts.map +1 -1
  1092. package/lib/Destroy.d.ts +1 -1
  1093. package/lib/Destroy.d.ts.map +1 -1
  1094. package/lib/Docker/BuildHash.d.ts +13 -0
  1095. package/lib/Docker/BuildHash.d.ts.map +1 -1
  1096. package/lib/Docker/BuildHash.js +53 -3
  1097. package/lib/Docker/BuildHash.js.map +1 -1
  1098. package/lib/Docker/Container.d.ts +1 -1
  1099. package/lib/Docker/Container.js +1 -1
  1100. package/lib/Docker/Docker.d.ts +20 -8
  1101. package/lib/Docker/Docker.d.ts.map +1 -1
  1102. package/lib/Docker/Docker.js +132 -54
  1103. package/lib/Docker/Docker.js.map +1 -1
  1104. package/lib/Docker/Image.d.ts +1 -1
  1105. package/lib/Docker/Image.js +1 -1
  1106. package/lib/Docker/Registry.d.ts +1 -1
  1107. package/lib/Docker/RegistryError.d.ts +21 -0
  1108. package/lib/Docker/RegistryError.d.ts.map +1 -0
  1109. package/lib/Docker/RegistryError.js +28 -0
  1110. package/lib/Docker/RegistryError.js.map +1 -0
  1111. package/lib/Docker/RemoteImage.d.ts +1 -1
  1112. package/lib/Docker/RemoteImage.js +1 -1
  1113. package/lib/Docker/Service.d.ts +7 -21
  1114. package/lib/Docker/Service.d.ts.map +1 -1
  1115. package/lib/Docker/Service.js +7 -21
  1116. package/lib/Docker/Service.js.map +1 -1
  1117. package/lib/Docker/ServiceImage.d.ts +5 -6
  1118. package/lib/Docker/ServiceImage.d.ts.map +1 -1
  1119. package/lib/Docker/ServiceImage.js.map +1 -1
  1120. package/lib/Docker/index.d.ts +1 -0
  1121. package/lib/Docker/index.d.ts.map +1 -1
  1122. package/lib/Docker/index.js +1 -0
  1123. package/lib/Docker/index.js.map +1 -1
  1124. package/lib/Drift.d.ts +91 -0
  1125. package/lib/Drift.d.ts.map +1 -0
  1126. package/lib/{Sync.js → Drift.js} +98 -29
  1127. package/lib/Drift.js.map +1 -0
  1128. package/lib/Drizzle/Postgres.d.ts.map +1 -1
  1129. package/lib/Drizzle/Postgres.js +3 -1
  1130. package/lib/Drizzle/Postgres.js.map +1 -1
  1131. package/lib/Drizzle/Schema.d.ts.map +1 -1
  1132. package/lib/Drizzle/Schema.js +5 -5
  1133. package/lib/Drizzle/Schema.js.map +1 -1
  1134. package/lib/Fly/App.d.ts +1 -1
  1135. package/lib/Fly/App.d.ts.map +1 -1
  1136. package/lib/Fly/AuthProvider.d.ts +6 -20
  1137. package/lib/Fly/AuthProvider.d.ts.map +1 -1
  1138. package/lib/Fly/AuthProvider.js +32 -124
  1139. package/lib/Fly/AuthProvider.js.map +1 -1
  1140. package/lib/Fly/Bucket.d.ts +1 -1
  1141. package/lib/Fly/Bucket.d.ts.map +1 -1
  1142. package/lib/Fly/BucketBinding.js +5 -5
  1143. package/lib/Fly/Catalog.d.ts +1 -1
  1144. package/lib/Fly/Catalog.d.ts.map +1 -1
  1145. package/lib/Fly/CheckpointHttp.d.ts.map +1 -1
  1146. package/lib/Fly/CheckpointHttp.js +2 -2
  1147. package/lib/Fly/CheckpointHttp.js.map +1 -1
  1148. package/lib/Fly/Credentials.d.ts +15 -6
  1149. package/lib/Fly/Credentials.d.ts.map +1 -1
  1150. package/lib/Fly/Credentials.js +25 -13
  1151. package/lib/Fly/Credentials.js.map +1 -1
  1152. package/lib/Fly/DecryptHttp.d.ts.map +1 -1
  1153. package/lib/Fly/DecryptHttp.js +2 -2
  1154. package/lib/Fly/DecryptHttp.js.map +1 -1
  1155. package/lib/Fly/EncryptHttp.d.ts.map +1 -1
  1156. package/lib/Fly/EncryptHttp.js +2 -2
  1157. package/lib/Fly/EncryptHttp.js.map +1 -1
  1158. package/lib/Fly/Environment.d.ts +1 -1
  1159. package/lib/Fly/Environment.d.ts.map +1 -1
  1160. package/lib/Fly/ExecHttp.d.ts.map +1 -1
  1161. package/lib/Fly/ExecHttp.js +2 -2
  1162. package/lib/Fly/ExecHttp.js.map +1 -1
  1163. package/lib/Fly/GetSecretHttp.d.ts.map +1 -1
  1164. package/lib/Fly/GetSecretHttp.js +3 -3
  1165. package/lib/Fly/GetSecretHttp.js.map +1 -1
  1166. package/lib/Fly/ListSecretsHttp.d.ts.map +1 -1
  1167. package/lib/Fly/ListSecretsHttp.js +2 -2
  1168. package/lib/Fly/ListSecretsHttp.js.map +1 -1
  1169. package/lib/Fly/Machine.d.ts +65 -0
  1170. package/lib/Fly/Machine.d.ts.map +1 -1
  1171. package/lib/Fly/Machine.js +34 -19
  1172. package/lib/Fly/Machine.js.map +1 -1
  1173. package/lib/Fly/Postgres.d.ts +1 -1
  1174. package/lib/Fly/Postgres.d.ts.map +1 -1
  1175. package/lib/Fly/Providers.d.ts +1 -1
  1176. package/lib/Fly/Providers.d.ts.map +1 -1
  1177. package/lib/Fly/Providers.js +2 -2
  1178. package/lib/Fly/Providers.js.map +1 -1
  1179. package/lib/Fly/Redis.d.ts +1 -1
  1180. package/lib/Fly/Redis.d.ts.map +1 -1
  1181. package/lib/Fly/RedisBinding.js +2 -2
  1182. package/lib/Fly/Secret.d.ts +4 -4
  1183. package/lib/Fly/Secret.js +4 -4
  1184. package/lib/Fly/SecretHttp.js +1 -1
  1185. package/lib/Fly/Service.d.ts +46 -3
  1186. package/lib/Fly/Service.d.ts.map +1 -1
  1187. package/lib/Fly/Service.js +47 -22
  1188. package/lib/Fly/Service.js.map +1 -1
  1189. package/lib/Fly/SignHttp.d.ts.map +1 -1
  1190. package/lib/Fly/SignHttp.js +2 -2
  1191. package/lib/Fly/SignHttp.js.map +1 -1
  1192. package/lib/Fly/Sprite.d.ts +2 -2
  1193. package/lib/Fly/Sprite.js +2 -2
  1194. package/lib/Fly/VerifyHttp.d.ts.map +1 -1
  1195. package/lib/Fly/VerifyHttp.js +2 -2
  1196. package/lib/Fly/VerifyHttp.js.map +1 -1
  1197. package/lib/Fly/Volume.d.ts +8 -8
  1198. package/lib/Fly/Volume.d.ts.map +1 -1
  1199. package/lib/Fly/Website/AssetDeployment.d.ts.map +1 -1
  1200. package/lib/Fly/Website/AssetDeployment.js +1 -1
  1201. package/lib/Fly/Website/AssetDeployment.js.map +1 -1
  1202. package/lib/Fly/WriteSecretHttp.d.ts.map +1 -1
  1203. package/lib/Fly/WriteSecretHttp.js +2 -2
  1204. package/lib/Fly/WriteSecretHttp.js.map +1 -1
  1205. package/lib/Fly/replicas.d.ts +12 -10
  1206. package/lib/Fly/replicas.d.ts.map +1 -1
  1207. package/lib/Fly/replicas.js +74 -9
  1208. package/lib/Fly/replicas.js.map +1 -1
  1209. package/lib/Git/Api/GitHub.d.ts +38 -0
  1210. package/lib/Git/Api/GitHub.d.ts.map +1 -0
  1211. package/lib/Git/Api/GitHub.js +38 -0
  1212. package/lib/Git/Api/GitHub.js.map +1 -0
  1213. package/lib/Git/Api/Internal.d.ts +27 -0
  1214. package/lib/Git/Api/Internal.d.ts.map +1 -0
  1215. package/lib/Git/Api/Internal.js +27 -0
  1216. package/lib/Git/Api/Internal.js.map +1 -0
  1217. package/lib/Git/Api/Objects.d.ts +140 -0
  1218. package/lib/Git/Api/Objects.d.ts.map +1 -0
  1219. package/lib/Git/Api/Objects.js +100 -0
  1220. package/lib/Git/Api/Objects.js.map +1 -0
  1221. package/lib/Git/Api/Protocol.d.ts +41 -0
  1222. package/lib/Git/Api/Protocol.d.ts.map +1 -0
  1223. package/lib/Git/Api/Protocol.js +23 -0
  1224. package/lib/Git/Api/Protocol.js.map +1 -0
  1225. package/lib/Git/Api/Pulls.d.ts +157 -0
  1226. package/lib/Git/Api/Pulls.d.ts.map +1 -0
  1227. package/lib/Git/Api/Pulls.js +109 -0
  1228. package/lib/Git/Api/Pulls.js.map +1 -0
  1229. package/lib/Git/Api/Refs.d.ts +95 -0
  1230. package/lib/Git/Api/Refs.d.ts.map +1 -0
  1231. package/lib/Git/Api/Refs.js +70 -0
  1232. package/lib/Git/Api/Refs.js.map +1 -0
  1233. package/lib/Git/Api/Repos.d.ts +168 -0
  1234. package/lib/Git/Api/Repos.d.ts.map +1 -0
  1235. package/lib/Git/Api/Repos.js +123 -0
  1236. package/lib/Git/Api/Repos.js.map +1 -0
  1237. package/lib/Git/Api/Schema.d.ts +511 -0
  1238. package/lib/Git/Api/Schema.d.ts.map +1 -0
  1239. package/lib/Git/Api/Schema.js +443 -0
  1240. package/lib/Git/Api/Schema.js.map +1 -0
  1241. package/lib/Git/Api.d.ts +65 -0
  1242. package/lib/Git/Api.d.ts.map +1 -0
  1243. package/lib/Git/Api.js +54 -0
  1244. package/lib/Git/Api.js.map +1 -0
  1245. package/lib/Git/BlobStore.d.ts +129 -0
  1246. package/lib/Git/BlobStore.d.ts.map +1 -0
  1247. package/lib/Git/BlobStore.js +118 -0
  1248. package/lib/Git/BlobStore.js.map +1 -0
  1249. package/lib/Git/BlobStoreS3.d.ts +13 -0
  1250. package/lib/Git/BlobStoreS3.d.ts.map +1 -0
  1251. package/lib/Git/BlobStoreS3.js +184 -0
  1252. package/lib/Git/BlobStoreS3.js.map +1 -0
  1253. package/lib/Git/Engine.d.ts +127 -0
  1254. package/lib/Git/Engine.d.ts.map +1 -0
  1255. package/lib/Git/Engine.js +290 -0
  1256. package/lib/Git/Engine.js.map +1 -0
  1257. package/lib/Git/GitHubCompat.d.ts +155 -0
  1258. package/lib/Git/GitHubCompat.d.ts.map +1 -0
  1259. package/lib/Git/GitHubCompat.js +444 -0
  1260. package/lib/Git/GitHubCompat.js.map +1 -0
  1261. package/lib/Git/Hasher/Hasher.d.ts +129 -0
  1262. package/lib/Git/Hasher/Hasher.d.ts.map +1 -0
  1263. package/lib/Git/Hasher/Hasher.js +170 -0
  1264. package/lib/Git/Hasher/Hasher.js.map +1 -0
  1265. package/lib/Git/Hasher/Lambda.d.ts +18 -0
  1266. package/lib/Git/Hasher/Lambda.d.ts.map +1 -0
  1267. package/lib/Git/Hasher/Lambda.js +81 -0
  1268. package/lib/Git/Hasher/Lambda.js.map +1 -0
  1269. package/lib/Git/Hasher/LambdaEvent.d.ts +45 -0
  1270. package/lib/Git/Hasher/LambdaEvent.d.ts.map +1 -0
  1271. package/lib/Git/Hasher/LambdaEvent.js +99 -0
  1272. package/lib/Git/Hasher/LambdaEvent.js.map +1 -0
  1273. package/lib/Git/Hasher/LambdaFunction.d.ts +7 -0
  1274. package/lib/Git/Hasher/LambdaFunction.d.ts.map +1 -0
  1275. package/lib/Git/Hasher/LambdaFunction.js +41 -0
  1276. package/lib/Git/Hasher/LambdaFunction.js.map +1 -0
  1277. package/lib/Git/Hasher/Protocol.d.ts +46 -0
  1278. package/lib/Git/Hasher/Protocol.d.ts.map +1 -0
  1279. package/lib/Git/Hasher/Protocol.js +235 -0
  1280. package/lib/Git/Hasher/Protocol.js.map +1 -0
  1281. package/lib/Git/Hasher/WorkerLoader.d.ts +17 -0
  1282. package/lib/Git/Hasher/WorkerLoader.d.ts.map +1 -0
  1283. package/lib/Git/Hasher/WorkerLoader.js +90 -0
  1284. package/lib/Git/Hasher/WorkerLoader.js.map +1 -0
  1285. package/lib/Git/Hasher/WorkerLoaderModule.d.ts +5 -0
  1286. package/lib/Git/Hasher/WorkerLoaderModule.d.ts.map +1 -0
  1287. package/lib/Git/Hasher/WorkerLoaderModule.js +47 -0
  1288. package/lib/Git/Hasher/WorkerLoaderModule.js.map +1 -0
  1289. package/lib/Git/Hasher/index.d.ts +16 -0
  1290. package/lib/Git/Hasher/index.d.ts.map +1 -0
  1291. package/lib/Git/Hasher/index.js +16 -0
  1292. package/lib/Git/Hasher/index.js.map +1 -0
  1293. package/lib/Git/Http/ReceivePack.d.ts +38 -0
  1294. package/lib/Git/Http/ReceivePack.d.ts.map +1 -0
  1295. package/lib/Git/Http/ReceivePack.js +94 -0
  1296. package/lib/Git/Http/ReceivePack.js.map +1 -0
  1297. package/lib/Git/Http.d.ts +5 -0
  1298. package/lib/Git/Http.d.ts.map +1 -0
  1299. package/lib/Git/Http.js +5 -0
  1300. package/lib/Git/Http.js.map +1 -0
  1301. package/lib/Git/Jobs/Bundle.d.ts +139 -0
  1302. package/lib/Git/Jobs/Bundle.d.ts.map +1 -0
  1303. package/lib/Git/Jobs/Bundle.js +160 -0
  1304. package/lib/Git/Jobs/Bundle.js.map +1 -0
  1305. package/lib/Git/Jobs/Compact.d.ts +145 -0
  1306. package/lib/Git/Jobs/Compact.d.ts.map +1 -0
  1307. package/lib/Git/Jobs/Compact.js +331 -0
  1308. package/lib/Git/Jobs/Compact.js.map +1 -0
  1309. package/lib/Git/Jobs/Fork.d.ts +116 -0
  1310. package/lib/Git/Jobs/Fork.d.ts.map +1 -0
  1311. package/lib/Git/Jobs/Fork.js +173 -0
  1312. package/lib/Git/Jobs/Fork.js.map +1 -0
  1313. package/lib/Git/Jobs/Import.d.ts +144 -0
  1314. package/lib/Git/Jobs/Import.d.ts.map +1 -0
  1315. package/lib/Git/Jobs/Import.js +291 -0
  1316. package/lib/Git/Jobs/Import.js.map +1 -0
  1317. package/lib/Git/Jobs/Purge.d.ts +62 -0
  1318. package/lib/Git/Jobs/Purge.d.ts.map +1 -0
  1319. package/lib/Git/Jobs/Purge.js +55 -0
  1320. package/lib/Git/Jobs/Purge.js.map +1 -0
  1321. package/lib/Git/Operations.d.ts +136 -0
  1322. package/lib/Git/Operations.d.ts.map +1 -0
  1323. package/lib/Git/Operations.js +684 -0
  1324. package/lib/Git/Operations.js.map +1 -0
  1325. package/lib/Git/Protocol/Advertise.d.ts +50 -0
  1326. package/lib/Git/Protocol/Advertise.d.ts.map +1 -0
  1327. package/lib/Git/Protocol/Advertise.js +116 -0
  1328. package/lib/Git/Protocol/Advertise.js.map +1 -0
  1329. package/lib/Git/Protocol/Delta.d.ts +60 -0
  1330. package/lib/Git/Protocol/Delta.d.ts.map +1 -0
  1331. package/lib/Git/Protocol/Delta.js +147 -0
  1332. package/lib/Git/Protocol/Delta.js.map +1 -0
  1333. package/lib/Git/Protocol/GzipBody.d.ts +65 -0
  1334. package/lib/Git/Protocol/GzipBody.d.ts.map +1 -0
  1335. package/lib/Git/Protocol/GzipBody.js +108 -0
  1336. package/lib/Git/Protocol/GzipBody.js.map +1 -0
  1337. package/lib/Git/Protocol/ObjectCodec.d.ts +346 -0
  1338. package/lib/Git/Protocol/ObjectCodec.d.ts.map +1 -0
  1339. package/lib/Git/Protocol/ObjectCodec.js +685 -0
  1340. package/lib/Git/Protocol/ObjectCodec.js.map +1 -0
  1341. package/lib/Git/Protocol/PackParser.d.ts +231 -0
  1342. package/lib/Git/Protocol/PackParser.d.ts.map +1 -0
  1343. package/lib/Git/Protocol/PackParser.js +636 -0
  1344. package/lib/Git/Protocol/PackParser.js.map +1 -0
  1345. package/lib/Git/Protocol/PackWriter.d.ts +50 -0
  1346. package/lib/Git/Protocol/PackWriter.d.ts.map +1 -0
  1347. package/lib/Git/Protocol/PackWriter.js +82 -0
  1348. package/lib/Git/Protocol/PackWriter.js.map +1 -0
  1349. package/lib/Git/Protocol/PartialScan.d.ts +183 -0
  1350. package/lib/Git/Protocol/PartialScan.d.ts.map +1 -0
  1351. package/lib/Git/Protocol/PartialScan.js +513 -0
  1352. package/lib/Git/Protocol/PartialScan.js.map +1 -0
  1353. package/lib/Git/Protocol/Pkt.d.ts +107 -0
  1354. package/lib/Git/Protocol/Pkt.d.ts.map +1 -0
  1355. package/lib/Git/Protocol/Pkt.js +227 -0
  1356. package/lib/Git/Protocol/Pkt.js.map +1 -0
  1357. package/lib/Git/Protocol/ReceivePack.d.ts +190 -0
  1358. package/lib/Git/Protocol/ReceivePack.d.ts.map +1 -0
  1359. package/lib/Git/Protocol/ReceivePack.js +250 -0
  1360. package/lib/Git/Protocol/ReceivePack.js.map +1 -0
  1361. package/lib/Git/Protocol/Sideband.d.ts +97 -0
  1362. package/lib/Git/Protocol/Sideband.d.ts.map +1 -0
  1363. package/lib/Git/Protocol/Sideband.js +214 -0
  1364. package/lib/Git/Protocol/Sideband.js.map +1 -0
  1365. package/lib/Git/Protocol/Store.d.ts +160 -0
  1366. package/lib/Git/Protocol/Store.d.ts.map +1 -0
  1367. package/lib/Git/Protocol/Store.js +11 -0
  1368. package/lib/Git/Protocol/Store.js.map +1 -0
  1369. package/lib/Git/Protocol/TreeDiff.d.ts +114 -0
  1370. package/lib/Git/Protocol/TreeDiff.d.ts.map +1 -0
  1371. package/lib/Git/Protocol/TreeDiff.js +347 -0
  1372. package/lib/Git/Protocol/TreeDiff.js.map +1 -0
  1373. package/lib/Git/Protocol/UploadPack.d.ts +103 -0
  1374. package/lib/Git/Protocol/UploadPack.d.ts.map +1 -0
  1375. package/lib/Git/Protocol/UploadPack.js +269 -0
  1376. package/lib/Git/Protocol/UploadPack.js.map +1 -0
  1377. package/lib/Git/Protocol/Zlib.d.ts +75 -0
  1378. package/lib/Git/Protocol/Zlib.d.ts.map +1 -0
  1379. package/lib/Git/Protocol/Zlib.js +256 -0
  1380. package/lib/Git/Protocol/Zlib.js.map +1 -0
  1381. package/lib/Git/Push.d.ts +47 -0
  1382. package/lib/Git/Push.d.ts.map +1 -0
  1383. package/lib/Git/Push.js +12 -0
  1384. package/lib/Git/Push.js.map +1 -0
  1385. package/lib/Git/PushInput.d.ts +14 -0
  1386. package/lib/Git/PushInput.d.ts.map +1 -0
  1387. package/lib/Git/PushInput.js +45 -0
  1388. package/lib/Git/PushInput.js.map +1 -0
  1389. package/lib/Git/PushWire.d.ts +17 -0
  1390. package/lib/Git/PushWire.d.ts.map +1 -0
  1391. package/lib/Git/PushWire.js +49 -0
  1392. package/lib/Git/PushWire.js.map +1 -0
  1393. package/lib/Git/RegistryD1.d.ts +10 -0
  1394. package/lib/Git/RegistryD1.d.ts.map +1 -0
  1395. package/lib/Git/RegistryD1.js +188 -0
  1396. package/lib/Git/RegistryD1.js.map +1 -0
  1397. package/lib/Git/RegistryObject.d.ts +210 -0
  1398. package/lib/Git/RegistryObject.d.ts.map +1 -0
  1399. package/lib/Git/RegistryObject.js +287 -0
  1400. package/lib/Git/RegistryObject.js.map +1 -0
  1401. package/lib/Git/RepoObject.d.ts +804 -0
  1402. package/lib/Git/RepoObject.d.ts.map +1 -0
  1403. package/lib/Git/RepoObject.js +3839 -0
  1404. package/lib/Git/RepoObject.js.map +1 -0
  1405. package/lib/Git/Server.d.ts +215 -0
  1406. package/lib/Git/Server.d.ts.map +1 -0
  1407. package/lib/Git/Server.js +620 -0
  1408. package/lib/Git/Server.js.map +1 -0
  1409. package/lib/Git/Store/Closure.d.ts +85 -0
  1410. package/lib/Git/Store/Closure.d.ts.map +1 -0
  1411. package/lib/Git/Store/Closure.js +374 -0
  1412. package/lib/Git/Store/Closure.js.map +1 -0
  1413. package/lib/Git/Store/HeadSnapshot.d.ts +38 -0
  1414. package/lib/Git/Store/HeadSnapshot.d.ts.map +1 -0
  1415. package/lib/Git/Store/HeadSnapshot.js +12 -0
  1416. package/lib/Git/Store/HeadSnapshot.js.map +1 -0
  1417. package/lib/Git/Store/IncomingBody.d.ts +37 -0
  1418. package/lib/Git/Store/IncomingBody.d.ts.map +1 -0
  1419. package/lib/Git/Store/IncomingBody.js +61 -0
  1420. package/lib/Git/Store/IncomingBody.js.map +1 -0
  1421. package/lib/Git/Store/Keys.d.ts +105 -0
  1422. package/lib/Git/Store/Keys.d.ts.map +1 -0
  1423. package/lib/Git/Store/Keys.js +107 -0
  1424. package/lib/Git/Store/Keys.js.map +1 -0
  1425. package/lib/Git/Store/ObjectStore.d.ts +210 -0
  1426. package/lib/Git/Store/ObjectStore.d.ts.map +1 -0
  1427. package/lib/Git/Store/ObjectStore.js +598 -0
  1428. package/lib/Git/Store/ObjectStore.js.map +1 -0
  1429. package/lib/Git/Store/PackSource.d.ts +23 -0
  1430. package/lib/Git/Store/PackSource.d.ts.map +1 -0
  1431. package/lib/Git/Store/PackSource.js +129 -0
  1432. package/lib/Git/Store/PackSource.js.map +1 -0
  1433. package/lib/Git/Store/Sql.d.ts +213 -0
  1434. package/lib/Git/Store/Sql.d.ts.map +1 -0
  1435. package/lib/Git/Store/Sql.js +244 -0
  1436. package/lib/Git/Store/Sql.js.map +1 -0
  1437. package/lib/Git/Store/StreamingSource.d.ts +66 -0
  1438. package/lib/Git/Store/StreamingSource.d.ts.map +1 -0
  1439. package/lib/Git/Store/StreamingSource.js +274 -0
  1440. package/lib/Git/Store/StreamingSource.js.map +1 -0
  1441. package/lib/Git/index.d.ts +39 -0
  1442. package/lib/Git/index.d.ts.map +1 -0
  1443. package/lib/Git/index.js +38 -0
  1444. package/lib/Git/index.js.map +1 -0
  1445. package/lib/GitHub/AuthProvider.d.ts +20 -29
  1446. package/lib/GitHub/AuthProvider.d.ts.map +1 -1
  1447. package/lib/GitHub/AuthProvider.js +141 -75
  1448. package/lib/GitHub/AuthProvider.js.map +1 -1
  1449. package/lib/GitHub/BranchProtection.d.ts +309 -0
  1450. package/lib/GitHub/BranchProtection.d.ts.map +1 -0
  1451. package/lib/GitHub/BranchProtection.js +334 -0
  1452. package/lib/GitHub/BranchProtection.js.map +1 -0
  1453. package/lib/GitHub/Collaborator.d.ts +112 -0
  1454. package/lib/GitHub/Collaborator.d.ts.map +1 -0
  1455. package/lib/GitHub/Collaborator.js +164 -0
  1456. package/lib/GitHub/Collaborator.js.map +1 -0
  1457. package/lib/GitHub/Credentials.d.ts +2 -3
  1458. package/lib/GitHub/Credentials.d.ts.map +1 -1
  1459. package/lib/GitHub/Credentials.js +6 -10
  1460. package/lib/GitHub/Credentials.js.map +1 -1
  1461. package/lib/GitHub/Env.js +7 -7
  1462. package/lib/GitHub/Issue.d.ts +168 -0
  1463. package/lib/GitHub/Issue.d.ts.map +1 -0
  1464. package/lib/GitHub/Issue.js +229 -0
  1465. package/lib/GitHub/Issue.js.map +1 -0
  1466. package/lib/GitHub/Label.d.ts +194 -0
  1467. package/lib/GitHub/Label.d.ts.map +1 -0
  1468. package/lib/GitHub/Label.js +260 -0
  1469. package/lib/GitHub/Label.js.map +1 -0
  1470. package/lib/GitHub/Milestone.d.ts +203 -0
  1471. package/lib/GitHub/Milestone.d.ts.map +1 -0
  1472. package/lib/GitHub/Milestone.js +261 -0
  1473. package/lib/GitHub/Milestone.js.map +1 -0
  1474. package/lib/GitHub/Providers.d.ts +3 -4
  1475. package/lib/GitHub/Providers.d.ts.map +1 -1
  1476. package/lib/GitHub/Providers.js +24 -5
  1477. package/lib/GitHub/Providers.js.map +1 -1
  1478. package/lib/GitHub/PullRequest.d.ts +220 -0
  1479. package/lib/GitHub/PullRequest.d.ts.map +1 -0
  1480. package/lib/GitHub/PullRequest.js +323 -0
  1481. package/lib/GitHub/PullRequest.js.map +1 -0
  1482. package/lib/GitHub/Release.d.ts +256 -0
  1483. package/lib/GitHub/Release.d.ts.map +1 -0
  1484. package/lib/GitHub/Release.js +315 -0
  1485. package/lib/GitHub/Release.js.map +1 -0
  1486. package/lib/GitHub/Ruleset.d.ts +277 -0
  1487. package/lib/GitHub/Ruleset.d.ts.map +1 -0
  1488. package/lib/GitHub/Ruleset.js +284 -0
  1489. package/lib/GitHub/Ruleset.js.map +1 -0
  1490. package/lib/GitHub/TeamAccess.d.ts +130 -0
  1491. package/lib/GitHub/TeamAccess.d.ts.map +1 -0
  1492. package/lib/GitHub/TeamAccess.js +176 -0
  1493. package/lib/GitHub/TeamAccess.js.map +1 -0
  1494. package/lib/GitHub/WikiPage.d.ts +252 -0
  1495. package/lib/GitHub/WikiPage.d.ts.map +1 -0
  1496. package/lib/GitHub/WikiPage.js +360 -0
  1497. package/lib/GitHub/WikiPage.js.map +1 -0
  1498. package/lib/GitHub/index.d.ts +10 -0
  1499. package/lib/GitHub/index.d.ts.map +1 -1
  1500. package/lib/GitHub/index.js +10 -0
  1501. package/lib/GitHub/index.js.map +1 -1
  1502. package/lib/Hetzner/AuthProvider.d.ts +7 -20
  1503. package/lib/Hetzner/AuthProvider.d.ts.map +1 -1
  1504. package/lib/Hetzner/AuthProvider.js +42 -130
  1505. package/lib/Hetzner/AuthProvider.js.map +1 -1
  1506. package/lib/Hetzner/Catalog.d.ts +5 -5
  1507. package/lib/Hetzner/Catalog.d.ts.map +1 -1
  1508. package/lib/Hetzner/Credentials.d.ts +1 -3
  1509. package/lib/Hetzner/Credentials.d.ts.map +1 -1
  1510. package/lib/Hetzner/Credentials.js +4 -9
  1511. package/lib/Hetzner/Credentials.js.map +1 -1
  1512. package/lib/Hetzner/PlacementGroup.d.ts +1 -1
  1513. package/lib/Hetzner/PlacementGroup.d.ts.map +1 -1
  1514. package/lib/Hetzner/Providers.d.ts +1 -1
  1515. package/lib/Hetzner/Providers.d.ts.map +1 -1
  1516. package/lib/Hetzner/Providers.js +2 -2
  1517. package/lib/Hetzner/Providers.js.map +1 -1
  1518. package/lib/Hetzner/Server.d.ts.map +1 -1
  1519. package/lib/Hetzner/Server.js +29 -6
  1520. package/lib/Hetzner/Server.js.map +1 -1
  1521. package/lib/Hetzner/hosted.d.ts +2 -2
  1522. package/lib/Http/Platform.d.ts +18 -0
  1523. package/lib/Http/Platform.d.ts.map +1 -0
  1524. package/lib/Http/Platform.js +35 -0
  1525. package/lib/Http/Platform.js.map +1 -0
  1526. package/lib/Http/index.d.ts +6 -0
  1527. package/lib/Http/index.d.ts.map +1 -0
  1528. package/lib/Http/index.js +6 -0
  1529. package/lib/Http/index.js.map +1 -0
  1530. package/lib/Http.d.ts +7 -1
  1531. package/lib/Http.d.ts.map +1 -1
  1532. package/lib/Http.js +2 -4
  1533. package/lib/Http.js.map +1 -1
  1534. package/lib/Interaction.d.ts +186 -0
  1535. package/lib/Interaction.d.ts.map +1 -0
  1536. package/lib/Interaction.js +149 -0
  1537. package/lib/Interaction.js.map +1 -0
  1538. package/lib/Kubernetes/ClusterAdapter.d.ts +4 -5
  1539. package/lib/Kubernetes/ClusterAdapter.d.ts.map +1 -1
  1540. package/lib/Kubernetes/ClusterAdapter.js.map +1 -1
  1541. package/lib/Kubernetes/Deployment.d.ts +7 -21
  1542. package/lib/Kubernetes/Deployment.d.ts.map +1 -1
  1543. package/lib/Kubernetes/Deployment.js +7 -21
  1544. package/lib/Kubernetes/Deployment.js.map +1 -1
  1545. package/lib/Kubernetes/Job.d.ts +7 -21
  1546. package/lib/Kubernetes/Job.d.ts.map +1 -1
  1547. package/lib/Kubernetes/Job.js +7 -21
  1548. package/lib/Kubernetes/Job.js.map +1 -1
  1549. package/lib/Kubernetes/internal/helm.js +1 -1
  1550. package/lib/Kubernetes/internal/kubeconfig.js +1 -1
  1551. package/lib/Kubernetes/internal/workload.js +4 -4
  1552. package/lib/Local/DevLog.d.ts +32 -0
  1553. package/lib/Local/DevLog.d.ts.map +1 -0
  1554. package/lib/Local/DevLog.js +114 -0
  1555. package/lib/Local/DevLog.js.map +1 -0
  1556. package/lib/Local/LocalProvider.d.ts +4 -3
  1557. package/lib/Local/LocalProvider.d.ts.map +1 -1
  1558. package/lib/Local/LocalProvider.js +5 -4
  1559. package/lib/Local/LocalProvider.js.map +1 -1
  1560. package/lib/Local/ProviderLayer.d.ts +12 -9
  1561. package/lib/Local/ProviderLayer.d.ts.map +1 -1
  1562. package/lib/Local/ProviderLayer.js +25 -15
  1563. package/lib/Local/ProviderLayer.js.map +1 -1
  1564. package/lib/Local/RpcProvider.d.ts +2 -2
  1565. package/lib/Local/RpcProvider.d.ts.map +1 -1
  1566. package/lib/Local/RpcProvider.js +2 -2
  1567. package/lib/Local/RpcProvider.js.map +1 -1
  1568. package/lib/Local/RpcProviderProxy.d.ts +13 -1
  1569. package/lib/Local/RpcProviderProxy.d.ts.map +1 -1
  1570. package/lib/Local/RpcProviderProxy.js +16 -17
  1571. package/lib/Local/RpcProviderProxy.js.map +1 -1
  1572. package/lib/Local/RpcServer.d.ts +31 -10
  1573. package/lib/Local/RpcServer.d.ts.map +1 -1
  1574. package/lib/Local/RpcServer.js +40 -21
  1575. package/lib/Local/RpcServer.js.map +1 -1
  1576. package/lib/Local/RpcServerEnvironment.d.ts +2 -2
  1577. package/lib/Local/RpcServerEnvironment.d.ts.map +1 -1
  1578. package/lib/Local/RpcServerEnvironment.js +4 -3
  1579. package/lib/Local/RpcServerEnvironment.js.map +1 -1
  1580. package/lib/Local/RpcSpawner.d.ts +14 -5
  1581. package/lib/Local/RpcSpawner.d.ts.map +1 -1
  1582. package/lib/Local/RpcSpawner.js +105 -38
  1583. package/lib/Local/RpcSpawner.js.map +1 -1
  1584. package/lib/Local/Sidecar.d.ts +2 -0
  1585. package/lib/Local/Sidecar.d.ts.map +1 -0
  1586. package/lib/Local/Sidecar.js +30 -0
  1587. package/lib/Local/Sidecar.js.map +1 -0
  1588. package/lib/Neon/AuthProvider.d.ts +4 -13
  1589. package/lib/Neon/AuthProvider.d.ts.map +1 -1
  1590. package/lib/Neon/AuthProvider.js +24 -107
  1591. package/lib/Neon/AuthProvider.js.map +1 -1
  1592. package/lib/Neon/Credentials.d.ts +1 -3
  1593. package/lib/Neon/Credentials.d.ts.map +1 -1
  1594. package/lib/Neon/Credentials.js +4 -9
  1595. package/lib/Neon/Credentials.js.map +1 -1
  1596. package/lib/Neon/Providers.d.ts +1 -1
  1597. package/lib/Neon/Providers.d.ts.map +1 -1
  1598. package/lib/Neon/Providers.js +2 -2
  1599. package/lib/Neon/Providers.js.map +1 -1
  1600. package/lib/Nuke.d.ts +89 -0
  1601. package/lib/Nuke.d.ts.map +1 -0
  1602. package/lib/Nuke.js +267 -0
  1603. package/lib/Nuke.js.map +1 -0
  1604. package/lib/Output.js +1 -1
  1605. package/lib/Phase.js +2 -2
  1606. package/lib/Plan.d.ts +27 -5
  1607. package/lib/Plan.d.ts.map +1 -1
  1608. package/lib/Plan.js +174 -25
  1609. package/lib/Plan.js.map +1 -1
  1610. package/lib/Planetscale/AuthProvider.d.ts +25 -37
  1611. package/lib/Planetscale/AuthProvider.d.ts.map +1 -1
  1612. package/lib/Planetscale/AuthProvider.js +267 -150
  1613. package/lib/Planetscale/AuthProvider.js.map +1 -1
  1614. package/lib/Planetscale/Credentials.d.ts +2 -3
  1615. package/lib/Planetscale/Credentials.d.ts.map +1 -1
  1616. package/lib/Planetscale/Credentials.js +17 -14
  1617. package/lib/Planetscale/Credentials.js.map +1 -1
  1618. package/lib/Planetscale/OAuthClient.d.ts +8 -52
  1619. package/lib/Planetscale/OAuthClient.d.ts.map +1 -1
  1620. package/lib/Planetscale/OAuthClient.js +18 -240
  1621. package/lib/Planetscale/OAuthClient.js.map +1 -1
  1622. package/lib/Planetscale/Providers.d.ts +1 -1
  1623. package/lib/Planetscale/Providers.d.ts.map +1 -1
  1624. package/lib/Planetscale/Providers.js +2 -2
  1625. package/lib/Planetscale/Providers.js.map +1 -1
  1626. package/lib/Planetscale/Util.d.ts +1 -1
  1627. package/lib/Planetscale/Util.d.ts.map +1 -1
  1628. package/lib/Prisma/App.d.ts.map +1 -1
  1629. package/lib/Prisma/App.js +81 -43
  1630. package/lib/Prisma/App.js.map +1 -1
  1631. package/lib/Prisma/AuthProvider.d.ts +7 -15
  1632. package/lib/Prisma/AuthProvider.d.ts.map +1 -1
  1633. package/lib/Prisma/AuthProvider.js +54 -121
  1634. package/lib/Prisma/AuthProvider.js.map +1 -1
  1635. package/lib/Prisma/Branch.d.ts.map +1 -1
  1636. package/lib/Prisma/Branch.js +81 -36
  1637. package/lib/Prisma/Branch.js.map +1 -1
  1638. package/lib/Prisma/Bucket.d.ts.map +1 -1
  1639. package/lib/Prisma/Bucket.js +41 -21
  1640. package/lib/Prisma/Bucket.js.map +1 -1
  1641. package/lib/Prisma/BucketAccessKey.d.ts.map +1 -1
  1642. package/lib/Prisma/BucketAccessKey.js +46 -19
  1643. package/lib/Prisma/BucketAccessKey.js.map +1 -1
  1644. package/lib/Prisma/Client.d.ts +2 -1
  1645. package/lib/Prisma/Client.d.ts.map +1 -1
  1646. package/lib/Prisma/Client.js +5 -5
  1647. package/lib/Prisma/Client.js.map +1 -1
  1648. package/lib/Prisma/Compute.d.ts +89 -31
  1649. package/lib/Prisma/Compute.d.ts.map +1 -1
  1650. package/lib/Prisma/Compute.js +240 -137
  1651. package/lib/Prisma/Compute.js.map +1 -1
  1652. package/lib/Prisma/ComputeArchive.d.ts +9 -0
  1653. package/lib/Prisma/ComputeArchive.d.ts.map +1 -1
  1654. package/lib/Prisma/ComputeArchive.js +14 -4
  1655. package/lib/Prisma/ComputeArchive.js.map +1 -1
  1656. package/lib/Prisma/ComputeBuild.d.ts +67 -2
  1657. package/lib/Prisma/ComputeBuild.d.ts.map +1 -1
  1658. package/lib/Prisma/ComputeBuild.js +147 -1
  1659. package/lib/Prisma/ComputeBuild.js.map +1 -1
  1660. package/lib/Prisma/ComputeLifecycle.d.ts +51 -8
  1661. package/lib/Prisma/ComputeLifecycle.d.ts.map +1 -1
  1662. package/lib/Prisma/ComputeLifecycle.js +82 -40
  1663. package/lib/Prisma/ComputeLifecycle.js.map +1 -1
  1664. package/lib/Prisma/Connection.d.ts.map +1 -1
  1665. package/lib/Prisma/Connection.js +72 -30
  1666. package/lib/Prisma/Connection.js.map +1 -1
  1667. package/lib/Prisma/Credentials.d.ts +22 -0
  1668. package/lib/Prisma/Credentials.d.ts.map +1 -0
  1669. package/lib/Prisma/Credentials.js +43 -0
  1670. package/lib/Prisma/Credentials.js.map +1 -0
  1671. package/lib/Prisma/Database.d.ts +9 -4
  1672. package/lib/Prisma/Database.d.ts.map +1 -1
  1673. package/lib/Prisma/Database.js +102 -66
  1674. package/lib/Prisma/Database.js.map +1 -1
  1675. package/lib/Prisma/Deployment.d.ts.map +1 -1
  1676. package/lib/Prisma/Deployment.js +55 -26
  1677. package/lib/Prisma/Deployment.js.map +1 -1
  1678. package/lib/Prisma/EnvironmentVariable.d.ts.map +1 -1
  1679. package/lib/Prisma/EnvironmentVariable.js +50 -26
  1680. package/lib/Prisma/EnvironmentVariable.js.map +1 -1
  1681. package/lib/Prisma/Internal/AppPromotion.d.ts +5 -4
  1682. package/lib/Prisma/Internal/AppPromotion.d.ts.map +1 -1
  1683. package/lib/Prisma/Internal/AppPromotion.js +16 -15
  1684. package/lib/Prisma/Internal/AppPromotion.js.map +1 -1
  1685. package/lib/Prisma/Internal/DatabaseSecrets.d.ts +5 -5
  1686. package/lib/Prisma/Internal/DatabaseSecrets.d.ts.map +1 -1
  1687. package/lib/Prisma/Internal/DatabaseSecrets.js +10 -5
  1688. package/lib/Prisma/Internal/DatabaseSecrets.js.map +1 -1
  1689. package/lib/Prisma/Internal/DeploymentActions.d.ts +3 -3
  1690. package/lib/Prisma/Internal/DeploymentActions.d.ts.map +1 -1
  1691. package/lib/Prisma/Internal/DeploymentActions.js +7 -11
  1692. package/lib/Prisma/Internal/DeploymentActions.js.map +1 -1
  1693. package/lib/Prisma/Internal/DeploymentIdentity.d.ts +2 -3
  1694. package/lib/Prisma/Internal/DeploymentIdentity.d.ts.map +1 -1
  1695. package/lib/Prisma/Internal/DeploymentIdentity.js +23 -2
  1696. package/lib/Prisma/Internal/DeploymentIdentity.js.map +1 -1
  1697. package/lib/Prisma/Internal/DeploymentObserve.d.ts +2 -2
  1698. package/lib/Prisma/Internal/DeploymentObserve.d.ts.map +1 -1
  1699. package/lib/Prisma/Internal/DeploymentObserve.js +3 -1
  1700. package/lib/Prisma/Internal/DeploymentObserve.js.map +1 -1
  1701. package/lib/Prisma/Internal/LogsClient.d.ts +8 -0
  1702. package/lib/Prisma/Internal/LogsClient.d.ts.map +1 -0
  1703. package/lib/Prisma/Internal/LogsClient.js +120 -0
  1704. package/lib/Prisma/Internal/LogsClient.js.map +1 -0
  1705. package/lib/Prisma/Internal/Observed.d.ts +164 -0
  1706. package/lib/Prisma/Internal/Observed.d.ts.map +1 -0
  1707. package/lib/Prisma/Internal/Observed.js +36 -0
  1708. package/lib/Prisma/Internal/Observed.js.map +1 -0
  1709. package/lib/Prisma/Internal/Pagination.d.ts +18 -0
  1710. package/lib/Prisma/Internal/Pagination.d.ts.map +1 -0
  1711. package/lib/Prisma/Internal/Pagination.js +13 -0
  1712. package/lib/Prisma/Internal/Pagination.js.map +1 -0
  1713. package/lib/Prisma/Operations.d.ts +2 -2
  1714. package/lib/Prisma/Operations.d.ts.map +1 -1
  1715. package/lib/Prisma/Operations.js +3 -2
  1716. package/lib/Prisma/Operations.js.map +1 -1
  1717. package/lib/Prisma/PrismaEnvironment.d.ts +1 -2
  1718. package/lib/Prisma/PrismaEnvironment.d.ts.map +1 -1
  1719. package/lib/Prisma/PrismaEnvironment.js +4 -9
  1720. package/lib/Prisma/PrismaEnvironment.js.map +1 -1
  1721. package/lib/Prisma/PrismaLogs.d.ts +2 -2
  1722. package/lib/Prisma/PrismaLogs.d.ts.map +1 -1
  1723. package/lib/Prisma/PrismaLogs.js +13 -4
  1724. package/lib/Prisma/PrismaLogs.js.map +1 -1
  1725. package/lib/Prisma/Project.d.ts +1 -2
  1726. package/lib/Prisma/Project.d.ts.map +1 -1
  1727. package/lib/Prisma/Project.js +84 -52
  1728. package/lib/Prisma/Project.js.map +1 -1
  1729. package/lib/Prisma/Providers.d.ts +19 -3
  1730. package/lib/Prisma/Providers.d.ts.map +1 -1
  1731. package/lib/Prisma/Providers.js +31 -12
  1732. package/lib/Prisma/Providers.js.map +1 -1
  1733. package/lib/Prisma/SourceRepository.d.ts.map +1 -1
  1734. package/lib/Prisma/SourceRepository.js +137 -45
  1735. package/lib/Prisma/SourceRepository.js.map +1 -1
  1736. package/lib/Provider.d.ts +16 -4
  1737. package/lib/Provider.d.ts.map +1 -1
  1738. package/lib/Provider.js +21 -18
  1739. package/lib/Provider.js.map +1 -1
  1740. package/lib/Railway/AuditLog.d.ts +46 -5
  1741. package/lib/Railway/AuditLog.d.ts.map +1 -1
  1742. package/lib/Railway/AuditLog.js +14 -4
  1743. package/lib/Railway/AuditLog.js.map +1 -1
  1744. package/lib/Railway/AuthProvider.d.ts +19 -19
  1745. package/lib/Railway/AuthProvider.d.ts.map +1 -1
  1746. package/lib/Railway/AuthProvider.js +193 -127
  1747. package/lib/Railway/AuthProvider.js.map +1 -1
  1748. package/lib/Railway/Bucket.d.ts +1 -1
  1749. package/lib/Railway/Bucket.d.ts.map +1 -1
  1750. package/lib/Railway/Bucket.js +41 -21
  1751. package/lib/Railway/Bucket.js.map +1 -1
  1752. package/lib/Railway/BucketBinding.js +5 -5
  1753. package/lib/Railway/Catalog.d.ts +42 -4
  1754. package/lib/Railway/Catalog.d.ts.map +1 -1
  1755. package/lib/Railway/Catalog.js +6 -1
  1756. package/lib/Railway/Catalog.js.map +1 -1
  1757. package/lib/Railway/CloudAgent.d.ts +68 -4
  1758. package/lib/Railway/CloudAgent.d.ts.map +1 -1
  1759. package/lib/Railway/CloudAgent.js +26 -22
  1760. package/lib/Railway/CloudAgent.js.map +1 -1
  1761. package/lib/Railway/Credentials.d.ts +2 -5
  1762. package/lib/Railway/Credentials.d.ts.map +1 -1
  1763. package/lib/Railway/Credentials.js +5 -11
  1764. package/lib/Railway/Credentials.js.map +1 -1
  1765. package/lib/Railway/CustomDomain.d.ts +1 -1
  1766. package/lib/Railway/CustomDomain.d.ts.map +1 -1
  1767. package/lib/Railway/CustomDomain.js +60 -34
  1768. package/lib/Railway/CustomDomain.js.map +1 -1
  1769. package/lib/Railway/Environment.d.ts +20 -2
  1770. package/lib/Railway/Environment.d.ts.map +1 -1
  1771. package/lib/Railway/Environment.js +7 -2
  1772. package/lib/Railway/Environment.js.map +1 -1
  1773. package/lib/Railway/Function.d.ts +1 -1
  1774. package/lib/Railway/Function.d.ts.map +1 -1
  1775. package/lib/Railway/Function.js +77 -59
  1776. package/lib/Railway/Function.js.map +1 -1
  1777. package/lib/Railway/GraphQL.d.ts +1230 -0
  1778. package/lib/Railway/GraphQL.d.ts.map +1 -0
  1779. package/lib/Railway/GraphQL.js +132 -0
  1780. package/lib/Railway/GraphQL.js.map +1 -0
  1781. package/lib/Railway/Group.d.ts +1 -1
  1782. package/lib/Railway/Group.d.ts.map +1 -1
  1783. package/lib/Railway/Group.js +103 -32
  1784. package/lib/Railway/Group.js.map +1 -1
  1785. package/lib/Railway/LoginSession.d.ts +13 -5
  1786. package/lib/Railway/LoginSession.d.ts.map +1 -1
  1787. package/lib/Railway/LoginSession.js +9 -8
  1788. package/lib/Railway/LoginSession.js.map +1 -1
  1789. package/lib/Railway/Mongo.d.ts +1 -1
  1790. package/lib/Railway/Mongo.d.ts.map +1 -1
  1791. package/lib/Railway/Mongo.js +118 -104
  1792. package/lib/Railway/Mongo.js.map +1 -1
  1793. package/lib/Railway/MountVolume.d.ts.map +1 -1
  1794. package/lib/Railway/MountVolume.js +5 -4
  1795. package/lib/Railway/MountVolume.js.map +1 -1
  1796. package/lib/Railway/MySQL.d.ts +1 -1
  1797. package/lib/Railway/MySQL.d.ts.map +1 -1
  1798. package/lib/Railway/MySQL.js +118 -104
  1799. package/lib/Railway/MySQL.js.map +1 -1
  1800. package/lib/Railway/Postgres.d.ts +1 -1
  1801. package/lib/Railway/Postgres.d.ts.map +1 -1
  1802. package/lib/Railway/Postgres.js +124 -106
  1803. package/lib/Railway/Postgres.js.map +1 -1
  1804. package/lib/Railway/PrivateNetwork.d.ts +87 -61
  1805. package/lib/Railway/PrivateNetwork.d.ts.map +1 -1
  1806. package/lib/Railway/PrivateNetwork.js +298 -196
  1807. package/lib/Railway/PrivateNetwork.js.map +1 -1
  1808. package/lib/Railway/Project.d.ts +80 -6
  1809. package/lib/Railway/Project.d.ts.map +1 -1
  1810. package/lib/Railway/Project.js +27 -20
  1811. package/lib/Railway/Project.js.map +1 -1
  1812. package/lib/Railway/ProjectEnvironment.d.ts +1 -1
  1813. package/lib/Railway/ProjectEnvironment.d.ts.map +1 -1
  1814. package/lib/Railway/ProjectEnvironment.js +25 -18
  1815. package/lib/Railway/ProjectEnvironment.js.map +1 -1
  1816. package/lib/Railway/Providers.d.ts +1 -1
  1817. package/lib/Railway/Providers.d.ts.map +1 -1
  1818. package/lib/Railway/Providers.js +4 -3
  1819. package/lib/Railway/Providers.js.map +1 -1
  1820. package/lib/Railway/Redis.d.ts +1 -1
  1821. package/lib/Railway/Redis.d.ts.map +1 -1
  1822. package/lib/Railway/Redis.js +57 -46
  1823. package/lib/Railway/Redis.js.map +1 -1
  1824. package/lib/Railway/RedisBinding.js +2 -2
  1825. package/lib/Railway/Sandbox.d.ts +183 -17
  1826. package/lib/Railway/Sandbox.d.ts.map +1 -1
  1827. package/lib/Railway/Sandbox.js +117 -58
  1828. package/lib/Railway/Sandbox.js.map +1 -1
  1829. package/lib/Railway/SandboxCheckpoint.d.ts +84 -0
  1830. package/lib/Railway/SandboxCheckpoint.d.ts.map +1 -0
  1831. package/lib/Railway/SandboxCheckpoint.js +189 -0
  1832. package/lib/Railway/SandboxCheckpoint.js.map +1 -0
  1833. package/lib/Railway/Service.d.ts +75 -2
  1834. package/lib/Railway/Service.d.ts.map +1 -1
  1835. package/lib/Railway/Service.js +42 -0
  1836. package/lib/Railway/Service.js.map +1 -1
  1837. package/lib/Railway/ServiceDomain.d.ts +102 -3
  1838. package/lib/Railway/ServiceDomain.d.ts.map +1 -1
  1839. package/lib/Railway/ServiceDomain.js +135 -38
  1840. package/lib/Railway/ServiceDomain.js.map +1 -1
  1841. package/lib/Railway/ServiceProvider.d.ts +2 -10
  1842. package/lib/Railway/ServiceProvider.d.ts.map +1 -1
  1843. package/lib/Railway/ServiceProvider.js +281 -125
  1844. package/lib/Railway/ServiceProvider.js.map +1 -1
  1845. package/lib/Railway/TcpProxy.d.ts +1 -1
  1846. package/lib/Railway/TcpProxy.d.ts.map +1 -1
  1847. package/lib/Railway/TcpProxy.js +26 -18
  1848. package/lib/Railway/TcpProxy.js.map +1 -1
  1849. package/lib/Railway/Template.d.ts +5 -5
  1850. package/lib/Railway/Template.d.ts.map +1 -1
  1851. package/lib/Railway/Template.js +84 -57
  1852. package/lib/Railway/Template.js.map +1 -1
  1853. package/lib/Railway/Usage.d.ts +82 -5
  1854. package/lib/Railway/Usage.d.ts.map +1 -1
  1855. package/lib/Railway/Usage.js +30 -14
  1856. package/lib/Railway/Usage.js.map +1 -1
  1857. package/lib/Railway/Variable.d.ts +1 -1
  1858. package/lib/Railway/Variable.d.ts.map +1 -1
  1859. package/lib/Railway/Variable.js +10 -12
  1860. package/lib/Railway/Variable.js.map +1 -1
  1861. package/lib/Railway/Volume.d.ts +77 -3
  1862. package/lib/Railway/Volume.d.ts.map +1 -1
  1863. package/lib/Railway/Volume.js +71 -39
  1864. package/lib/Railway/Volume.js.map +1 -1
  1865. package/lib/Railway/VolumeBackup.d.ts +20 -4
  1866. package/lib/Railway/VolumeBackup.d.ts.map +1 -1
  1867. package/lib/Railway/VolumeBackup.js +53 -34
  1868. package/lib/Railway/VolumeBackup.js.map +1 -1
  1869. package/lib/Railway/Website/Cdn.d.ts +18 -2
  1870. package/lib/Railway/Website/Cdn.d.ts.map +1 -1
  1871. package/lib/Railway/Website/Cdn.js +82 -35
  1872. package/lib/Railway/Website/Cdn.js.map +1 -1
  1873. package/lib/Railway/hosted.d.ts.map +1 -1
  1874. package/lib/Railway/hosted.js +10 -3
  1875. package/lib/Railway/hosted.js.map +1 -1
  1876. package/lib/Railway/index.d.ts +1 -0
  1877. package/lib/Railway/index.d.ts.map +1 -1
  1878. package/lib/Railway/index.js +1 -0
  1879. package/lib/Railway/index.js.map +1 -1
  1880. package/lib/Railway/local-context.d.ts +125 -0
  1881. package/lib/Railway/local-context.d.ts.map +1 -0
  1882. package/lib/Railway/local-context.js +254 -0
  1883. package/lib/Railway/local-context.js.map +1 -0
  1884. package/lib/Railway/transient.d.ts +6 -16
  1885. package/lib/Railway/transient.d.ts.map +1 -1
  1886. package/lib/Railway/transient.js +20 -32
  1887. package/lib/Railway/transient.js.map +1 -1
  1888. package/lib/Report.d.ts +248 -0
  1889. package/lib/Report.d.ts.map +1 -0
  1890. package/lib/Report.js +18 -0
  1891. package/lib/Report.js.map +1 -0
  1892. package/lib/Rpc.d.ts +22 -1
  1893. package/lib/Rpc.d.ts.map +1 -1
  1894. package/lib/Rpc.js +37 -2
  1895. package/lib/Rpc.js.map +1 -1
  1896. package/lib/Runtime/Bootstrap/Process.js +2 -2
  1897. package/lib/Runtime.d.ts +1 -1
  1898. package/lib/Runtime.js +1 -1
  1899. package/lib/RuntimeContext.d.ts +1 -1
  1900. package/lib/RuntimeContext.js +1 -1
  1901. package/lib/SQL/Postgres.d.ts.map +1 -1
  1902. package/lib/SQL/Postgres.js +5 -1
  1903. package/lib/SQL/Postgres.js.map +1 -1
  1904. package/lib/SQL/PostgresTls.d.ts +29 -0
  1905. package/lib/SQL/PostgresTls.d.ts.map +1 -0
  1906. package/lib/SQL/PostgresTls.js +63 -0
  1907. package/lib/SQL/PostgresTls.js.map +1 -0
  1908. package/lib/Server/Process.js +1 -1
  1909. package/lib/Server/index.d.ts +0 -2
  1910. package/lib/Server/index.d.ts.map +1 -1
  1911. package/lib/Server/index.js +0 -2
  1912. package/lib/Server/index.js.map +1 -1
  1913. package/lib/Stack.d.ts +7 -6
  1914. package/lib/Stack.d.ts.map +1 -1
  1915. package/lib/Stack.js +4 -5
  1916. package/lib/Stack.js.map +1 -1
  1917. package/lib/StackContext.d.ts +4 -0
  1918. package/lib/StackContext.d.ts.map +1 -0
  1919. package/lib/StackContext.js +3 -0
  1920. package/lib/StackContext.js.map +1 -0
  1921. package/lib/State/Export.d.ts +6 -4
  1922. package/lib/State/Export.d.ts.map +1 -1
  1923. package/lib/State/Export.js +13 -18
  1924. package/lib/State/Export.js.map +1 -1
  1925. package/lib/State/HttpStateApi.d.ts +8 -8
  1926. package/lib/State/HttpStateStore.d.ts +6 -11
  1927. package/lib/State/HttpStateStore.d.ts.map +1 -1
  1928. package/lib/State/HttpStateStore.js +25 -35
  1929. package/lib/State/HttpStateStore.js.map +1 -1
  1930. package/lib/State/LocalState.d.ts.map +1 -1
  1931. package/lib/State/LocalState.js +6 -13
  1932. package/lib/State/LocalState.js.map +1 -1
  1933. package/lib/State/PostgresState.d.ts +4 -4
  1934. package/lib/State/PostgresState.d.ts.map +1 -1
  1935. package/lib/State/PostgresState.js +5 -4
  1936. package/lib/State/PostgresState.js.map +1 -1
  1937. package/lib/State/State.d.ts +5 -0
  1938. package/lib/State/State.d.ts.map +1 -1
  1939. package/lib/State/State.js.map +1 -1
  1940. package/lib/State/Tree.d.ts +62 -0
  1941. package/lib/State/Tree.d.ts.map +1 -0
  1942. package/lib/State/Tree.js +166 -0
  1943. package/lib/State/Tree.js.map +1 -0
  1944. package/lib/State/index.d.ts +1 -0
  1945. package/lib/State/index.d.ts.map +1 -1
  1946. package/lib/State/index.js +1 -0
  1947. package/lib/State/index.js.map +1 -1
  1948. package/lib/Stripe/Account.d.ts +308 -0
  1949. package/lib/Stripe/Account.d.ts.map +1 -0
  1950. package/lib/Stripe/Account.js +436 -0
  1951. package/lib/Stripe/Account.js.map +1 -0
  1952. package/lib/Stripe/AccountExternalAccount.d.ts +139 -0
  1953. package/lib/Stripe/AccountExternalAccount.d.ts.map +1 -0
  1954. package/lib/Stripe/AccountExternalAccount.js +354 -0
  1955. package/lib/Stripe/AccountExternalAccount.js.map +1 -0
  1956. package/lib/Stripe/AccountPerson.d.ts +142 -0
  1957. package/lib/Stripe/AccountPerson.d.ts.map +1 -0
  1958. package/lib/Stripe/AccountPerson.js +354 -0
  1959. package/lib/Stripe/AccountPerson.js.map +1 -0
  1960. package/lib/Stripe/Alert.d.ts +168 -0
  1961. package/lib/Stripe/Alert.d.ts.map +1 -0
  1962. package/lib/Stripe/Alert.js +285 -0
  1963. package/lib/Stripe/Alert.js.map +1 -0
  1964. package/lib/Stripe/ApplePayDomain.d.ts +75 -0
  1965. package/lib/Stripe/ApplePayDomain.d.ts.map +1 -0
  1966. package/lib/Stripe/ApplePayDomain.js +178 -0
  1967. package/lib/Stripe/ApplePayDomain.js.map +1 -0
  1968. package/lib/Stripe/AppsSecret.d.ts +120 -0
  1969. package/lib/Stripe/AppsSecret.d.ts.map +1 -0
  1970. package/lib/Stripe/AppsSecret.js +232 -0
  1971. package/lib/Stripe/AppsSecret.js.map +1 -0
  1972. package/lib/Stripe/AuthProvider.d.ts +27 -0
  1973. package/lib/Stripe/AuthProvider.d.ts.map +1 -0
  1974. package/lib/Stripe/AuthProvider.js +56 -0
  1975. package/lib/Stripe/AuthProvider.js.map +1 -0
  1976. package/lib/Stripe/BillingMeter.d.ts +168 -0
  1977. package/lib/Stripe/BillingMeter.d.ts.map +1 -0
  1978. package/lib/Stripe/BillingMeter.js +270 -0
  1979. package/lib/Stripe/BillingMeter.js.map +1 -0
  1980. package/lib/Stripe/BillingPortalConfiguration.d.ts +358 -0
  1981. package/lib/Stripe/BillingPortalConfiguration.d.ts.map +1 -0
  1982. package/lib/Stripe/BillingPortalConfiguration.js +480 -0
  1983. package/lib/Stripe/BillingPortalConfiguration.js.map +1 -0
  1984. package/lib/Stripe/ConsumeEvents.d.ts +80 -0
  1985. package/lib/Stripe/ConsumeEvents.d.ts.map +1 -0
  1986. package/lib/Stripe/ConsumeEvents.js +139 -0
  1987. package/lib/Stripe/ConsumeEvents.js.map +1 -0
  1988. package/lib/Stripe/Coupon.d.ts +179 -0
  1989. package/lib/Stripe/Coupon.d.ts.map +1 -0
  1990. package/lib/Stripe/Coupon.js +323 -0
  1991. package/lib/Stripe/Coupon.js.map +1 -0
  1992. package/lib/Stripe/CreateAccount.d.ts +25 -0
  1993. package/lib/Stripe/CreateAccount.d.ts.map +1 -0
  1994. package/lib/Stripe/CreateAccount.js +3 -0
  1995. package/lib/Stripe/CreateAccount.js.map +1 -0
  1996. package/lib/Stripe/CreateAccountHttp.d.ts +11 -0
  1997. package/lib/Stripe/CreateAccountHttp.d.ts.map +1 -0
  1998. package/lib/Stripe/CreateAccountHttp.js +17 -0
  1999. package/lib/Stripe/CreateAccountHttp.js.map +1 -0
  2000. package/lib/Stripe/CreateAccountLink.d.ts +29 -0
  2001. package/lib/Stripe/CreateAccountLink.d.ts.map +1 -0
  2002. package/lib/Stripe/CreateAccountLink.js +3 -0
  2003. package/lib/Stripe/CreateAccountLink.js.map +1 -0
  2004. package/lib/Stripe/CreateAccountLinkHttp.d.ts +11 -0
  2005. package/lib/Stripe/CreateAccountLinkHttp.d.ts.map +1 -0
  2006. package/lib/Stripe/CreateAccountLinkHttp.js +17 -0
  2007. package/lib/Stripe/CreateAccountLinkHttp.js.map +1 -0
  2008. package/lib/Stripe/CreateAppsSecret.d.ts +25 -0
  2009. package/lib/Stripe/CreateAppsSecret.d.ts.map +1 -0
  2010. package/lib/Stripe/CreateAppsSecret.js +3 -0
  2011. package/lib/Stripe/CreateAppsSecret.js.map +1 -0
  2012. package/lib/Stripe/CreateAppsSecretHttp.d.ts +11 -0
  2013. package/lib/Stripe/CreateAppsSecretHttp.d.ts.map +1 -0
  2014. package/lib/Stripe/CreateAppsSecretHttp.js +17 -0
  2015. package/lib/Stripe/CreateAppsSecretHttp.js.map +1 -0
  2016. package/lib/Stripe/CreateBillingPortalSession.d.ts +33 -0
  2017. package/lib/Stripe/CreateBillingPortalSession.d.ts.map +1 -0
  2018. package/lib/Stripe/CreateBillingPortalSession.js +3 -0
  2019. package/lib/Stripe/CreateBillingPortalSession.js.map +1 -0
  2020. package/lib/Stripe/CreateBillingPortalSessionHttp.d.ts +11 -0
  2021. package/lib/Stripe/CreateBillingPortalSessionHttp.d.ts.map +1 -0
  2022. package/lib/Stripe/CreateBillingPortalSessionHttp.js +17 -0
  2023. package/lib/Stripe/CreateBillingPortalSessionHttp.js.map +1 -0
  2024. package/lib/Stripe/CreateCheckoutSession.d.ts +35 -0
  2025. package/lib/Stripe/CreateCheckoutSession.d.ts.map +1 -0
  2026. package/lib/Stripe/CreateCheckoutSession.js +3 -0
  2027. package/lib/Stripe/CreateCheckoutSession.js.map +1 -0
  2028. package/lib/Stripe/CreateCheckoutSessionHttp.d.ts +11 -0
  2029. package/lib/Stripe/CreateCheckoutSessionHttp.d.ts.map +1 -0
  2030. package/lib/Stripe/CreateCheckoutSessionHttp.js +17 -0
  2031. package/lib/Stripe/CreateCheckoutSessionHttp.js.map +1 -0
  2032. package/lib/Stripe/CreateCreditGrant.d.ts +27 -0
  2033. package/lib/Stripe/CreateCreditGrant.d.ts.map +1 -0
  2034. package/lib/Stripe/CreateCreditGrant.js +3 -0
  2035. package/lib/Stripe/CreateCreditGrant.js.map +1 -0
  2036. package/lib/Stripe/CreateCreditGrantHttp.d.ts +11 -0
  2037. package/lib/Stripe/CreateCreditGrantHttp.d.ts.map +1 -0
  2038. package/lib/Stripe/CreateCreditGrantHttp.js +17 -0
  2039. package/lib/Stripe/CreateCreditGrantHttp.js.map +1 -0
  2040. package/lib/Stripe/CreateCustomer.d.ts +24 -0
  2041. package/lib/Stripe/CreateCustomer.d.ts.map +1 -0
  2042. package/lib/Stripe/CreateCustomer.js +3 -0
  2043. package/lib/Stripe/CreateCustomer.js.map +1 -0
  2044. package/lib/Stripe/CreateCustomerHttp.d.ts +11 -0
  2045. package/lib/Stripe/CreateCustomerHttp.d.ts.map +1 -0
  2046. package/lib/Stripe/CreateCustomerHttp.js +17 -0
  2047. package/lib/Stripe/CreateCustomerHttp.js.map +1 -0
  2048. package/lib/Stripe/CreateFileLink.d.ts +23 -0
  2049. package/lib/Stripe/CreateFileLink.d.ts.map +1 -0
  2050. package/lib/Stripe/CreateFileLink.js +3 -0
  2051. package/lib/Stripe/CreateFileLink.js.map +1 -0
  2052. package/lib/Stripe/CreateFileLinkHttp.d.ts +11 -0
  2053. package/lib/Stripe/CreateFileLinkHttp.d.ts.map +1 -0
  2054. package/lib/Stripe/CreateFileLinkHttp.js +17 -0
  2055. package/lib/Stripe/CreateFileLinkHttp.js.map +1 -0
  2056. package/lib/Stripe/CreateIssuingCard.d.ts +25 -0
  2057. package/lib/Stripe/CreateIssuingCard.d.ts.map +1 -0
  2058. package/lib/Stripe/CreateIssuingCard.js +3 -0
  2059. package/lib/Stripe/CreateIssuingCard.js.map +1 -0
  2060. package/lib/Stripe/CreateIssuingCardHttp.d.ts +11 -0
  2061. package/lib/Stripe/CreateIssuingCardHttp.d.ts.map +1 -0
  2062. package/lib/Stripe/CreateIssuingCardHttp.js +17 -0
  2063. package/lib/Stripe/CreateIssuingCardHttp.js.map +1 -0
  2064. package/lib/Stripe/CreateIssuingCardholder.d.ts +32 -0
  2065. package/lib/Stripe/CreateIssuingCardholder.d.ts.map +1 -0
  2066. package/lib/Stripe/CreateIssuingCardholder.js +3 -0
  2067. package/lib/Stripe/CreateIssuingCardholder.js.map +1 -0
  2068. package/lib/Stripe/CreateIssuingCardholderHttp.d.ts +11 -0
  2069. package/lib/Stripe/CreateIssuingCardholderHttp.d.ts.map +1 -0
  2070. package/lib/Stripe/CreateIssuingCardholderHttp.js +17 -0
  2071. package/lib/Stripe/CreateIssuingCardholderHttp.js.map +1 -0
  2072. package/lib/Stripe/CreateTerminalReader.d.ts +25 -0
  2073. package/lib/Stripe/CreateTerminalReader.d.ts.map +1 -0
  2074. package/lib/Stripe/CreateTerminalReader.js +3 -0
  2075. package/lib/Stripe/CreateTerminalReader.js.map +1 -0
  2076. package/lib/Stripe/CreateTerminalReaderHttp.d.ts +11 -0
  2077. package/lib/Stripe/CreateTerminalReaderHttp.d.ts.map +1 -0
  2078. package/lib/Stripe/CreateTerminalReaderHttp.js +17 -0
  2079. package/lib/Stripe/CreateTerminalReaderHttp.js.map +1 -0
  2080. package/lib/Stripe/Credentials.d.ts +15 -0
  2081. package/lib/Stripe/Credentials.d.ts.map +1 -0
  2082. package/lib/Stripe/Credentials.js +27 -0
  2083. package/lib/Stripe/Credentials.js.map +1 -0
  2084. package/lib/Stripe/CreditGrant.d.ts +219 -0
  2085. package/lib/Stripe/CreditGrant.d.ts.map +1 -0
  2086. package/lib/Stripe/CreditGrant.js +364 -0
  2087. package/lib/Stripe/CreditGrant.js.map +1 -0
  2088. package/lib/Stripe/Customer.d.ts +90 -0
  2089. package/lib/Stripe/Customer.d.ts.map +1 -0
  2090. package/lib/Stripe/Customer.js +203 -0
  2091. package/lib/Stripe/Customer.js.map +1 -0
  2092. package/lib/Stripe/CustomerTaxId.d.ts +81 -0
  2093. package/lib/Stripe/CustomerTaxId.d.ts.map +1 -0
  2094. package/lib/Stripe/CustomerTaxId.js +228 -0
  2095. package/lib/Stripe/CustomerTaxId.js.map +1 -0
  2096. package/lib/Stripe/EntitlementsFeature.d.ts +96 -0
  2097. package/lib/Stripe/EntitlementsFeature.d.ts.map +1 -0
  2098. package/lib/Stripe/EntitlementsFeature.js +261 -0
  2099. package/lib/Stripe/EntitlementsFeature.js.map +1 -0
  2100. package/lib/Stripe/Events.d.ts +91 -0
  2101. package/lib/Stripe/Events.d.ts.map +1 -0
  2102. package/lib/Stripe/Events.js +102 -0
  2103. package/lib/Stripe/Events.js.map +1 -0
  2104. package/lib/Stripe/FileLink.d.ts +92 -0
  2105. package/lib/Stripe/FileLink.d.ts.map +1 -0
  2106. package/lib/Stripe/FileLink.js +229 -0
  2107. package/lib/Stripe/FileLink.js.map +1 -0
  2108. package/lib/Stripe/IssuingCard.d.ts +249 -0
  2109. package/lib/Stripe/IssuingCard.d.ts.map +1 -0
  2110. package/lib/Stripe/IssuingCard.js +423 -0
  2111. package/lib/Stripe/IssuingCard.js.map +1 -0
  2112. package/lib/Stripe/IssuingCardholder.d.ts +366 -0
  2113. package/lib/Stripe/IssuingCardholder.d.ts.map +1 -0
  2114. package/lib/Stripe/IssuingCardholder.js +520 -0
  2115. package/lib/Stripe/IssuingCardholder.js.map +1 -0
  2116. package/lib/Stripe/IssuingPersonalizationDesign.d.ts +185 -0
  2117. package/lib/Stripe/IssuingPersonalizationDesign.d.ts.map +1 -0
  2118. package/lib/Stripe/IssuingPersonalizationDesign.js +340 -0
  2119. package/lib/Stripe/IssuingPersonalizationDesign.js.map +1 -0
  2120. package/lib/Stripe/Metadata.d.ts +39 -0
  2121. package/lib/Stripe/Metadata.d.ts.map +1 -0
  2122. package/lib/Stripe/Metadata.js +58 -0
  2123. package/lib/Stripe/Metadata.js.map +1 -0
  2124. package/lib/Stripe/PaymentLink.d.ts +219 -0
  2125. package/lib/Stripe/PaymentLink.d.ts.map +1 -0
  2126. package/lib/Stripe/PaymentLink.js +491 -0
  2127. package/lib/Stripe/PaymentLink.js.map +1 -0
  2128. package/lib/Stripe/PaymentMethodConfiguration.d.ts +269 -0
  2129. package/lib/Stripe/PaymentMethodConfiguration.d.ts.map +1 -0
  2130. package/lib/Stripe/PaymentMethodConfiguration.js +330 -0
  2131. package/lib/Stripe/PaymentMethodConfiguration.js.map +1 -0
  2132. package/lib/Stripe/PaymentMethodDomain.d.ts +118 -0
  2133. package/lib/Stripe/PaymentMethodDomain.d.ts.map +1 -0
  2134. package/lib/Stripe/PaymentMethodDomain.js +209 -0
  2135. package/lib/Stripe/PaymentMethodDomain.js.map +1 -0
  2136. package/lib/Stripe/Plan.d.ts +175 -0
  2137. package/lib/Stripe/Plan.d.ts.map +1 -0
  2138. package/lib/Stripe/Plan.js +305 -0
  2139. package/lib/Stripe/Plan.js.map +1 -0
  2140. package/lib/Stripe/Price.d.ts +176 -0
  2141. package/lib/Stripe/Price.d.ts.map +1 -0
  2142. package/lib/Stripe/Price.js +344 -0
  2143. package/lib/Stripe/Price.js.map +1 -0
  2144. package/lib/Stripe/Product.d.ts +92 -0
  2145. package/lib/Stripe/Product.d.ts.map +1 -0
  2146. package/lib/Stripe/Product.js +222 -0
  2147. package/lib/Stripe/Product.js.map +1 -0
  2148. package/lib/Stripe/ProductFeature.d.ts +70 -0
  2149. package/lib/Stripe/ProductFeature.d.ts.map +1 -0
  2150. package/lib/Stripe/ProductFeature.js +206 -0
  2151. package/lib/Stripe/ProductFeature.js.map +1 -0
  2152. package/lib/Stripe/PromotionCode.d.ts +168 -0
  2153. package/lib/Stripe/PromotionCode.d.ts.map +1 -0
  2154. package/lib/Stripe/PromotionCode.js +396 -0
  2155. package/lib/Stripe/PromotionCode.js.map +1 -0
  2156. package/lib/Stripe/Providers.d.ts +36 -0
  2157. package/lib/Stripe/Providers.d.ts.map +1 -0
  2158. package/lib/Stripe/Providers.js +162 -0
  2159. package/lib/Stripe/Providers.js.map +1 -0
  2160. package/lib/Stripe/RadarValueList.d.ts +112 -0
  2161. package/lib/Stripe/RadarValueList.d.ts.map +1 -0
  2162. package/lib/Stripe/RadarValueList.js +259 -0
  2163. package/lib/Stripe/RadarValueList.js.map +1 -0
  2164. package/lib/Stripe/RadarValueListItem.d.ts +69 -0
  2165. package/lib/Stripe/RadarValueListItem.d.ts.map +1 -0
  2166. package/lib/Stripe/RadarValueListItem.js +213 -0
  2167. package/lib/Stripe/RadarValueListItem.js.map +1 -0
  2168. package/lib/Stripe/RestrictedApiKey.d.ts +85 -0
  2169. package/lib/Stripe/RestrictedApiKey.d.ts.map +1 -0
  2170. package/lib/Stripe/RestrictedApiKey.js +91 -0
  2171. package/lib/Stripe/RestrictedApiKey.js.map +1 -0
  2172. package/lib/Stripe/RetrieveAccount.d.ts +23 -0
  2173. package/lib/Stripe/RetrieveAccount.d.ts.map +1 -0
  2174. package/lib/Stripe/RetrieveAccount.js +3 -0
  2175. package/lib/Stripe/RetrieveAccount.js.map +1 -0
  2176. package/lib/Stripe/RetrieveAccountExternalAccount.d.ts +23 -0
  2177. package/lib/Stripe/RetrieveAccountExternalAccount.d.ts.map +1 -0
  2178. package/lib/Stripe/RetrieveAccountExternalAccount.js +3 -0
  2179. package/lib/Stripe/RetrieveAccountExternalAccount.js.map +1 -0
  2180. package/lib/Stripe/RetrieveAccountExternalAccountHttp.d.ts +11 -0
  2181. package/lib/Stripe/RetrieveAccountExternalAccountHttp.d.ts.map +1 -0
  2182. package/lib/Stripe/RetrieveAccountExternalAccountHttp.js +31 -0
  2183. package/lib/Stripe/RetrieveAccountExternalAccountHttp.js.map +1 -0
  2184. package/lib/Stripe/RetrieveAccountHttp.d.ts +11 -0
  2185. package/lib/Stripe/RetrieveAccountHttp.d.ts.map +1 -0
  2186. package/lib/Stripe/RetrieveAccountHttp.js +18 -0
  2187. package/lib/Stripe/RetrieveAccountHttp.js.map +1 -0
  2188. package/lib/Stripe/RetrieveAccountPerson.d.ts +23 -0
  2189. package/lib/Stripe/RetrieveAccountPerson.d.ts.map +1 -0
  2190. package/lib/Stripe/RetrieveAccountPerson.js +3 -0
  2191. package/lib/Stripe/RetrieveAccountPerson.js.map +1 -0
  2192. package/lib/Stripe/RetrieveAccountPersonHttp.d.ts +11 -0
  2193. package/lib/Stripe/RetrieveAccountPersonHttp.d.ts.map +1 -0
  2194. package/lib/Stripe/RetrieveAccountPersonHttp.js +31 -0
  2195. package/lib/Stripe/RetrieveAccountPersonHttp.js.map +1 -0
  2196. package/lib/Stripe/RetrieveAlert.d.ts +23 -0
  2197. package/lib/Stripe/RetrieveAlert.d.ts.map +1 -0
  2198. package/lib/Stripe/RetrieveAlert.js +3 -0
  2199. package/lib/Stripe/RetrieveAlert.js.map +1 -0
  2200. package/lib/Stripe/RetrieveAlertHttp.d.ts +10 -0
  2201. package/lib/Stripe/RetrieveAlertHttp.d.ts.map +1 -0
  2202. package/lib/Stripe/RetrieveAlertHttp.js +17 -0
  2203. package/lib/Stripe/RetrieveAlertHttp.js.map +1 -0
  2204. package/lib/Stripe/RetrieveApplePayDomain.d.ts +23 -0
  2205. package/lib/Stripe/RetrieveApplePayDomain.d.ts.map +1 -0
  2206. package/lib/Stripe/RetrieveApplePayDomain.js +3 -0
  2207. package/lib/Stripe/RetrieveApplePayDomain.js.map +1 -0
  2208. package/lib/Stripe/RetrieveApplePayDomainHttp.d.ts +11 -0
  2209. package/lib/Stripe/RetrieveApplePayDomainHttp.d.ts.map +1 -0
  2210. package/lib/Stripe/RetrieveApplePayDomainHttp.js +18 -0
  2211. package/lib/Stripe/RetrieveApplePayDomainHttp.js.map +1 -0
  2212. package/lib/Stripe/RetrieveAppsSecret.d.ts +24 -0
  2213. package/lib/Stripe/RetrieveAppsSecret.d.ts.map +1 -0
  2214. package/lib/Stripe/RetrieveAppsSecret.js +3 -0
  2215. package/lib/Stripe/RetrieveAppsSecret.js.map +1 -0
  2216. package/lib/Stripe/RetrieveAppsSecretHttp.d.ts +11 -0
  2217. package/lib/Stripe/RetrieveAppsSecretHttp.d.ts.map +1 -0
  2218. package/lib/Stripe/RetrieveAppsSecretHttp.js +36 -0
  2219. package/lib/Stripe/RetrieveAppsSecretHttp.js.map +1 -0
  2220. package/lib/Stripe/RetrieveBillingMeter.d.ts +23 -0
  2221. package/lib/Stripe/RetrieveBillingMeter.d.ts.map +1 -0
  2222. package/lib/Stripe/RetrieveBillingMeter.js +3 -0
  2223. package/lib/Stripe/RetrieveBillingMeter.js.map +1 -0
  2224. package/lib/Stripe/RetrieveBillingMeterHttp.d.ts +10 -0
  2225. package/lib/Stripe/RetrieveBillingMeterHttp.d.ts.map +1 -0
  2226. package/lib/Stripe/RetrieveBillingMeterHttp.js +17 -0
  2227. package/lib/Stripe/RetrieveBillingMeterHttp.js.map +1 -0
  2228. package/lib/Stripe/RetrieveBillingPortalConfiguration.d.ts +23 -0
  2229. package/lib/Stripe/RetrieveBillingPortalConfiguration.d.ts.map +1 -0
  2230. package/lib/Stripe/RetrieveBillingPortalConfiguration.js +3 -0
  2231. package/lib/Stripe/RetrieveBillingPortalConfiguration.js.map +1 -0
  2232. package/lib/Stripe/RetrieveBillingPortalConfigurationHttp.d.ts +10 -0
  2233. package/lib/Stripe/RetrieveBillingPortalConfigurationHttp.d.ts.map +1 -0
  2234. package/lib/Stripe/RetrieveBillingPortalConfigurationHttp.js +17 -0
  2235. package/lib/Stripe/RetrieveBillingPortalConfigurationHttp.js.map +1 -0
  2236. package/lib/Stripe/RetrieveCoupon.d.ts +23 -0
  2237. package/lib/Stripe/RetrieveCoupon.d.ts.map +1 -0
  2238. package/lib/Stripe/RetrieveCoupon.js +3 -0
  2239. package/lib/Stripe/RetrieveCoupon.js.map +1 -0
  2240. package/lib/Stripe/RetrieveCouponHttp.d.ts +11 -0
  2241. package/lib/Stripe/RetrieveCouponHttp.d.ts.map +1 -0
  2242. package/lib/Stripe/RetrieveCouponHttp.js +18 -0
  2243. package/lib/Stripe/RetrieveCouponHttp.js.map +1 -0
  2244. package/lib/Stripe/RetrieveCreditGrant.d.ts +23 -0
  2245. package/lib/Stripe/RetrieveCreditGrant.d.ts.map +1 -0
  2246. package/lib/Stripe/RetrieveCreditGrant.js +3 -0
  2247. package/lib/Stripe/RetrieveCreditGrant.js.map +1 -0
  2248. package/lib/Stripe/RetrieveCreditGrantHttp.d.ts +11 -0
  2249. package/lib/Stripe/RetrieveCreditGrantHttp.d.ts.map +1 -0
  2250. package/lib/Stripe/RetrieveCreditGrantHttp.js +18 -0
  2251. package/lib/Stripe/RetrieveCreditGrantHttp.js.map +1 -0
  2252. package/lib/Stripe/RetrieveCustomer.d.ts +23 -0
  2253. package/lib/Stripe/RetrieveCustomer.d.ts.map +1 -0
  2254. package/lib/Stripe/RetrieveCustomer.js +3 -0
  2255. package/lib/Stripe/RetrieveCustomer.js.map +1 -0
  2256. package/lib/Stripe/RetrieveCustomerHttp.d.ts +11 -0
  2257. package/lib/Stripe/RetrieveCustomerHttp.d.ts.map +1 -0
  2258. package/lib/Stripe/RetrieveCustomerHttp.js +18 -0
  2259. package/lib/Stripe/RetrieveCustomerHttp.js.map +1 -0
  2260. package/lib/Stripe/RetrieveCustomerTaxId.d.ts +23 -0
  2261. package/lib/Stripe/RetrieveCustomerTaxId.d.ts.map +1 -0
  2262. package/lib/Stripe/RetrieveCustomerTaxId.js +3 -0
  2263. package/lib/Stripe/RetrieveCustomerTaxId.js.map +1 -0
  2264. package/lib/Stripe/RetrieveCustomerTaxIdHttp.d.ts +11 -0
  2265. package/lib/Stripe/RetrieveCustomerTaxIdHttp.d.ts.map +1 -0
  2266. package/lib/Stripe/RetrieveCustomerTaxIdHttp.js +31 -0
  2267. package/lib/Stripe/RetrieveCustomerTaxIdHttp.js.map +1 -0
  2268. package/lib/Stripe/RetrieveEntitlementsFeature.d.ts +23 -0
  2269. package/lib/Stripe/RetrieveEntitlementsFeature.d.ts.map +1 -0
  2270. package/lib/Stripe/RetrieveEntitlementsFeature.js +3 -0
  2271. package/lib/Stripe/RetrieveEntitlementsFeature.js.map +1 -0
  2272. package/lib/Stripe/RetrieveEntitlementsFeatureHttp.d.ts +10 -0
  2273. package/lib/Stripe/RetrieveEntitlementsFeatureHttp.d.ts.map +1 -0
  2274. package/lib/Stripe/RetrieveEntitlementsFeatureHttp.js +17 -0
  2275. package/lib/Stripe/RetrieveEntitlementsFeatureHttp.js.map +1 -0
  2276. package/lib/Stripe/RetrieveFileLink.d.ts +23 -0
  2277. package/lib/Stripe/RetrieveFileLink.d.ts.map +1 -0
  2278. package/lib/Stripe/RetrieveFileLink.js +3 -0
  2279. package/lib/Stripe/RetrieveFileLink.js.map +1 -0
  2280. package/lib/Stripe/RetrieveFileLinkHttp.d.ts +11 -0
  2281. package/lib/Stripe/RetrieveFileLinkHttp.d.ts.map +1 -0
  2282. package/lib/Stripe/RetrieveFileLinkHttp.js +18 -0
  2283. package/lib/Stripe/RetrieveFileLinkHttp.js.map +1 -0
  2284. package/lib/Stripe/RetrieveIssuingCard.d.ts +23 -0
  2285. package/lib/Stripe/RetrieveIssuingCard.d.ts.map +1 -0
  2286. package/lib/Stripe/RetrieveIssuingCard.js +3 -0
  2287. package/lib/Stripe/RetrieveIssuingCard.js.map +1 -0
  2288. package/lib/Stripe/RetrieveIssuingCardHttp.d.ts +11 -0
  2289. package/lib/Stripe/RetrieveIssuingCardHttp.d.ts.map +1 -0
  2290. package/lib/Stripe/RetrieveIssuingCardHttp.js +18 -0
  2291. package/lib/Stripe/RetrieveIssuingCardHttp.js.map +1 -0
  2292. package/lib/Stripe/RetrieveIssuingCardholder.d.ts +23 -0
  2293. package/lib/Stripe/RetrieveIssuingCardholder.d.ts.map +1 -0
  2294. package/lib/Stripe/RetrieveIssuingCardholder.js +3 -0
  2295. package/lib/Stripe/RetrieveIssuingCardholder.js.map +1 -0
  2296. package/lib/Stripe/RetrieveIssuingCardholderHttp.d.ts +11 -0
  2297. package/lib/Stripe/RetrieveIssuingCardholderHttp.d.ts.map +1 -0
  2298. package/lib/Stripe/RetrieveIssuingCardholderHttp.js +18 -0
  2299. package/lib/Stripe/RetrieveIssuingCardholderHttp.js.map +1 -0
  2300. package/lib/Stripe/RetrieveIssuingPersonalizationDesign.d.ts +23 -0
  2301. package/lib/Stripe/RetrieveIssuingPersonalizationDesign.d.ts.map +1 -0
  2302. package/lib/Stripe/RetrieveIssuingPersonalizationDesign.js +3 -0
  2303. package/lib/Stripe/RetrieveIssuingPersonalizationDesign.js.map +1 -0
  2304. package/lib/Stripe/RetrieveIssuingPersonalizationDesignHttp.d.ts +11 -0
  2305. package/lib/Stripe/RetrieveIssuingPersonalizationDesignHttp.d.ts.map +1 -0
  2306. package/lib/Stripe/RetrieveIssuingPersonalizationDesignHttp.js +18 -0
  2307. package/lib/Stripe/RetrieveIssuingPersonalizationDesignHttp.js.map +1 -0
  2308. package/lib/Stripe/RetrievePaymentLink.d.ts +23 -0
  2309. package/lib/Stripe/RetrievePaymentLink.d.ts.map +1 -0
  2310. package/lib/Stripe/RetrievePaymentLink.js +3 -0
  2311. package/lib/Stripe/RetrievePaymentLink.js.map +1 -0
  2312. package/lib/Stripe/RetrievePaymentLinkHttp.d.ts +11 -0
  2313. package/lib/Stripe/RetrievePaymentLinkHttp.d.ts.map +1 -0
  2314. package/lib/Stripe/RetrievePaymentLinkHttp.js +18 -0
  2315. package/lib/Stripe/RetrievePaymentLinkHttp.js.map +1 -0
  2316. package/lib/Stripe/RetrievePaymentMethodConfiguration.d.ts +23 -0
  2317. package/lib/Stripe/RetrievePaymentMethodConfiguration.d.ts.map +1 -0
  2318. package/lib/Stripe/RetrievePaymentMethodConfiguration.js +3 -0
  2319. package/lib/Stripe/RetrievePaymentMethodConfiguration.js.map +1 -0
  2320. package/lib/Stripe/RetrievePaymentMethodConfigurationHttp.d.ts +10 -0
  2321. package/lib/Stripe/RetrievePaymentMethodConfigurationHttp.d.ts.map +1 -0
  2322. package/lib/Stripe/RetrievePaymentMethodConfigurationHttp.js +17 -0
  2323. package/lib/Stripe/RetrievePaymentMethodConfigurationHttp.js.map +1 -0
  2324. package/lib/Stripe/RetrievePaymentMethodDomain.d.ts +23 -0
  2325. package/lib/Stripe/RetrievePaymentMethodDomain.d.ts.map +1 -0
  2326. package/lib/Stripe/RetrievePaymentMethodDomain.js +3 -0
  2327. package/lib/Stripe/RetrievePaymentMethodDomain.js.map +1 -0
  2328. package/lib/Stripe/RetrievePaymentMethodDomainHttp.d.ts +10 -0
  2329. package/lib/Stripe/RetrievePaymentMethodDomainHttp.d.ts.map +1 -0
  2330. package/lib/Stripe/RetrievePaymentMethodDomainHttp.js +17 -0
  2331. package/lib/Stripe/RetrievePaymentMethodDomainHttp.js.map +1 -0
  2332. package/lib/Stripe/RetrievePlan.d.ts +23 -0
  2333. package/lib/Stripe/RetrievePlan.d.ts.map +1 -0
  2334. package/lib/Stripe/RetrievePlan.js +3 -0
  2335. package/lib/Stripe/RetrievePlan.js.map +1 -0
  2336. package/lib/Stripe/RetrievePlanHttp.d.ts +11 -0
  2337. package/lib/Stripe/RetrievePlanHttp.d.ts.map +1 -0
  2338. package/lib/Stripe/RetrievePlanHttp.js +18 -0
  2339. package/lib/Stripe/RetrievePlanHttp.js.map +1 -0
  2340. package/lib/Stripe/RetrievePrice.d.ts +23 -0
  2341. package/lib/Stripe/RetrievePrice.d.ts.map +1 -0
  2342. package/lib/Stripe/RetrievePrice.js +3 -0
  2343. package/lib/Stripe/RetrievePrice.js.map +1 -0
  2344. package/lib/Stripe/RetrievePriceHttp.d.ts +11 -0
  2345. package/lib/Stripe/RetrievePriceHttp.d.ts.map +1 -0
  2346. package/lib/Stripe/RetrievePriceHttp.js +18 -0
  2347. package/lib/Stripe/RetrievePriceHttp.js.map +1 -0
  2348. package/lib/Stripe/RetrieveProduct.d.ts +30 -0
  2349. package/lib/Stripe/RetrieveProduct.d.ts.map +1 -0
  2350. package/lib/Stripe/RetrieveProduct.js +3 -0
  2351. package/lib/Stripe/RetrieveProduct.js.map +1 -0
  2352. package/lib/Stripe/RetrieveProductFeature.d.ts +23 -0
  2353. package/lib/Stripe/RetrieveProductFeature.d.ts.map +1 -0
  2354. package/lib/Stripe/RetrieveProductFeature.js +3 -0
  2355. package/lib/Stripe/RetrieveProductFeature.js.map +1 -0
  2356. package/lib/Stripe/RetrieveProductFeatureHttp.d.ts +11 -0
  2357. package/lib/Stripe/RetrieveProductFeatureHttp.d.ts.map +1 -0
  2358. package/lib/Stripe/RetrieveProductFeatureHttp.js +31 -0
  2359. package/lib/Stripe/RetrieveProductFeatureHttp.js.map +1 -0
  2360. package/lib/Stripe/RetrieveProductHttp.d.ts +12 -0
  2361. package/lib/Stripe/RetrieveProductHttp.d.ts.map +1 -0
  2362. package/lib/Stripe/RetrieveProductHttp.js +33 -0
  2363. package/lib/Stripe/RetrieveProductHttp.js.map +1 -0
  2364. package/lib/Stripe/RetrievePromotionCode.d.ts +23 -0
  2365. package/lib/Stripe/RetrievePromotionCode.d.ts.map +1 -0
  2366. package/lib/Stripe/RetrievePromotionCode.js +3 -0
  2367. package/lib/Stripe/RetrievePromotionCode.js.map +1 -0
  2368. package/lib/Stripe/RetrievePromotionCodeHttp.d.ts +11 -0
  2369. package/lib/Stripe/RetrievePromotionCodeHttp.d.ts.map +1 -0
  2370. package/lib/Stripe/RetrievePromotionCodeHttp.js +18 -0
  2371. package/lib/Stripe/RetrievePromotionCodeHttp.js.map +1 -0
  2372. package/lib/Stripe/RetrieveRadarValueList.d.ts +23 -0
  2373. package/lib/Stripe/RetrieveRadarValueList.d.ts.map +1 -0
  2374. package/lib/Stripe/RetrieveRadarValueList.js +3 -0
  2375. package/lib/Stripe/RetrieveRadarValueList.js.map +1 -0
  2376. package/lib/Stripe/RetrieveRadarValueListHttp.d.ts +10 -0
  2377. package/lib/Stripe/RetrieveRadarValueListHttp.d.ts.map +1 -0
  2378. package/lib/Stripe/RetrieveRadarValueListHttp.js +17 -0
  2379. package/lib/Stripe/RetrieveRadarValueListHttp.js.map +1 -0
  2380. package/lib/Stripe/RetrieveRadarValueListItem.d.ts +23 -0
  2381. package/lib/Stripe/RetrieveRadarValueListItem.d.ts.map +1 -0
  2382. package/lib/Stripe/RetrieveRadarValueListItem.js +3 -0
  2383. package/lib/Stripe/RetrieveRadarValueListItem.js.map +1 -0
  2384. package/lib/Stripe/RetrieveRadarValueListItemHttp.d.ts +10 -0
  2385. package/lib/Stripe/RetrieveRadarValueListItemHttp.d.ts.map +1 -0
  2386. package/lib/Stripe/RetrieveRadarValueListItemHttp.js +17 -0
  2387. package/lib/Stripe/RetrieveRadarValueListItemHttp.js.map +1 -0
  2388. package/lib/Stripe/RetrieveShippingRate.d.ts +23 -0
  2389. package/lib/Stripe/RetrieveShippingRate.d.ts.map +1 -0
  2390. package/lib/Stripe/RetrieveShippingRate.js +3 -0
  2391. package/lib/Stripe/RetrieveShippingRate.js.map +1 -0
  2392. package/lib/Stripe/RetrieveShippingRateHttp.d.ts +11 -0
  2393. package/lib/Stripe/RetrieveShippingRateHttp.d.ts.map +1 -0
  2394. package/lib/Stripe/RetrieveShippingRateHttp.js +18 -0
  2395. package/lib/Stripe/RetrieveShippingRateHttp.js.map +1 -0
  2396. package/lib/Stripe/RetrieveTaxRate.d.ts +23 -0
  2397. package/lib/Stripe/RetrieveTaxRate.d.ts.map +1 -0
  2398. package/lib/Stripe/RetrieveTaxRate.js +3 -0
  2399. package/lib/Stripe/RetrieveTaxRate.js.map +1 -0
  2400. package/lib/Stripe/RetrieveTaxRateHttp.d.ts +11 -0
  2401. package/lib/Stripe/RetrieveTaxRateHttp.d.ts.map +1 -0
  2402. package/lib/Stripe/RetrieveTaxRateHttp.js +18 -0
  2403. package/lib/Stripe/RetrieveTaxRateHttp.js.map +1 -0
  2404. package/lib/Stripe/RetrieveTaxRegistration.d.ts +23 -0
  2405. package/lib/Stripe/RetrieveTaxRegistration.d.ts.map +1 -0
  2406. package/lib/Stripe/RetrieveTaxRegistration.js +3 -0
  2407. package/lib/Stripe/RetrieveTaxRegistration.js.map +1 -0
  2408. package/lib/Stripe/RetrieveTaxRegistrationHttp.d.ts +11 -0
  2409. package/lib/Stripe/RetrieveTaxRegistrationHttp.d.ts.map +1 -0
  2410. package/lib/Stripe/RetrieveTaxRegistrationHttp.js +18 -0
  2411. package/lib/Stripe/RetrieveTaxRegistrationHttp.js.map +1 -0
  2412. package/lib/Stripe/RetrieveTaxSettings.d.ts +25 -0
  2413. package/lib/Stripe/RetrieveTaxSettings.d.ts.map +1 -0
  2414. package/lib/Stripe/RetrieveTaxSettings.js +3 -0
  2415. package/lib/Stripe/RetrieveTaxSettings.js.map +1 -0
  2416. package/lib/Stripe/RetrieveTaxSettingsHttp.d.ts +12 -0
  2417. package/lib/Stripe/RetrieveTaxSettingsHttp.d.ts.map +1 -0
  2418. package/lib/Stripe/RetrieveTaxSettingsHttp.js +26 -0
  2419. package/lib/Stripe/RetrieveTaxSettingsHttp.js.map +1 -0
  2420. package/lib/Stripe/RetrieveTerminalConfiguration.d.ts +23 -0
  2421. package/lib/Stripe/RetrieveTerminalConfiguration.d.ts.map +1 -0
  2422. package/lib/Stripe/RetrieveTerminalConfiguration.js +3 -0
  2423. package/lib/Stripe/RetrieveTerminalConfiguration.js.map +1 -0
  2424. package/lib/Stripe/RetrieveTerminalConfigurationHttp.d.ts +11 -0
  2425. package/lib/Stripe/RetrieveTerminalConfigurationHttp.d.ts.map +1 -0
  2426. package/lib/Stripe/RetrieveTerminalConfigurationHttp.js +18 -0
  2427. package/lib/Stripe/RetrieveTerminalConfigurationHttp.js.map +1 -0
  2428. package/lib/Stripe/RetrieveTerminalLocation.d.ts +23 -0
  2429. package/lib/Stripe/RetrieveTerminalLocation.d.ts.map +1 -0
  2430. package/lib/Stripe/RetrieveTerminalLocation.js +3 -0
  2431. package/lib/Stripe/RetrieveTerminalLocation.js.map +1 -0
  2432. package/lib/Stripe/RetrieveTerminalLocationHttp.d.ts +11 -0
  2433. package/lib/Stripe/RetrieveTerminalLocationHttp.d.ts.map +1 -0
  2434. package/lib/Stripe/RetrieveTerminalLocationHttp.js +18 -0
  2435. package/lib/Stripe/RetrieveTerminalLocationHttp.js.map +1 -0
  2436. package/lib/Stripe/RetrieveTerminalReader.d.ts +23 -0
  2437. package/lib/Stripe/RetrieveTerminalReader.d.ts.map +1 -0
  2438. package/lib/Stripe/RetrieveTerminalReader.js +3 -0
  2439. package/lib/Stripe/RetrieveTerminalReader.js.map +1 -0
  2440. package/lib/Stripe/RetrieveTerminalReaderHttp.d.ts +11 -0
  2441. package/lib/Stripe/RetrieveTerminalReaderHttp.d.ts.map +1 -0
  2442. package/lib/Stripe/RetrieveTerminalReaderHttp.js +18 -0
  2443. package/lib/Stripe/RetrieveTerminalReaderHttp.js.map +1 -0
  2444. package/lib/Stripe/RetrieveWebhookEndpoint.d.ts +23 -0
  2445. package/lib/Stripe/RetrieveWebhookEndpoint.d.ts.map +1 -0
  2446. package/lib/Stripe/RetrieveWebhookEndpoint.js +3 -0
  2447. package/lib/Stripe/RetrieveWebhookEndpoint.js.map +1 -0
  2448. package/lib/Stripe/RetrieveWebhookEndpointHttp.d.ts +11 -0
  2449. package/lib/Stripe/RetrieveWebhookEndpointHttp.d.ts.map +1 -0
  2450. package/lib/Stripe/RetrieveWebhookEndpointHttp.js +18 -0
  2451. package/lib/Stripe/RetrieveWebhookEndpointHttp.js.map +1 -0
  2452. package/lib/Stripe/ShippingRate.d.ts +192 -0
  2453. package/lib/Stripe/ShippingRate.d.ts.map +1 -0
  2454. package/lib/Stripe/ShippingRate.js +375 -0
  2455. package/lib/Stripe/ShippingRate.js.map +1 -0
  2456. package/lib/Stripe/StripeHttp.d.ts +58 -0
  2457. package/lib/Stripe/StripeHttp.d.ts.map +1 -0
  2458. package/lib/Stripe/StripeHttp.js +110 -0
  2459. package/lib/Stripe/StripeHttp.js.map +1 -0
  2460. package/lib/Stripe/TaxRate.d.ts +153 -0
  2461. package/lib/Stripe/TaxRate.d.ts.map +1 -0
  2462. package/lib/Stripe/TaxRate.js +287 -0
  2463. package/lib/Stripe/TaxRate.js.map +1 -0
  2464. package/lib/Stripe/TaxRegistration.d.ts +275 -0
  2465. package/lib/Stripe/TaxRegistration.d.ts.map +1 -0
  2466. package/lib/Stripe/TaxRegistration.js +300 -0
  2467. package/lib/Stripe/TaxRegistration.js.map +1 -0
  2468. package/lib/Stripe/TaxSettings.d.ts +165 -0
  2469. package/lib/Stripe/TaxSettings.d.ts.map +1 -0
  2470. package/lib/Stripe/TaxSettings.js +207 -0
  2471. package/lib/Stripe/TaxSettings.js.map +1 -0
  2472. package/lib/Stripe/TerminalConfiguration.d.ts +368 -0
  2473. package/lib/Stripe/TerminalConfiguration.d.ts.map +1 -0
  2474. package/lib/Stripe/TerminalConfiguration.js +537 -0
  2475. package/lib/Stripe/TerminalConfiguration.js.map +1 -0
  2476. package/lib/Stripe/TerminalLocation.d.ts +215 -0
  2477. package/lib/Stripe/TerminalLocation.d.ts.map +1 -0
  2478. package/lib/Stripe/TerminalLocation.js +371 -0
  2479. package/lib/Stripe/TerminalLocation.js.map +1 -0
  2480. package/lib/Stripe/TerminalReader.d.ts +124 -0
  2481. package/lib/Stripe/TerminalReader.d.ts.map +1 -0
  2482. package/lib/Stripe/TerminalReader.js +239 -0
  2483. package/lib/Stripe/TerminalReader.js.map +1 -0
  2484. package/lib/Stripe/UpdateAccount.d.ts +23 -0
  2485. package/lib/Stripe/UpdateAccount.d.ts.map +1 -0
  2486. package/lib/Stripe/UpdateAccount.js +3 -0
  2487. package/lib/Stripe/UpdateAccount.js.map +1 -0
  2488. package/lib/Stripe/UpdateAccountHttp.d.ts +11 -0
  2489. package/lib/Stripe/UpdateAccountHttp.d.ts.map +1 -0
  2490. package/lib/Stripe/UpdateAccountHttp.js +18 -0
  2491. package/lib/Stripe/UpdateAccountHttp.js.map +1 -0
  2492. package/lib/Stripe/UpdateCreditGrant.d.ts +24 -0
  2493. package/lib/Stripe/UpdateCreditGrant.d.ts.map +1 -0
  2494. package/lib/Stripe/UpdateCreditGrant.js +3 -0
  2495. package/lib/Stripe/UpdateCreditGrant.js.map +1 -0
  2496. package/lib/Stripe/UpdateCreditGrantHttp.d.ts +11 -0
  2497. package/lib/Stripe/UpdateCreditGrantHttp.d.ts.map +1 -0
  2498. package/lib/Stripe/UpdateCreditGrantHttp.js +18 -0
  2499. package/lib/Stripe/UpdateCreditGrantHttp.js.map +1 -0
  2500. package/lib/Stripe/UpdateCustomer.d.ts +23 -0
  2501. package/lib/Stripe/UpdateCustomer.d.ts.map +1 -0
  2502. package/lib/Stripe/UpdateCustomer.js +3 -0
  2503. package/lib/Stripe/UpdateCustomer.js.map +1 -0
  2504. package/lib/Stripe/UpdateCustomerHttp.d.ts +11 -0
  2505. package/lib/Stripe/UpdateCustomerHttp.d.ts.map +1 -0
  2506. package/lib/Stripe/UpdateCustomerHttp.js +18 -0
  2507. package/lib/Stripe/UpdateCustomerHttp.js.map +1 -0
  2508. package/lib/Stripe/UpdateFileLink.d.ts +24 -0
  2509. package/lib/Stripe/UpdateFileLink.d.ts.map +1 -0
  2510. package/lib/Stripe/UpdateFileLink.js +3 -0
  2511. package/lib/Stripe/UpdateFileLink.js.map +1 -0
  2512. package/lib/Stripe/UpdateFileLinkHttp.d.ts +11 -0
  2513. package/lib/Stripe/UpdateFileLinkHttp.d.ts.map +1 -0
  2514. package/lib/Stripe/UpdateFileLinkHttp.js +18 -0
  2515. package/lib/Stripe/UpdateFileLinkHttp.js.map +1 -0
  2516. package/lib/Stripe/UpdateIssuingCard.d.ts +23 -0
  2517. package/lib/Stripe/UpdateIssuingCard.d.ts.map +1 -0
  2518. package/lib/Stripe/UpdateIssuingCard.js +3 -0
  2519. package/lib/Stripe/UpdateIssuingCard.js.map +1 -0
  2520. package/lib/Stripe/UpdateIssuingCardHttp.d.ts +11 -0
  2521. package/lib/Stripe/UpdateIssuingCardHttp.d.ts.map +1 -0
  2522. package/lib/Stripe/UpdateIssuingCardHttp.js +18 -0
  2523. package/lib/Stripe/UpdateIssuingCardHttp.js.map +1 -0
  2524. package/lib/Stripe/UpdateIssuingCardholder.d.ts +23 -0
  2525. package/lib/Stripe/UpdateIssuingCardholder.d.ts.map +1 -0
  2526. package/lib/Stripe/UpdateIssuingCardholder.js +3 -0
  2527. package/lib/Stripe/UpdateIssuingCardholder.js.map +1 -0
  2528. package/lib/Stripe/UpdateIssuingCardholderHttp.d.ts +11 -0
  2529. package/lib/Stripe/UpdateIssuingCardholderHttp.d.ts.map +1 -0
  2530. package/lib/Stripe/UpdateIssuingCardholderHttp.js +18 -0
  2531. package/lib/Stripe/UpdateIssuingCardholderHttp.js.map +1 -0
  2532. package/lib/Stripe/UpdateTaxSettings.d.ts +28 -0
  2533. package/lib/Stripe/UpdateTaxSettings.d.ts.map +1 -0
  2534. package/lib/Stripe/UpdateTaxSettings.js +3 -0
  2535. package/lib/Stripe/UpdateTaxSettings.js.map +1 -0
  2536. package/lib/Stripe/UpdateTaxSettingsHttp.d.ts +12 -0
  2537. package/lib/Stripe/UpdateTaxSettingsHttp.d.ts.map +1 -0
  2538. package/lib/Stripe/UpdateTaxSettingsHttp.js +26 -0
  2539. package/lib/Stripe/UpdateTaxSettingsHttp.js.map +1 -0
  2540. package/lib/Stripe/UpdateTerminalReader.d.ts +23 -0
  2541. package/lib/Stripe/UpdateTerminalReader.d.ts.map +1 -0
  2542. package/lib/Stripe/UpdateTerminalReader.js +3 -0
  2543. package/lib/Stripe/UpdateTerminalReader.js.map +1 -0
  2544. package/lib/Stripe/UpdateTerminalReaderHttp.d.ts +11 -0
  2545. package/lib/Stripe/UpdateTerminalReaderHttp.d.ts.map +1 -0
  2546. package/lib/Stripe/UpdateTerminalReaderHttp.js +18 -0
  2547. package/lib/Stripe/UpdateTerminalReaderHttp.js.map +1 -0
  2548. package/lib/Stripe/WebhookEndpoint.d.ts +135 -0
  2549. package/lib/Stripe/WebhookEndpoint.d.ts.map +1 -0
  2550. package/lib/Stripe/WebhookEndpoint.js +266 -0
  2551. package/lib/Stripe/WebhookEndpoint.js.map +1 -0
  2552. package/lib/Stripe/index.d.ts +151 -0
  2553. package/lib/Stripe/index.d.ts.map +1 -0
  2554. package/lib/Stripe/index.js +151 -0
  2555. package/lib/Stripe/index.js.map +1 -0
  2556. package/lib/Stripe/missing.d.ts +9 -0
  2557. package/lib/Stripe/missing.d.ts.map +1 -0
  2558. package/lib/Stripe/missing.js +13 -0
  2559. package/lib/Stripe/missing.js.map +1 -0
  2560. package/lib/Telemetry/Layer.d.ts +6 -0
  2561. package/lib/Telemetry/Layer.d.ts.map +1 -1
  2562. package/lib/Telemetry/Layer.js +16 -5
  2563. package/lib/Telemetry/Layer.js.map +1 -1
  2564. package/lib/Telemetry.d.ts +7 -61
  2565. package/lib/Telemetry.d.ts.map +1 -1
  2566. package/lib/Telemetry.js +9 -304
  2567. package/lib/Telemetry.js.map +1 -1
  2568. package/lib/TelemetryRuntime.d.ts +105 -0
  2569. package/lib/TelemetryRuntime.d.ts.map +1 -0
  2570. package/lib/TelemetryRuntime.js +308 -0
  2571. package/lib/TelemetryRuntime.js.map +1 -0
  2572. package/lib/Test/Alchemy.d.ts +2 -0
  2573. package/lib/Test/Alchemy.d.ts.map +1 -1
  2574. package/lib/Test/Alchemy.js +2 -0
  2575. package/lib/Test/Alchemy.js.map +1 -1
  2576. package/lib/Test/Bun.d.ts +2 -0
  2577. package/lib/Test/Bun.d.ts.map +1 -1
  2578. package/lib/Test/Bun.js +2 -0
  2579. package/lib/Test/Bun.js.map +1 -1
  2580. package/lib/Test/Core.d.ts +23 -4
  2581. package/lib/Test/Core.d.ts.map +1 -1
  2582. package/lib/Test/Core.js +24 -10
  2583. package/lib/Test/Core.js.map +1 -1
  2584. package/lib/Test/Vitest.d.ts +2 -0
  2585. package/lib/Test/Vitest.d.ts.map +1 -1
  2586. package/lib/Test/Vitest.js +2 -0
  2587. package/lib/Test/Vitest.js.map +1 -1
  2588. package/lib/Test/index.d.ts +1 -1
  2589. package/lib/Test/index.d.ts.map +1 -1
  2590. package/lib/Test/index.js +1 -1
  2591. package/lib/Test/index.js.map +1 -1
  2592. package/lib/UserFacingError.d.ts +26 -0
  2593. package/lib/UserFacingError.d.ts.map +1 -0
  2594. package/lib/UserFacingError.js +25 -0
  2595. package/lib/UserFacingError.js.map +1 -0
  2596. package/lib/Util/AtomicFile.d.ts +19 -0
  2597. package/lib/Util/AtomicFile.d.ts.map +1 -0
  2598. package/lib/Util/AtomicFile.js +22 -0
  2599. package/lib/Util/AtomicFile.js.map +1 -0
  2600. package/lib/Util/ConsoleSink.d.ts +4 -0
  2601. package/lib/Util/ConsoleSink.d.ts.map +1 -0
  2602. package/lib/Util/ConsoleSink.js +24 -0
  2603. package/lib/Util/ConsoleSink.js.map +1 -0
  2604. package/lib/Util/LineBuffer.d.ts +9 -0
  2605. package/lib/Util/LineBuffer.d.ts.map +1 -0
  2606. package/lib/Util/LineBuffer.js +23 -0
  2607. package/lib/Util/LineBuffer.js.map +1 -0
  2608. package/lib/Util/Memoize.d.ts +20 -0
  2609. package/lib/Util/Memoize.d.ts.map +1 -0
  2610. package/lib/Util/Memoize.js +38 -0
  2611. package/lib/Util/Memoize.js.map +1 -0
  2612. package/lib/Util/Node.d.ts +29 -5
  2613. package/lib/Util/Node.d.ts.map +1 -1
  2614. package/lib/Util/Node.js +37 -10
  2615. package/lib/Util/Node.js.map +1 -1
  2616. package/lib/Util/PlatformServices.d.ts +6 -2
  2617. package/lib/Util/PlatformServices.d.ts.map +1 -1
  2618. package/lib/Util/PlatformServices.js +6 -2
  2619. package/lib/Util/PlatformServices.js.map +1 -1
  2620. package/lib/Util/ResourceOutput.d.ts +30 -0
  2621. package/lib/Util/ResourceOutput.d.ts.map +1 -0
  2622. package/lib/Util/ResourceOutput.js +60 -0
  2623. package/lib/Util/ResourceOutput.js.map +1 -0
  2624. package/lib/Util/Terminal.d.ts +23 -0
  2625. package/lib/Util/Terminal.d.ts.map +1 -0
  2626. package/lib/Util/Terminal.js +56 -0
  2627. package/lib/Util/Terminal.js.map +1 -0
  2628. package/lib/Util/Theme.d.ts +123 -0
  2629. package/lib/Util/Theme.d.ts.map +1 -0
  2630. package/lib/Util/Theme.js +133 -0
  2631. package/lib/Util/Theme.js.map +1 -0
  2632. package/lib/Util/gitignore-rules-to-globs.d.ts +3 -3
  2633. package/lib/Util/gitignore-rules-to-globs.js +3 -3
  2634. package/lib/Util/interactive.d.ts +17 -12
  2635. package/lib/Util/interactive.d.ts.map +1 -1
  2636. package/lib/Util/interactive.js +81 -13
  2637. package/lib/Util/interactive.js.map +1 -1
  2638. package/lib/Util/proxy-chain.js +17 -0
  2639. package/lib/Util/proxy-chain.js.map +1 -1
  2640. package/lib/Util/scc.d.ts +11 -3
  2641. package/lib/Util/scc.d.ts.map +1 -1
  2642. package/lib/Util/scc.js +35 -22
  2643. package/lib/Util/scc.js.map +1 -1
  2644. package/lib/Util/tarGzip.d.ts +3 -1
  2645. package/lib/Util/tarGzip.d.ts.map +1 -1
  2646. package/lib/Util/tarGzip.js +15 -5
  2647. package/lib/Util/tarGzip.js.map +1 -1
  2648. package/lib/Util/zip.d.ts +2 -2
  2649. package/lib/Util/zip.d.ts.map +1 -1
  2650. package/lib/Util/zip.js +13 -38
  2651. package/lib/Util/zip.js.map +1 -1
  2652. package/lib/Utils/ip-address.d.ts +6 -0
  2653. package/lib/Utils/ip-address.d.ts.map +1 -0
  2654. package/lib/Utils/ip-address.js +83 -0
  2655. package/lib/Utils/ip-address.js.map +1 -0
  2656. package/lib/Website/Server.d.ts.map +1 -1
  2657. package/lib/Website/Server.js +14 -4
  2658. package/lib/Website/Server.js.map +1 -1
  2659. package/lib/Website/ServerLocal.d.ts +2 -1
  2660. package/lib/Website/ServerLocal.js +1 -2
  2661. package/lib/Website/ServerLocal.js.map +1 -1
  2662. package/lib/index.d.ts +3 -2
  2663. package/lib/index.d.ts.map +1 -1
  2664. package/lib/index.js +3 -2
  2665. package/lib/index.js.map +1 -1
  2666. package/package.json +94 -60
  2667. package/src/AWS/AGENTS.md +1 -1
  2668. package/src/AWS/AMP/Scraper.ts +1 -1
  2669. package/src/AWS/AppRunner/Service.ts +11 -27
  2670. package/src/AWS/Assets.ts +2 -2
  2671. package/src/AWS/AuthProvider.ts +748 -429
  2672. package/src/AWS/Batch/JobDefinition.ts +11 -27
  2673. package/src/AWS/Bedrock/LanguageModel.ts +2 -2
  2674. package/src/AWS/Budgets/BindingHttp.ts +2 -13
  2675. package/src/AWS/Budgets/DescribeBudgetActionsForBudgetHttp.ts +0 -3
  2676. package/src/AWS/CloudFront/KvRoutesUpdate.ts +20 -1
  2677. package/src/AWS/Connection/DbAuthToken.ts +1 -1
  2678. package/src/AWS/Credentials.ts +3 -3
  2679. package/src/AWS/DSQL/Connect.ts +2 -2
  2680. package/src/AWS/DynamoDB/Table.ts +33 -17
  2681. package/src/AWS/EC2/Instance.ts +24 -29
  2682. package/src/AWS/EC2/InternetGateway.ts +1 -1
  2683. package/src/AWS/EC2/NatGateway.ts +1 -1
  2684. package/src/AWS/EC2/NetworkInterface.ts +1 -1
  2685. package/src/AWS/EC2/NetworkInterfaceAttachment.ts +1 -1
  2686. package/src/AWS/EC2/RouteTable.ts +1 -1
  2687. package/src/AWS/EC2/RouteTableAssociation.ts +1 -1
  2688. package/src/AWS/EC2/SecurityGroup.ts +376 -79
  2689. package/src/AWS/EC2/SecurityGroupRule.ts +147 -23
  2690. package/src/AWS/EC2/Snapshot.ts +1 -1
  2691. package/src/AWS/EC2/Subnet.ts +1 -1
  2692. package/src/AWS/EC2/Volume.ts +1 -1
  2693. package/src/AWS/EC2/VolumeAttachment.ts +1 -1
  2694. package/src/AWS/EC2/Vpc.ts +1 -1
  2695. package/src/AWS/EC2/VpcEndpoint.ts +1 -1
  2696. package/src/AWS/EC2/hosted.ts +5 -6
  2697. package/src/AWS/ECR/Image.ts +29 -7
  2698. package/src/AWS/ECR/ImageSource.ts +4 -5
  2699. package/src/AWS/ECS/FlociServiceProvider.ts +2 -2
  2700. package/src/AWS/ECS/FlociTaskProvider.ts +2 -2
  2701. package/src/AWS/ECS/Service.ts +13 -28
  2702. package/src/AWS/ECS/Task.ts +7 -21
  2703. package/src/AWS/EKS/KubernetesAdapter.ts +4 -4
  2704. package/src/AWS/ElastiCache/CacheCluster.ts +323 -0
  2705. package/src/AWS/ElastiCache/ConnectCacheCluster.ts +58 -0
  2706. package/src/AWS/ElastiCache/ConnectCacheClusterHttp.ts +77 -0
  2707. package/src/AWS/ElastiCache/ConnectReplicationGroup.ts +62 -0
  2708. package/src/AWS/ElastiCache/ConnectReplicationGroupHttp.ts +110 -0
  2709. package/src/AWS/ElastiCache/ReplicationGroup.ts +594 -0
  2710. package/src/AWS/ElastiCache/SubnetGroup.ts +208 -0
  2711. package/src/AWS/ElastiCache/index.ts +7 -0
  2712. package/src/AWS/ElastiCache/internal.ts +36 -0
  2713. package/src/AWS/Environment.ts +21 -54
  2714. package/src/AWS/IAM/actions.generated.ts +1 -1
  2715. package/src/AWS/IdentityCenter/AccountAssignment.ts +7 -0
  2716. package/src/AWS/Lambda/BindingHttp.ts +237 -25
  2717. package/src/AWS/Lambda/FlociFunctionProvider.ts +2 -2
  2718. package/src/AWS/Lambda/FlociMicrovmImageProvider.ts +2 -2
  2719. package/src/AWS/Lambda/Function.ts +62 -44
  2720. package/src/AWS/Lambda/MicrovmBinding.ts +15 -276
  2721. package/src/AWS/Lambda/MicrovmBundle.ts +1 -16
  2722. package/src/AWS/Lambda/MicrovmImage.ts +12 -28
  2723. package/src/AWS/Lambda/MicrovmProvider.ts +1 -1
  2724. package/src/AWS/Lambda/MicrovmRuntimeContext.ts +1 -1
  2725. package/src/AWS/Lambda/NetworkConnector.ts +1 -1
  2726. package/src/AWS/Local/DevWatchProvider.ts +18 -8
  2727. package/src/AWS/Local/Local.ts +11 -10
  2728. package/src/AWS/Logs/LogGroup.ts +8 -2
  2729. package/src/AWS/Organizations/Account.ts +18 -10
  2730. package/src/AWS/Organizations/DelegatedAdministrator.ts +7 -7
  2731. package/src/AWS/Organizations/Organization.ts +3 -5
  2732. package/src/AWS/Organizations/common.ts +21 -1
  2733. package/src/AWS/Providers.ts +12 -0
  2734. package/src/AWS/RDS/Connect.ts +3 -3
  2735. package/src/AWS/RDS/DBInstance.ts +979 -53
  2736. package/src/AWS/RDS/DBParameterGroup.ts +89 -40
  2737. package/src/AWS/S3/BindingHttp.ts +46 -37
  2738. package/src/AWS/S3/Bucket.ts +221 -83
  2739. package/src/AWS/S3/PresignGetObject.ts +2 -4
  2740. package/src/AWS/S3/PresignPutObject.ts +2 -4
  2741. package/src/AWS/SNS/Subscription.ts +29 -9
  2742. package/src/AWS/StateStore/State.ts +24 -36
  2743. package/src/AWS/Synthetics/Canary.ts +4 -11
  2744. package/src/Alchemist/Entrypoint.ts +33 -0
  2745. package/src/Alchemist/Errors.ts +36 -0
  2746. package/src/Alchemist/Progress.ts +175 -0
  2747. package/src/Alchemist/Runtime.ts +40 -0
  2748. package/src/Alchemist/Session.ts +452 -0
  2749. package/src/Alchemist/index.ts +24 -0
  2750. package/src/Alchemist/routes/aws.ts +88 -0
  2751. package/src/Alchemist/routes/cloudflare.ts +188 -0
  2752. package/src/Alchemist/routes/cloudflareToken.ts +215 -0
  2753. package/src/Alchemist/routes/drift.ts +94 -0
  2754. package/src/Alchemist/routes/logs.ts +185 -0
  2755. package/src/Alchemist/routes/nuke.ts +146 -0
  2756. package/src/Alchemist/routes/profile.ts +427 -0
  2757. package/src/Alchemist/routes/provider.ts +107 -0
  2758. package/src/Alchemist/routes/stack.ts +137 -0
  2759. package/src/Alchemist/routes/state.ts +90 -0
  2760. package/src/Apply.ts +312 -173
  2761. package/src/Auth/AuthProvider.ts +416 -158
  2762. package/src/Auth/BrowserOAuth.ts +68 -0
  2763. package/src/Auth/Credentials.ts +155 -46
  2764. package/src/Auth/CredentialsCache.ts +57 -0
  2765. package/src/Auth/Demand.ts +209 -84
  2766. package/src/Auth/Env.ts +40 -16
  2767. package/src/Auth/Inspect.ts +129 -0
  2768. package/src/Auth/Lock.ts +48 -30
  2769. package/src/Auth/OAuthFlow.ts +551 -0
  2770. package/src/Auth/Paths.ts +30 -0
  2771. package/src/Auth/Profile.ts +768 -164
  2772. package/src/Auth/Resolve.ts +136 -0
  2773. package/src/Auth/StoredAuthProvider.ts +291 -0
  2774. package/src/Auth/index.ts +1 -0
  2775. package/src/Axiom/AuthProvider.ts +112 -314
  2776. package/src/Axiom/Credentials.ts +5 -13
  2777. package/src/Axiom/Providers.ts +3 -3
  2778. package/src/Bundle/Bundle.ts +3 -5
  2779. package/src/Cli/CliKit/CliKit.ts +183 -0
  2780. package/src/Cli/CliKit/index.ts +50 -0
  2781. package/src/Cli/CliKit/interaction.ts +19 -0
  2782. package/src/Cli/CliKit/layer.ts +50 -0
  2783. package/src/Cli/DevOptions.ts +19 -0
  2784. package/src/Cli/Format.ts +31 -0
  2785. package/src/Cli/GlobalLog.ts +147 -0
  2786. package/src/Cli/LoggingCli.ts +312 -108
  2787. package/src/Cli/ModeTag.ts +1 -1
  2788. package/src/Cli/NamespaceTree.ts +94 -21
  2789. package/src/Cli/PlainCliFormatter.ts +75 -0
  2790. package/src/Cli/PropertyDiff.ts +229 -0
  2791. package/src/Cli/checkVersion.ts +19 -6
  2792. package/src/Cli/commands/aws.ts +68 -101
  2793. package/src/Cli/commands/cloudflare.ts +204 -444
  2794. package/src/Cli/commands/compat.ts +25 -0
  2795. package/src/Cli/commands/confirm.ts +46 -0
  2796. package/src/Cli/commands/deploy.ts +226 -213
  2797. package/src/Cli/commands/dev.ts +75 -34
  2798. package/src/Cli/commands/drift.ts +107 -0
  2799. package/src/Cli/commands/errors.ts +162 -0
  2800. package/src/Cli/commands/flags.ts +203 -0
  2801. package/src/Cli/commands/instrument.ts +27 -0
  2802. package/src/Cli/commands/logs.ts +127 -145
  2803. package/src/Cli/commands/nuke.ts +146 -819
  2804. package/src/Cli/commands/profile/commands.ts +482 -0
  2805. package/src/Cli/commands/profile/flows.ts +218 -0
  2806. package/src/Cli/commands/profile/hub.ts +191 -0
  2807. package/src/Cli/commands/profile/index.ts +1 -0
  2808. package/src/Cli/commands/provider.ts +63 -0
  2809. package/src/Cli/commands/render.ts +121 -0
  2810. package/src/Cli/commands/state.ts +250 -387
  2811. package/src/Cli/components/types.ts +141 -0
  2812. package/src/Cli/components/ui/Data.tsx +44 -0
  2813. package/src/Cli/components/ui/Environment.tsx +87 -0
  2814. package/src/Cli/components/ui/Feedback.tsx +269 -0
  2815. package/src/Cli/components/ui/Interactive.tsx +1061 -0
  2816. package/src/Cli/components/ui/Layout.tsx +252 -0
  2817. package/src/Cli/components/ui/Live.tsx +131 -0
  2818. package/src/Cli/components/ui/ProgressBar.tsx +57 -0
  2819. package/src/Cli/components/ui/Transcript.tsx +42 -0
  2820. package/src/Cli/components/ui/Typography.tsx +83 -0
  2821. package/src/Cli/components/ui/index.ts +68 -0
  2822. package/src/Cli/components/view/ApprovePlan.tsx +102 -0
  2823. package/src/Cli/components/view/Help.tsx +381 -0
  2824. package/src/Cli/components/view/Logo.tsx +169 -0
  2825. package/src/Cli/components/view/Nuke.tsx +258 -0
  2826. package/src/Cli/components/view/PlanDecision.tsx +81 -0
  2827. package/src/Cli/components/view/PlanRow.tsx +39 -0
  2828. package/src/Cli/components/view/PlanTree.ts +354 -0
  2829. package/src/Cli/components/view/PlanView.tsx +826 -0
  2830. package/src/Cli/components/view/Profile.tsx +446 -0
  2831. package/src/Cli/components/view/ProfileDashboard.tsx +930 -0
  2832. package/src/Cli/components/view/Prompts.tsx +794 -0
  2833. package/src/Cli/components/view/Runtime.tsx +976 -0
  2834. package/src/Cli/components/view/SigilCli.tsx +186 -0
  2835. package/src/Cli/components/view/StackOutputs.tsx +38 -0
  2836. package/src/Cli/components/view/StateExplorer.tsx +1179 -0
  2837. package/src/Cli/components/view/statusStyle.ts +97 -0
  2838. package/src/Cli/components/view/usePlanPresentation.ts +82 -0
  2839. package/src/Cli/components/view/usePlanViewport.ts +172 -0
  2840. package/src/Cli/exec.ts +281 -32
  2841. package/src/Cli/main.ts +188 -42
  2842. package/src/Cli/selectCli.ts +30 -15
  2843. package/src/Cloudflare/AI/GatewayProvider.ts +1 -1
  2844. package/src/Cloudflare/AI/LanguageModel.ts +2 -2
  2845. package/src/Cloudflare/AI/ProviderKey.ts +3 -3
  2846. package/src/Cloudflare/AI/SearchToken.ts +3 -6
  2847. package/src/Cloudflare/Access.ts +1 -1
  2848. package/src/Cloudflare/Alerting/Webhook.ts +1 -1
  2849. package/src/Cloudflare/ApiToken/UserApiToken.ts +1 -1
  2850. package/src/Cloudflare/Auth/AuthConfig.ts +117 -0
  2851. package/src/Cloudflare/Auth/AuthProvider.ts +712 -608
  2852. package/src/Cloudflare/Auth/OAuthClient.ts +40 -366
  2853. package/src/Cloudflare/Auth/OAuthScopes.ts +921 -0
  2854. package/src/Cloudflare/Auth/TokenPolicy.ts +79 -0
  2855. package/src/Cloudflare/Bridge.ts +9 -0
  2856. package/src/Cloudflare/CloudflareEnvironment.ts +11 -25
  2857. package/src/Cloudflare/CloudflareEnvironmentService.ts +10 -0
  2858. package/src/Cloudflare/Containers/Container.ts +12 -24
  2859. package/src/Cloudflare/Containers/ContainerApplication.ts +22 -30
  2860. package/src/Cloudflare/Containers/ContainerPlatform.ts +6 -6
  2861. package/src/Cloudflare/Containers/ContainerProvider.ts +183 -86
  2862. package/src/Cloudflare/Containers/ContainerPublication.ts +13 -0
  2863. package/src/Cloudflare/Containers/LocalContainerProvider.ts +3 -2
  2864. package/src/Cloudflare/Credentials.ts +18 -72
  2865. package/src/Cloudflare/D1/Database.ts +3 -3
  2866. package/src/Cloudflare/EdgeSession.ts +2 -3
  2867. package/src/Cloudflare/Fetcher.ts +65 -174
  2868. package/src/Cloudflare/Flagship/Flag.ts +13 -2
  2869. package/src/Cloudflare/HostnameTlsSetting/HostnameTlsSetting.ts +21 -41
  2870. package/src/Cloudflare/Hyperdrive/Connection.ts +19 -12
  2871. package/src/Cloudflare/Iam/ResourceGroup.ts +1 -1
  2872. package/src/Cloudflare/LoadBalancer/LoadBalancer.ts +2 -2
  2873. package/src/Cloudflare/LoadBalancer/Monitor.ts +1 -1
  2874. package/src/Cloudflare/Local.ts +8 -4
  2875. package/src/Cloudflare/LocalRuntime.ts +8 -2
  2876. package/src/Cloudflare/Logs.ts +73 -59
  2877. package/src/Cloudflare/MagicTransit/IpsecTunnel.ts +1 -1
  2878. package/src/Cloudflare/MtlsCertificate/MtlsCertificate.ts +1 -1
  2879. package/src/Cloudflare/Organization/Organization.ts +1 -1
  2880. package/src/Cloudflare/OriginTlsClientAuth/Certificate.ts +2 -2
  2881. package/src/Cloudflare/OriginTlsClientAuth/HostnameAssociation.ts +1 -1
  2882. package/src/Cloudflare/OriginTlsClientAuth/HostnameCertificate.ts +2 -2
  2883. package/src/Cloudflare/OriginTlsClientAuth/Setting.ts +1 -1
  2884. package/src/Cloudflare/Pages/Project.ts +1 -1
  2885. package/src/Cloudflare/Pipelines/LegacyPipeline.ts +2 -2
  2886. package/src/Cloudflare/Pipelines/Sink.ts +3 -3
  2887. package/src/Cloudflare/Providers.ts +13 -51
  2888. package/src/Cloudflare/Queues/Consumer.ts +2 -2
  2889. package/src/Cloudflare/Queues/Queue.ts +2 -2
  2890. package/src/Cloudflare/R2/Bucket.ts +25 -2
  2891. package/src/Cloudflare/R2/BucketBinding.ts +1 -0
  2892. package/src/Cloudflare/R2/BucketSippy.ts +7 -7
  2893. package/src/Cloudflare/R2/BucketTypes.ts +8 -0
  2894. package/src/Cloudflare/R2/WriteBucketBinding.ts +9 -6
  2895. package/src/Cloudflare/R2/index.ts +1 -0
  2896. package/src/Cloudflare/SecretsStore/Secret.ts +3 -3
  2897. package/src/Cloudflare/Snippets/SnippetRules.ts +9 -3
  2898. package/src/Cloudflare/StateStore/Api.ts +2 -2
  2899. package/src/Cloudflare/StateStore/CredentialsFile.ts +11 -6
  2900. package/src/Cloudflare/StateStore/State.ts +262 -210
  2901. package/src/Cloudflare/Vectorize/SearchIndexHttpClient.ts +2 -2
  2902. package/src/Cloudflare/Website/Nextjs.ts +4 -15
  2903. package/src/Cloudflare/Website/Nuxt.ts +1 -1
  2904. package/src/Cloudflare/Website/Octane.ts +1 -1
  2905. package/src/Cloudflare/Website/SvelteKit.ts +1 -1
  2906. package/src/Cloudflare/Website/Vocs.ts +3 -7
  2907. package/src/Cloudflare/Workers/Assets.ts +106 -38
  2908. package/src/Cloudflare/Workers/BrowserHttpClient.ts +10 -3
  2909. package/src/Cloudflare/Workers/CloudflareTracer.ts +113 -0
  2910. package/src/Cloudflare/Workers/Compatibility.ts +37 -7
  2911. package/src/Cloudflare/Workers/DurableObject.ts +90 -12
  2912. package/src/Cloudflare/Workers/DurableObjectBridge.ts +9 -1
  2913. package/src/Cloudflare/Workers/DurableObjectState.ts +46 -9
  2914. package/src/Cloudflare/Workers/DurableObjectStorage.ts +46 -35
  2915. package/src/Cloudflare/Workers/HttpServer.ts +2 -1
  2916. package/src/Cloudflare/Workers/InferEnv.ts +2 -2
  2917. package/src/Cloudflare/Workers/LocalWorkerProvider.ts +204 -79
  2918. package/src/Cloudflare/Workers/Rpc.ts +17 -2
  2919. package/src/Cloudflare/Workers/RpcAsync.ts +1 -1
  2920. package/src/Cloudflare/Workers/RpcWorker.ts +44 -18
  2921. package/src/Cloudflare/Workers/Source.ts +9 -1
  2922. package/src/Cloudflare/Workers/Sources/Prebuilt.ts +3 -2
  2923. package/src/Cloudflare/Workers/Sources/Python.ts +21 -14
  2924. package/src/Cloudflare/Workers/Sources/Rolldown.ts +35 -19
  2925. package/src/Cloudflare/Workers/Sources/Vite.ts +42 -34
  2926. package/src/Cloudflare/Workers/Sources/WorkerModulePlugin.ts +75 -0
  2927. package/src/Cloudflare/Workers/Telemetry.ts +170 -0
  2928. package/src/Cloudflare/Workers/ViteBuildChildRunner.ts +6 -1
  2929. package/src/Cloudflare/Workers/ViteChild.shared.ts +2 -0
  2930. package/src/Cloudflare/Workers/ViteChild.ts +23 -22
  2931. package/src/Cloudflare/Workers/ViteChildRunner.ts +2 -1
  2932. package/src/Cloudflare/Workers/Worker.ts +277 -268
  2933. package/src/Cloudflare/Workers/WorkerAsyncBindings.ts +29 -0
  2934. package/src/Cloudflare/Workers/WorkerBinding.ts +1 -1
  2935. package/src/Cloudflare/Workers/WorkerBridge.ts +6 -6
  2936. package/src/Cloudflare/Workers/WorkerEntrypoint.ts +47 -14
  2937. package/src/Cloudflare/Workers/WorkerLoader.ts +40 -8
  2938. package/src/Cloudflare/Workers/WorkerProvider.ts +641 -59
  2939. package/src/Cloudflare/Workers/WorkerRuntime.ts +195 -0
  2940. package/src/Cloudflare/Workers/WorkerRuntimeContext.ts +10 -6
  2941. package/src/Cloudflare/Workers/cloudflare_workers.ts +5 -1
  2942. package/src/Cloudflare/Workers/index.ts +1 -0
  2943. package/src/Cloudflare/Workers/worker-module.d.ts +9 -0
  2944. package/src/Cloudflare/Workflows/Workflow.ts +105 -43
  2945. package/src/Cloudflare/Workflows/WorkflowBridge.ts +14 -10
  2946. package/src/Cloudflare/Workflows/WorkflowRuntime.ts +56 -0
  2947. package/src/Cloudflare/index.ts +3 -1
  2948. package/src/Command/Command.ts +11 -3
  2949. package/src/Command/Dev.ts +35 -9
  2950. package/src/Command/Local.ts +8 -2
  2951. package/src/Command/Memo.ts +6 -7
  2952. package/src/Docker/BuildHash.ts +75 -8
  2953. package/src/Docker/Container.ts +1 -1
  2954. package/src/Docker/Docker.ts +226 -81
  2955. package/src/Docker/Image.ts +1 -1
  2956. package/src/Docker/Registry.ts +1 -1
  2957. package/src/Docker/RegistryError.ts +52 -0
  2958. package/src/Docker/RemoteImage.ts +1 -1
  2959. package/src/Docker/Service.ts +7 -21
  2960. package/src/Docker/ServiceImage.ts +4 -5
  2961. package/src/Docker/index.ts +5 -0
  2962. package/src/{Sync.ts → Drift.ts} +161 -59
  2963. package/src/Drizzle/Postgres.ts +3 -1
  2964. package/src/Drizzle/Schema.ts +5 -7
  2965. package/src/Fly/AuthProvider.ts +44 -232
  2966. package/src/Fly/BucketBinding.ts +6 -6
  2967. package/src/Fly/CheckpointHttp.ts +5 -2
  2968. package/src/Fly/Credentials.ts +29 -16
  2969. package/src/Fly/DecryptHttp.ts +5 -2
  2970. package/src/Fly/EncryptHttp.ts +5 -2
  2971. package/src/Fly/ExecHttp.ts +5 -2
  2972. package/src/Fly/GetSecretHttp.ts +6 -3
  2973. package/src/Fly/ListSecretsHttp.ts +5 -2
  2974. package/src/Fly/Machine.ts +67 -20
  2975. package/src/Fly/Providers.ts +2 -2
  2976. package/src/Fly/RedisBinding.ts +2 -2
  2977. package/src/Fly/Secret.ts +4 -4
  2978. package/src/Fly/SecretHttp.ts +1 -1
  2979. package/src/Fly/Service.ts +47 -23
  2980. package/src/Fly/SignHttp.ts +5 -2
  2981. package/src/Fly/Sprite.ts +2 -2
  2982. package/src/Fly/VerifyHttp.ts +5 -2
  2983. package/src/Fly/Website/AssetDeployment.ts +12 -9
  2984. package/src/Fly/WriteSecretHttp.ts +5 -2
  2985. package/src/Fly/replicas.ts +94 -10
  2986. package/src/Git/Api/GitHub.ts +106 -0
  2987. package/src/Git/Api/Internal.ts +27 -0
  2988. package/src/Git/Api/Objects.ts +161 -0
  2989. package/src/Git/Api/Protocol.ts +37 -0
  2990. package/src/Git/Api/Pulls.ts +158 -0
  2991. package/src/Git/Api/Refs.ts +96 -0
  2992. package/src/Git/Api/Repos.ts +170 -0
  2993. package/src/Git/Api/Schema.ts +552 -0
  2994. package/src/Git/Api.ts +82 -0
  2995. package/src/Git/BlobStore.ts +265 -0
  2996. package/src/Git/BlobStoreS3.ts +265 -0
  2997. package/src/Git/DESIGN.md +2098 -0
  2998. package/src/Git/Engine.ts +461 -0
  2999. package/src/Git/GitHubCompat.ts +713 -0
  3000. package/src/Git/Hasher/Hasher.ts +360 -0
  3001. package/src/Git/Hasher/Lambda.ts +126 -0
  3002. package/src/Git/Hasher/LambdaEvent.ts +149 -0
  3003. package/src/Git/Hasher/LambdaFunction.ts +46 -0
  3004. package/src/Git/Hasher/Protocol.ts +309 -0
  3005. package/src/Git/Hasher/WorkerLoader.ts +179 -0
  3006. package/src/Git/Hasher/WorkerLoaderModule.ts +72 -0
  3007. package/src/Git/Hasher/index.ts +39 -0
  3008. package/src/Git/Http/ReceivePack.ts +133 -0
  3009. package/src/Git/Http.ts +4 -0
  3010. package/src/Git/Jobs/Bundle.ts +264 -0
  3011. package/src/Git/Jobs/Compact.ts +517 -0
  3012. package/src/Git/Jobs/Fork.ts +376 -0
  3013. package/src/Git/Jobs/Import.ts +435 -0
  3014. package/src/Git/Jobs/Purge.ts +136 -0
  3015. package/src/Git/Operations.ts +1087 -0
  3016. package/src/Git/Protocol/Advertise.ts +159 -0
  3017. package/src/Git/Protocol/Delta.ts +182 -0
  3018. package/src/Git/Protocol/GzipBody.ts +153 -0
  3019. package/src/Git/Protocol/ObjectCodec.ts +941 -0
  3020. package/src/Git/Protocol/PackParser.ts +907 -0
  3021. package/src/Git/Protocol/PackWriter.ts +141 -0
  3022. package/src/Git/Protocol/PartialScan.ts +705 -0
  3023. package/src/Git/Protocol/Pkt.ts +289 -0
  3024. package/src/Git/Protocol/ReceivePack.ts +446 -0
  3025. package/src/Git/Protocol/Sideband.ts +289 -0
  3026. package/src/Git/Protocol/Store.ts +176 -0
  3027. package/src/Git/Protocol/TreeDiff.ts +464 -0
  3028. package/src/Git/Protocol/UploadPack.ts +366 -0
  3029. package/src/Git/Protocol/Zlib.ts +350 -0
  3030. package/src/Git/Push.ts +71 -0
  3031. package/src/Git/PushInput.ts +73 -0
  3032. package/src/Git/PushWire.ts +90 -0
  3033. package/src/Git/RFC-building-blocks.md +548 -0
  3034. package/src/Git/RegistryD1.ts +338 -0
  3035. package/src/Git/RegistryObject.ts +522 -0
  3036. package/src/Git/RepoObject.ts +5876 -0
  3037. package/src/Git/Server.ts +827 -0
  3038. package/src/Git/Store/Closure.ts +539 -0
  3039. package/src/Git/Store/HeadSnapshot.ts +49 -0
  3040. package/src/Git/Store/IncomingBody.ts +67 -0
  3041. package/src/Git/Store/Keys.ts +129 -0
  3042. package/src/Git/Store/ObjectStore.ts +1086 -0
  3043. package/src/Git/Store/PackSource.ts +160 -0
  3044. package/src/Git/Store/Sql.ts +492 -0
  3045. package/src/Git/Store/StreamingSource.ts +335 -0
  3046. package/src/Git/index.ts +75 -0
  3047. package/src/GitHub/AuthProvider.ts +225 -143
  3048. package/src/GitHub/BranchProtection.ts +651 -0
  3049. package/src/GitHub/Collaborator.ts +239 -0
  3050. package/src/GitHub/Credentials.ts +6 -13
  3051. package/src/GitHub/Env.ts +8 -8
  3052. package/src/GitHub/Issue.ts +379 -0
  3053. package/src/GitHub/Label.ts +373 -0
  3054. package/src/GitHub/Milestone.ts +424 -0
  3055. package/src/GitHub/Providers.ts +37 -5
  3056. package/src/GitHub/PullRequest.ts +570 -0
  3057. package/src/GitHub/Release.ts +520 -0
  3058. package/src/GitHub/Ruleset.ts +568 -0
  3059. package/src/GitHub/TeamAccess.ts +251 -0
  3060. package/src/GitHub/WikiPage.ts +581 -0
  3061. package/src/GitHub/index.ts +10 -0
  3062. package/src/Hetzner/AuthProvider.ts +50 -238
  3063. package/src/Hetzner/Credentials.ts +4 -12
  3064. package/src/Hetzner/Providers.ts +2 -2
  3065. package/src/Hetzner/Server.ts +34 -6
  3066. package/src/Http/Platform.ts +47 -0
  3067. package/src/Http/index.ts +5 -0
  3068. package/src/Http.ts +9 -5
  3069. package/src/Interaction.ts +354 -0
  3070. package/src/Kubernetes/ClusterAdapter.ts +4 -5
  3071. package/src/Kubernetes/Deployment.ts +7 -21
  3072. package/src/Kubernetes/Job.ts +7 -21
  3073. package/src/Kubernetes/internal/helm.ts +1 -1
  3074. package/src/Kubernetes/internal/kubeconfig.ts +1 -1
  3075. package/src/Kubernetes/internal/workload.ts +4 -4
  3076. package/src/Local/DevLog.ts +135 -0
  3077. package/src/Local/LocalProvider.ts +7 -6
  3078. package/src/Local/ProviderLayer.ts +31 -15
  3079. package/src/Local/RpcProvider.ts +3 -3
  3080. package/src/Local/RpcProviderProxy.ts +28 -21
  3081. package/src/Local/RpcServer.ts +101 -53
  3082. package/src/Local/RpcServerEnvironment.ts +4 -3
  3083. package/src/Local/RpcSpawner.ts +161 -78
  3084. package/src/Local/Sidecar.ts +32 -0
  3085. package/src/Neon/AuthProvider.ts +31 -203
  3086. package/src/Neon/Credentials.ts +4 -12
  3087. package/src/Neon/Providers.ts +2 -2
  3088. package/src/Nuke.ts +467 -0
  3089. package/src/Output.ts +1 -1
  3090. package/src/Phase.ts +3 -3
  3091. package/src/Plan.ts +931 -712
  3092. package/src/Planetscale/AuthProvider.ts +397 -324
  3093. package/src/Planetscale/Credentials.ts +21 -19
  3094. package/src/Planetscale/OAuthClient.ts +34 -328
  3095. package/src/Planetscale/Providers.ts +2 -2
  3096. package/src/Planetscale/Util.ts +1 -1
  3097. package/src/Prisma/App.ts +126 -80
  3098. package/src/Prisma/AuthProvider.ts +62 -240
  3099. package/src/Prisma/Branch.ts +133 -66
  3100. package/src/Prisma/Bucket.ts +64 -25
  3101. package/src/Prisma/BucketAccessKey.ts +68 -32
  3102. package/src/Prisma/Client.ts +8 -11
  3103. package/src/Prisma/Compute.ts +362 -200
  3104. package/src/Prisma/ComputeArchive.ts +29 -3
  3105. package/src/Prisma/ComputeBuild.ts +256 -3
  3106. package/src/Prisma/ComputeLifecycle.ts +179 -160
  3107. package/src/Prisma/Connection.ts +112 -55
  3108. package/src/Prisma/Credentials.ts +73 -0
  3109. package/src/Prisma/Database.ts +191 -155
  3110. package/src/Prisma/Deployment.ts +70 -50
  3111. package/src/Prisma/EnvironmentVariable.ts +112 -69
  3112. package/src/Prisma/Internal/AppPromotion.ts +39 -27
  3113. package/src/Prisma/Internal/DatabaseSecrets.ts +23 -19
  3114. package/src/Prisma/Internal/DeploymentActions.ts +24 -40
  3115. package/src/Prisma/Internal/DeploymentIdentity.ts +29 -3
  3116. package/src/Prisma/Internal/DeploymentObserve.ts +4 -5
  3117. package/src/Prisma/Internal/LogsClient.ts +165 -0
  3118. package/src/Prisma/Internal/Observed.ts +192 -0
  3119. package/src/Prisma/Internal/Pagination.ts +16 -0
  3120. package/src/Prisma/Operations.ts +3 -2
  3121. package/src/Prisma/PrismaEnvironment.ts +8 -16
  3122. package/src/Prisma/PrismaLogs.ts +38 -16
  3123. package/src/Prisma/Project.ts +163 -129
  3124. package/src/Prisma/Providers.ts +44 -9
  3125. package/src/Prisma/SourceRepository.ts +223 -87
  3126. package/src/Provider.ts +31 -28
  3127. package/src/Railway/AuditLog.ts +41 -17
  3128. package/src/Railway/AuthProvider.ts +292 -236
  3129. package/src/Railway/Bucket.ts +96 -65
  3130. package/src/Railway/BucketBinding.ts +7 -7
  3131. package/src/Railway/Catalog.ts +8 -1
  3132. package/src/Railway/CloudAgent.ts +73 -56
  3133. package/src/Railway/Credentials.ts +5 -14
  3134. package/src/Railway/CustomDomain.ts +112 -67
  3135. package/src/Railway/Environment.ts +18 -7
  3136. package/src/Railway/Function.ts +169 -136
  3137. package/src/Railway/GraphQL.ts +215 -0
  3138. package/src/Railway/Group.ts +172 -72
  3139. package/src/Railway/LoginSession.ts +12 -17
  3140. package/src/Railway/Mongo.ts +236 -194
  3141. package/src/Railway/MountVolume.ts +5 -4
  3142. package/src/Railway/MySQL.ts +236 -194
  3143. package/src/Railway/Postgres.ts +243 -197
  3144. package/src/Railway/PrivateNetwork.ts +444 -310
  3145. package/src/Railway/Project.ts +86 -64
  3146. package/src/Railway/ProjectEnvironment.ts +87 -58
  3147. package/src/Railway/Providers.ts +8 -4
  3148. package/src/Railway/Redis.ts +118 -93
  3149. package/src/Railway/RedisBinding.ts +2 -2
  3150. package/src/Railway/Sandbox.ts +282 -133
  3151. package/src/Railway/SandboxCheckpoint.ts +290 -0
  3152. package/src/Railway/Service.ts +76 -2
  3153. package/src/Railway/ServiceDomain.ts +279 -63
  3154. package/src/Railway/ServiceProvider.ts +500 -238
  3155. package/src/Railway/TcpProxy.ts +50 -37
  3156. package/src/Railway/Template.ts +190 -136
  3157. package/src/Railway/Usage.ts +93 -47
  3158. package/src/Railway/Variable.ts +35 -35
  3159. package/src/Railway/Volume.ts +150 -90
  3160. package/src/Railway/VolumeBackup.ts +144 -101
  3161. package/src/Railway/Website/Cdn.ts +136 -55
  3162. package/src/Railway/hosted.ts +10 -3
  3163. package/src/Railway/index.ts +1 -0
  3164. package/src/Railway/local-context.ts +333 -0
  3165. package/src/Railway/transient.ts +26 -52
  3166. package/src/Report.ts +365 -0
  3167. package/src/Rpc.ts +53 -1
  3168. package/src/Runtime/Bootstrap/Process.ts +2 -2
  3169. package/src/Runtime.ts +1 -1
  3170. package/src/RuntimeContext.ts +1 -1
  3171. package/src/SQL/Postgres.ts +5 -1
  3172. package/src/SQL/PostgresTls.ts +70 -0
  3173. package/src/Server/Process.ts +1 -1
  3174. package/src/Server/index.ts +0 -2
  3175. package/src/Stack.ts +14 -9
  3176. package/src/StackContext.ts +6 -0
  3177. package/src/State/Export.ts +28 -47
  3178. package/src/State/HttpStateStore.ts +31 -37
  3179. package/src/State/LocalState.ts +6 -16
  3180. package/src/State/PostgresState.ts +6 -5
  3181. package/src/State/State.ts +5 -0
  3182. package/src/State/Tree.ts +277 -0
  3183. package/src/State/index.ts +1 -0
  3184. package/src/Stripe/Account.ts +795 -0
  3185. package/src/Stripe/AccountExternalAccount.ts +568 -0
  3186. package/src/Stripe/AccountPerson.ts +562 -0
  3187. package/src/Stripe/Alert.ts +437 -0
  3188. package/src/Stripe/ApplePayDomain.ts +254 -0
  3189. package/src/Stripe/AppsSecret.ts +385 -0
  3190. package/src/Stripe/AuthProvider.ts +74 -0
  3191. package/src/Stripe/BillingMeter.ts +449 -0
  3192. package/src/Stripe/BillingPortalConfiguration.ts +920 -0
  3193. package/src/Stripe/ConsumeEvents.ts +278 -0
  3194. package/src/Stripe/Coupon.ts +535 -0
  3195. package/src/Stripe/CreateAccount.ts +39 -0
  3196. package/src/Stripe/CreateAccountHttp.ts +20 -0
  3197. package/src/Stripe/CreateAccountLink.ts +43 -0
  3198. package/src/Stripe/CreateAccountLinkHttp.ts +20 -0
  3199. package/src/Stripe/CreateAppsSecret.ts +39 -0
  3200. package/src/Stripe/CreateAppsSecretHttp.ts +20 -0
  3201. package/src/Stripe/CreateBillingPortalSession.ts +52 -0
  3202. package/src/Stripe/CreateBillingPortalSessionHttp.ts +20 -0
  3203. package/src/Stripe/CreateCheckoutSession.ts +53 -0
  3204. package/src/Stripe/CreateCheckoutSessionHttp.ts +20 -0
  3205. package/src/Stripe/CreateCreditGrant.ts +45 -0
  3206. package/src/Stripe/CreateCreditGrantHttp.ts +20 -0
  3207. package/src/Stripe/CreateCustomer.ts +38 -0
  3208. package/src/Stripe/CreateCustomerHttp.ts +20 -0
  3209. package/src/Stripe/CreateFileLink.ts +37 -0
  3210. package/src/Stripe/CreateFileLinkHttp.ts +20 -0
  3211. package/src/Stripe/CreateIssuingCard.ts +43 -0
  3212. package/src/Stripe/CreateIssuingCardHttp.ts +20 -0
  3213. package/src/Stripe/CreateIssuingCardholder.ts +50 -0
  3214. package/src/Stripe/CreateIssuingCardholderHttp.ts +20 -0
  3215. package/src/Stripe/CreateTerminalReader.ts +43 -0
  3216. package/src/Stripe/CreateTerminalReaderHttp.ts +20 -0
  3217. package/src/Stripe/Credentials.ts +54 -0
  3218. package/src/Stripe/CreditGrant.ts +627 -0
  3219. package/src/Stripe/Customer.ts +315 -0
  3220. package/src/Stripe/CustomerTaxId.ts +351 -0
  3221. package/src/Stripe/EntitlementsFeature.ts +384 -0
  3222. package/src/Stripe/Events.ts +94 -0
  3223. package/src/Stripe/FileLink.ts +335 -0
  3224. package/src/Stripe/IssuingCard.ts +712 -0
  3225. package/src/Stripe/IssuingCardholder.ts +907 -0
  3226. package/src/Stripe/IssuingPersonalizationDesign.ts +582 -0
  3227. package/src/Stripe/Metadata.ts +93 -0
  3228. package/src/Stripe/PaymentLink.ts +779 -0
  3229. package/src/Stripe/PaymentMethodConfiguration.ts +619 -0
  3230. package/src/Stripe/PaymentMethodDomain.ts +342 -0
  3231. package/src/Stripe/Plan.ts +482 -0
  3232. package/src/Stripe/Price.ts +523 -0
  3233. package/src/Stripe/Product.ts +339 -0
  3234. package/src/Stripe/ProductFeature.ts +300 -0
  3235. package/src/Stripe/PromotionCode.ts +612 -0
  3236. package/src/Stripe/Providers.ts +306 -0
  3237. package/src/Stripe/RadarValueList.ts +397 -0
  3238. package/src/Stripe/RadarValueListItem.ts +308 -0
  3239. package/src/Stripe/RestrictedApiKey.ts +210 -0
  3240. package/src/Stripe/RetrieveAccount.ts +42 -0
  3241. package/src/Stripe/RetrieveAccountExternalAccount.ts +47 -0
  3242. package/src/Stripe/RetrieveAccountExternalAccountHttp.ts +52 -0
  3243. package/src/Stripe/RetrieveAccountHttp.ts +21 -0
  3244. package/src/Stripe/RetrieveAccountPerson.ts +42 -0
  3245. package/src/Stripe/RetrieveAccountPersonHttp.ts +52 -0
  3246. package/src/Stripe/RetrieveAlert.ts +42 -0
  3247. package/src/Stripe/RetrieveAlertHttp.ts +20 -0
  3248. package/src/Stripe/RetrieveApplePayDomain.ts +46 -0
  3249. package/src/Stripe/RetrieveApplePayDomainHttp.ts +21 -0
  3250. package/src/Stripe/RetrieveAppsSecret.ts +47 -0
  3251. package/src/Stripe/RetrieveAppsSecretHttp.ts +58 -0
  3252. package/src/Stripe/RetrieveBillingMeter.ts +42 -0
  3253. package/src/Stripe/RetrieveBillingMeterHttp.ts +20 -0
  3254. package/src/Stripe/RetrieveBillingPortalConfiguration.ts +47 -0
  3255. package/src/Stripe/RetrieveBillingPortalConfigurationHttp.ts +20 -0
  3256. package/src/Stripe/RetrieveCoupon.ts +42 -0
  3257. package/src/Stripe/RetrieveCouponHttp.ts +21 -0
  3258. package/src/Stripe/RetrieveCreditGrant.ts +46 -0
  3259. package/src/Stripe/RetrieveCreditGrantHttp.ts +21 -0
  3260. package/src/Stripe/RetrieveCustomer.ts +42 -0
  3261. package/src/Stripe/RetrieveCustomerHttp.ts +21 -0
  3262. package/src/Stripe/RetrieveCustomerTaxId.ts +42 -0
  3263. package/src/Stripe/RetrieveCustomerTaxIdHttp.ts +52 -0
  3264. package/src/Stripe/RetrieveEntitlementsFeature.ts +47 -0
  3265. package/src/Stripe/RetrieveEntitlementsFeatureHttp.ts +20 -0
  3266. package/src/Stripe/RetrieveFileLink.ts +42 -0
  3267. package/src/Stripe/RetrieveFileLinkHttp.ts +21 -0
  3268. package/src/Stripe/RetrieveIssuingCard.ts +42 -0
  3269. package/src/Stripe/RetrieveIssuingCardHttp.ts +21 -0
  3270. package/src/Stripe/RetrieveIssuingCardholder.ts +47 -0
  3271. package/src/Stripe/RetrieveIssuingCardholderHttp.ts +21 -0
  3272. package/src/Stripe/RetrieveIssuingPersonalizationDesign.ts +47 -0
  3273. package/src/Stripe/RetrieveIssuingPersonalizationDesignHttp.ts +21 -0
  3274. package/src/Stripe/RetrievePaymentLink.ts +42 -0
  3275. package/src/Stripe/RetrievePaymentLinkHttp.ts +21 -0
  3276. package/src/Stripe/RetrievePaymentMethodConfiguration.ts +47 -0
  3277. package/src/Stripe/RetrievePaymentMethodConfigurationHttp.ts +20 -0
  3278. package/src/Stripe/RetrievePaymentMethodDomain.ts +47 -0
  3279. package/src/Stripe/RetrievePaymentMethodDomainHttp.ts +20 -0
  3280. package/src/Stripe/RetrievePlan.ts +39 -0
  3281. package/src/Stripe/RetrievePlanHttp.ts +21 -0
  3282. package/src/Stripe/RetrievePrice.ts +39 -0
  3283. package/src/Stripe/RetrievePriceHttp.ts +21 -0
  3284. package/src/Stripe/RetrieveProduct.ts +46 -0
  3285. package/src/Stripe/RetrieveProductFeature.ts +46 -0
  3286. package/src/Stripe/RetrieveProductFeatureHttp.ts +52 -0
  3287. package/src/Stripe/RetrieveProductHttp.ts +58 -0
  3288. package/src/Stripe/RetrievePromotionCode.ts +46 -0
  3289. package/src/Stripe/RetrievePromotionCodeHttp.ts +21 -0
  3290. package/src/Stripe/RetrieveRadarValueList.ts +46 -0
  3291. package/src/Stripe/RetrieveRadarValueListHttp.ts +20 -0
  3292. package/src/Stripe/RetrieveRadarValueListItem.ts +47 -0
  3293. package/src/Stripe/RetrieveRadarValueListItemHttp.ts +20 -0
  3294. package/src/Stripe/RetrieveShippingRate.ts +42 -0
  3295. package/src/Stripe/RetrieveShippingRateHttp.ts +21 -0
  3296. package/src/Stripe/RetrieveTaxRate.ts +42 -0
  3297. package/src/Stripe/RetrieveTaxRateHttp.ts +21 -0
  3298. package/src/Stripe/RetrieveTaxRegistration.ts +46 -0
  3299. package/src/Stripe/RetrieveTaxRegistrationHttp.ts +21 -0
  3300. package/src/Stripe/RetrieveTaxSettings.ts +41 -0
  3301. package/src/Stripe/RetrieveTaxSettingsHttp.ts +46 -0
  3302. package/src/Stripe/RetrieveTerminalConfiguration.ts +47 -0
  3303. package/src/Stripe/RetrieveTerminalConfigurationHttp.ts +21 -0
  3304. package/src/Stripe/RetrieveTerminalLocation.ts +45 -0
  3305. package/src/Stripe/RetrieveTerminalLocationHttp.ts +21 -0
  3306. package/src/Stripe/RetrieveTerminalReader.ts +46 -0
  3307. package/src/Stripe/RetrieveTerminalReaderHttp.ts +21 -0
  3308. package/src/Stripe/RetrieveWebhookEndpoint.ts +46 -0
  3309. package/src/Stripe/RetrieveWebhookEndpointHttp.ts +21 -0
  3310. package/src/Stripe/ShippingRate.ts +614 -0
  3311. package/src/Stripe/StripeHttp.ts +241 -0
  3312. package/src/Stripe/TaxRate.ts +468 -0
  3313. package/src/Stripe/TaxRegistration.ts +722 -0
  3314. package/src/Stripe/TaxSettings.ts +395 -0
  3315. package/src/Stripe/TerminalConfiguration.ts +977 -0
  3316. package/src/Stripe/TerminalLocation.ts +627 -0
  3317. package/src/Stripe/TerminalReader.ts +377 -0
  3318. package/src/Stripe/UpdateAccount.ts +42 -0
  3319. package/src/Stripe/UpdateAccountHttp.ts +21 -0
  3320. package/src/Stripe/UpdateCreditGrant.ts +47 -0
  3321. package/src/Stripe/UpdateCreditGrantHttp.ts +21 -0
  3322. package/src/Stripe/UpdateCustomer.ts +42 -0
  3323. package/src/Stripe/UpdateCustomerHttp.ts +21 -0
  3324. package/src/Stripe/UpdateFileLink.ts +43 -0
  3325. package/src/Stripe/UpdateFileLinkHttp.ts +21 -0
  3326. package/src/Stripe/UpdateIssuingCard.ts +46 -0
  3327. package/src/Stripe/UpdateIssuingCardHttp.ts +21 -0
  3328. package/src/Stripe/UpdateIssuingCardholder.ts +46 -0
  3329. package/src/Stripe/UpdateIssuingCardholderHttp.ts +21 -0
  3330. package/src/Stripe/UpdateTaxSettings.ts +48 -0
  3331. package/src/Stripe/UpdateTaxSettingsHttp.ts +46 -0
  3332. package/src/Stripe/UpdateTerminalReader.ts +46 -0
  3333. package/src/Stripe/UpdateTerminalReaderHttp.ts +21 -0
  3334. package/src/Stripe/WebhookEndpoint.ts +411 -0
  3335. package/src/Stripe/index.ts +150 -0
  3336. package/src/Stripe/missing.ts +16 -0
  3337. package/src/Telemetry/Layer.ts +16 -5
  3338. package/src/Telemetry.ts +21 -440
  3339. package/src/TelemetryRuntime.ts +446 -0
  3340. package/src/Test/Alchemy.ts +2 -0
  3341. package/src/Test/Bun.ts +2 -0
  3342. package/src/Test/Core.ts +42 -13
  3343. package/src/Test/Vitest.ts +2 -0
  3344. package/src/Test/index.ts +6 -1
  3345. package/src/UserFacingError.ts +35 -0
  3346. package/src/Util/AtomicFile.ts +36 -0
  3347. package/src/Util/ConsoleSink.ts +23 -0
  3348. package/src/Util/LineBuffer.ts +20 -0
  3349. package/src/Util/Memoize.ts +48 -0
  3350. package/src/Util/Node.ts +44 -14
  3351. package/src/Util/PlatformServices.ts +11 -1
  3352. package/src/Util/ResourceOutput.ts +77 -0
  3353. package/src/Util/Terminal.ts +81 -0
  3354. package/src/Util/Theme.ts +150 -0
  3355. package/src/Util/gitignore-rules-to-globs.ts +3 -3
  3356. package/src/Util/interactive.ts +103 -16
  3357. package/src/Util/proxy-chain.ts +19 -0
  3358. package/src/Util/scc.ts +43 -23
  3359. package/src/Util/tarGzip.ts +33 -5
  3360. package/src/Util/zip.ts +16 -45
  3361. package/src/Utils/ip-address.ts +90 -0
  3362. package/src/Website/Server.ts +19 -4
  3363. package/src/Website/ServerLocal.ts +6 -2
  3364. package/src/index.ts +3 -2
  3365. package/lib/AWS/Website/ServerLocal.d.ts +0 -2
  3366. package/lib/AWS/Website/ServerLocal.d.ts.map +0 -1
  3367. package/lib/AWS/Website/ServerLocal.js +0 -4
  3368. package/lib/AWS/Website/ServerLocal.js.map +0 -1
  3369. package/lib/Cli/Cli.d.ts +0 -21
  3370. package/lib/Cli/Cli.d.ts.map +0 -1
  3371. package/lib/Cli/Cli.js +0 -5
  3372. package/lib/Cli/Cli.js.map +0 -1
  3373. package/lib/Cli/Event.d.ts +0 -29
  3374. package/lib/Cli/Event.d.ts.map +0 -1
  3375. package/lib/Cli/Event.js +0 -1
  3376. package/lib/Cli/Event.js.map +0 -1
  3377. package/lib/Cli/commands/_shared.d.ts +0 -138
  3378. package/lib/Cli/commands/_shared.d.ts.map +0 -1
  3379. package/lib/Cli/commands/_shared.js +0 -298
  3380. package/lib/Cli/commands/_shared.js.map +0 -1
  3381. package/lib/Cli/commands/login.d.ts +0 -14
  3382. package/lib/Cli/commands/login.d.ts.map +0 -1
  3383. package/lib/Cli/commands/login.js +0 -115
  3384. package/lib/Cli/commands/login.js.map +0 -1
  3385. package/lib/Cli/commands/profile.d.ts +0 -25
  3386. package/lib/Cli/commands/profile.d.ts.map +0 -1
  3387. package/lib/Cli/commands/profile.js +0 -83
  3388. package/lib/Cli/commands/profile.js.map +0 -1
  3389. package/lib/Cli/commands/sync.d.ts +0 -22
  3390. package/lib/Cli/commands/sync.d.ts.map +0 -1
  3391. package/lib/Cli/commands/sync.js +0 -64
  3392. package/lib/Cli/commands/sync.js.map +0 -1
  3393. package/lib/Cli/commands/tail.d.ts +0 -9
  3394. package/lib/Cli/commands/tail.d.ts.map +0 -1
  3395. package/lib/Cli/commands/tail.js +0 -97
  3396. package/lib/Cli/commands/tail.js.map +0 -1
  3397. package/lib/Cli/tui/InkCLI.d.ts +0 -4
  3398. package/lib/Cli/tui/InkCLI.d.ts.map +0 -1
  3399. package/lib/Cli/tui/InkCLI.js +0 -53
  3400. package/lib/Cli/tui/InkCLI.js.map +0 -1
  3401. package/lib/Cli/tui/components/ApprovePlan.d.ts +0 -9
  3402. package/lib/Cli/tui/components/ApprovePlan.d.ts.map +0 -1
  3403. package/lib/Cli/tui/components/ApprovePlan.js +0 -21
  3404. package/lib/Cli/tui/components/ApprovePlan.js.map +0 -1
  3405. package/lib/Cli/tui/components/Nuke.d.ts +0 -36
  3406. package/lib/Cli/tui/components/Nuke.d.ts.map +0 -1
  3407. package/lib/Cli/tui/components/Nuke.js +0 -132
  3408. package/lib/Cli/tui/components/Nuke.js.map +0 -1
  3409. package/lib/Cli/tui/components/Plan.d.ts +0 -8
  3410. package/lib/Cli/tui/components/Plan.d.ts.map +0 -1
  3411. package/lib/Cli/tui/components/Plan.js +0 -87
  3412. package/lib/Cli/tui/components/Plan.js.map +0 -1
  3413. package/lib/Cli/tui/components/PlanProgress.d.ts +0 -55
  3414. package/lib/Cli/tui/components/PlanProgress.d.ts.map +0 -1
  3415. package/lib/Cli/tui/components/PlanProgress.js +0 -292
  3416. package/lib/Cli/tui/components/PlanProgress.js.map +0 -1
  3417. package/lib/Railway/RetryPolicy.d.ts +0 -22
  3418. package/lib/Railway/RetryPolicy.d.ts.map +0 -1
  3419. package/lib/Railway/RetryPolicy.js +0 -43
  3420. package/lib/Railway/RetryPolicy.js.map +0 -1
  3421. package/lib/Sync.d.ts +0 -109
  3422. package/lib/Sync.d.ts.map +0 -1
  3423. package/lib/Sync.js.map +0 -1
  3424. package/lib/Util/Clank.d.ts +0 -45
  3425. package/lib/Util/Clank.d.ts.map +0 -1
  3426. package/lib/Util/Clank.js +0 -79
  3427. package/lib/Util/Clank.js.map +0 -1
  3428. package/src/AWS/Website/ServerLocal.ts +0 -4
  3429. package/src/Cli/Cli.ts +0 -23
  3430. package/src/Cli/Event.ts +0 -51
  3431. package/src/Cli/commands/_shared.ts +0 -498
  3432. package/src/Cli/commands/login.ts +0 -169
  3433. package/src/Cli/commands/profile.ts +0 -132
  3434. package/src/Cli/commands/sync.ts +0 -123
  3435. package/src/Cli/commands/tail.ts +0 -155
  3436. package/src/Cli/tui/InkCLI.tsx +0 -69
  3437. package/src/Cli/tui/components/ApprovePlan.tsx +0 -44
  3438. package/src/Cli/tui/components/Nuke.tsx +0 -273
  3439. package/src/Cli/tui/components/Plan.tsx +0 -211
  3440. package/src/Cli/tui/components/PlanProgress.tsx +0 -455
  3441. package/src/Railway/RetryPolicy.ts +0 -53
  3442. package/src/Util/Clank.ts +0 -103
package/bin/exec.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"exec.js","names":["Path","Path","Context","Context","Context","Context","Context","Context","Context","Context","Context","Context","Context","of","State.State","Context","Output.stackRef","make","Output.isOutput","Context","Output.NamedExpr","Output.EffectExpr","Output.VoidExpr","Context","make","Context","make","ChildProcessSpawner","ChildProcess","Output.isExpr","Output.hasOutputs","Context","Output.ResourceExpr","Output.isExpr","Output.of","Output.isResourceExpr","Output.isPropExpr","Output.isApplyExpr","Output.hasOutputs","Output.isEffectExpr","Output.isFlatMapExpr","Output.asOutput","Output.isAllExpr","Output.isLiteralExpr","Output.isRefExpr","Output.InvalidReferenceError","Output.isStackRefExpr","Output.isNamedExpr","Output.upstreamAny","Output.evaluate","Output.resolveUpstream","Output.upstreamAny","os","crypto","packageJson.version","Clank.PromptCancelled","Context","of","fromEnvironment","options","Region.of","Endpoint.of","Endpoint.none","Clank.text","Clank.password","Clank.success","Clank.select","Clank.info","Clank.warn","Path","NodeCrypto","NodeOs","STORAGE_KEY","options","Clank.text","Clank.select","Clank.password","Clank.success","generateState","crypto","extractCredentials","authorize","OAUTH_ENDPOINTS","OAUTH_CLIENT_ID","OAUTH_REDIRECT_URI","callbackPromise","OAUTH_LOCAL_CALLBACK_URI","OAuthError","exchange","tokenRequest","refresh","exchangeCallbackInput","callback","options","withOAuthCredentials","Clank.info","Clank.select","Clank.text","Clank.confirm","Clank.multiselect","OAuthClient.authorize","Clank.openUrl","Clank.warn","OAuthClient.callback","OAuthClient.exchangeCallbackInput","Clank.success","Clank.password","STATE_STORE_CREDENTIALS_FILE","OAuthClient.refresh","OAuthClient.revoke","OAUTH_CLIENT_ID","OAUTH_REDIRECT_URI","OAUTH_LOCAL_CALLBACK_URI","OAUTH_ENDPOINTS","options","ChildProcess","Clank.password","Clank.success","Clank.text","Clank.select","options","DEFAULT_API_BASE_URL","Clank.password","Clank.text","Clank.success","Clank.select","options","Clank.password","Clank.success","Clank.select","crypto","Clank.info","Clank.select","options","OAuthClient.authorize","Clank.openUrl","Clank.warn","OAuthClient.callback","Clank.text","OAuthClient.exchangeCallbackInput","Clank.success","Clank.password","OAuthClient.refresh","Clank.password","Clank.success","Clank.select","S","Path","Stack.Stack","CLI.Cli","destroy","Plan.destroy","Plan.make","dryRunFlag","actionColor","statusColor","_jsx","_jsxs","_jsxs","_jsx","_jsx","_jsxs","_jsx","PlanComponent","RpcProviderProxy.fromEnv","exec","exec"],"sources":["../lib/AlchemyContext.js","../lib/Util/interactive.js","../lib/Auth/Lock.js","../lib/Auth/AuthProvider.js","../lib/Auth/Profile.js","../lib/Auth/Credentials.js","../lib/Artifacts.js","../lib/Cli/Cli.js","../lib/Ref.js","../lib/AdoptPolicy.js","../lib/FQN.js","../lib/ProviderMode.js","../lib/Provider.js","../lib/Resource.js","../lib/RuntimeContext.js","../lib/Stage.js","../lib/State/State.js","../lib/Util/data.js","../lib/Output.js","../lib/Util/ConfigProvider.js","../lib/Util/effect.js","../lib/Util/FileLogger.js","../lib/Util/Node.js","../lib/Util/PlatformServices.js","../lib/Stack.js","../lib/State/StateEncoding.js","../lib/Local/RpcSerialization.js","../lib/Local/RpcServerEnvironment.js","../lib/Local/RpcProviderProxy.js","../lib/Local/RpcSpawner.js","../lib/ActionRuntimeContext.js","../lib/Auth/Demand.js","../lib/Diff.js","../lib/InstanceId.js","../lib/Util/types.js","../lib/Action.js","../lib/Telemetry/Metrics.js","../lib/Util/scc.js","../lib/Util/sha256.js","../lib/Plan.js","../lib/Apply.js","../package.json","../lib/Telemetry/Attributes.js","../lib/Util/Clank.js","../lib/Auth/Env.js","../lib/AWS/Environment.js","../lib/AWS/Endpoint.js","../lib/AWS/Region.js","../lib/AWS/AuthProvider.js","../lib/Axiom/AuthProvider.js","../lib/Cloudflare/StateStore/CredentialsFile.js","../lib/Cloudflare/Auth/OAuthClient.js","../lib/Cloudflare/Auth/AuthProvider.js","../lib/GitHub/BaseUrl.js","../lib/GitHub/AuthProvider.js","../lib/Hetzner/AuthProvider.js","../lib/Neon/AuthProvider.js","../lib/Planetscale/OAuthClient.js","../lib/Planetscale/AuthProvider.js","../lib/Prisma/AuthProvider.js","../lib/Cli/commands/_shared.js","../lib/Cli/commands/deploy.js","../lib/Cli/ModeTag.js","../lib/Cli/LoggingCli.js","../lib/Cli/NamespaceTree.js","../lib/Cli/tui/components/Plan.js","../lib/Cli/tui/components/ApprovePlan.js","../lib/Cli/tui/components/PlanProgress.js","../lib/Cli/tui/InkCLI.js","../lib/Cli/selectCli.js","../lib/Cli/exec.js","exec.ts"],"sourcesContent":["import * as EffectContext from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Path from \"effect/Path\";\nexport class AlchemyContext extends EffectContext.Service()(\"alchemy/Context\") {\n}\nexport const AlchemyContextLive = Layer.effect(AlchemyContext, Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const dir = path.join(process.cwd(), \".alchemy\");\n yield* fs.makeDirectory(dir, { recursive: true });\n return {\n dotAlchemy: dir,\n updateStateStore: false,\n dev: false,\n adopt: false,\n };\n}));\n//# sourceMappingURL=AlchemyContext.js.map","/**\n * Returns true when the current process looks like it's being driven by a\n * coding agent, CI runner, test runner, or anything else that won't render an\n * interactive TUI / prompt well.\n *\n * Two callers rely on this:\n * - `Cli/selectCli.ts` uses it to pick `LoggingCli` over the Ink TUI.\n * - `Auth/Profile.ts` uses it to refuse to launch an interactive credential\n * configure flow (and thus avoid acquiring an auth lockfile) when there's\n * no TTY to drive the prompts.\n *\n * Kept in `Util` (rather than `Cli`) so `Auth` can depend on it without\n * pulling in the CLI layer.\n */\nexport const isNonInteractive = () => {\n const env = process.env;\n if (env.ALCHEMY_PLAIN === \"1\" || env.ALCHEMY_NO_TUI === \"1\")\n return true;\n if (env.ALCHEMY_TUI === \"1\")\n return false;\n if (!process.stdout.isTTY)\n return true;\n if (env.CI)\n return true;\n // Known coding-agent env vars. These are best-effort — the isTTY check\n // above already catches most cases since agents typically pipe stdout.\n if (env.CLAUDECODE ||\n env.CLAUDE_CODE_ENTRYPOINT ||\n env.CURSOR_AGENT ||\n env.AIDER_MODEL ||\n env.CODEX_CLI)\n return true;\n return false;\n};\n//# sourceMappingURL=interactive.js.map","import * as Clock from \"effect/Clock\";\nimport * as Console from \"effect/Console\";\nimport * as Data from \"effect/Data\";\nimport * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Option from \"effect/Option\";\nimport * as Path from \"effect/Path\";\nimport * as Schedule from \"effect/Schedule\";\nimport * as Semaphore from \"effect/Semaphore\";\nimport { rootDir } from \"./Profile.js\";\nconst semaphores = new Map();\n// Keep STALE well above REFRESH — a saturated machine can starve the\n// heartbeat fiber for seconds.\nconst STALE = Duration.seconds(30);\nconst REFRESH = Duration.seconds(10);\nconst RETRY_INTERVAL = Duration.millis(50);\nconst DEFAULT_TIMEOUT = Duration.minutes(2);\n// How often to remind the user that a lock wait / locked operation is still\n// outstanding. Long enough that healthy runs never print it.\nconst STALL_INTERVAL = Duration.seconds(30);\nclass LockHeld extends Data.TaggedError(\"LockHeld\") {\n}\nclass LockTimeout extends Data.TaggedError(\"LockTimeout\") {\n}\n/**\n * Make a lock key safe to use as a file name on every platform.\n *\n * Keys are derived from user-controlled values (profile names), which\n * have shown up in production containing shell placeholders like\n * `${ALCHEMY_PROFILE:-default}` — `:`/`{`/`$` are invalid in Windows\n * file names and mkdir fails with EINVAL. Collapse anything outside a\n * conservative allow-list to `_`.\n *\n * @internal exported for unit testing.\n */\nexport const sanitizeLockKey = (key) => key.replace(/[^A-Za-z0-9._-]/g, \"_\");\n/**\n * Take the cross-process lock. On success the ambient scope owns it: a\n * finalizer removes it and a forked heartbeat keeps its mtime fresh.\n */\nconst acquireFileLock = Effect.fn(function* (lockPath, timeout) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const ownerPath = path.join(lockPath, \"owner\");\n const owner = yield* Effect.sync(() => crypto.randomUUID());\n yield* fs.makeDirectory(path.dirname(lockPath), { recursive: true });\n // Reap a lock whose crashed holder stopped refreshing its mtime.\n const reapStale = Effect.gen(function* () {\n const info = yield* fs.stat(lockPath);\n const now = yield* Clock.currentTimeMillis;\n const isStale = Option.exists(info.mtime, (mtime) => mtime.getTime() < now - Duration.toMillis(STALE));\n if (isStale) {\n yield* fs.remove(lockPath, { recursive: true, force: true });\n }\n }).pipe(Effect.catchReason(\"PlatformError\", \"NotFound\", () => Effect.void));\n // A non-recursive mkdir is the atomic test-and-set; the owner marker lets\n // release and refresh verify the lock wasn't reaped and re-taken.\n yield* fs.makeDirectory(lockPath).pipe(Effect.andThen(fs\n .writeFileString(ownerPath, owner)\n .pipe(Effect.onError(() => fs\n .remove(lockPath, { recursive: true, force: true })\n .pipe(Effect.ignore)))), Effect.catchReason(\"PlatformError\", \"AlreadyExists\", () => reapStale.pipe(Effect.andThen(Effect.fail(new LockHeld())))), Effect.retry({\n while: (error) => error._tag === \"LockHeld\",\n schedule: Schedule.spaced(RETRY_INTERVAL).pipe(Schedule.upTo({ duration: timeout })),\n }), Effect.catchTag(\"LockHeld\", () => Effect.die(new LockTimeout({\n lockPath,\n timeout,\n message: `Timed out waiting for the alchemy auth lock '${lockPath}' — another alchemy ` +\n `process has held it for over ${Duration.toSeconds(timeout)}s. If no other ` +\n `alchemy process is running, delete the lock directory and retry.`,\n }))));\n yield* Effect.addFinalizer(() => fs.readFileString(ownerPath).pipe(Effect.filterOrFail((current) => current === owner), Effect.andThen(fs.remove(lockPath, { recursive: true, force: true })), Effect.ignore));\n yield* fs.readFileString(ownerPath).pipe(Effect.filterOrFail((current) => current === owner), Effect.andThen(Clock.currentTimeMillis.pipe(Effect.map((now) => new Date(now)))), \n // NB: utimes interprets a bare number as *seconds* since epoch.\n Effect.flatMap((now) => fs.utimes(lockPath, now, now)), Effect.repeat(Schedule.spaced(REFRESH)), Effect.catch(() => Effect.logWarning(`auth lock compromised (continuing): '${lockPath}' is no longer owned by this process`)), \n // Acquisition returns while this fiber refreshes until the lock scope ends.\n Effect.forkScoped);\n});\n/**\n * Periodic \"I am not dead, I am stuck here\" notice, forked for the lifetime\n * of a {@link withLock} call.\n *\n * Deliberately `Console.error` rather than `Effect.logWarning`: the CLI's\n * telemetry layer replaces the console logger with the OTLP one (see\n * `Telemetry/Layer.ts`), so log records reach `.alchemy/log/out` but never\n * the terminal. The whole point of this notice is to reach the user who is\n * watching a frozen terminal, so it must not go through the logger.\n */\nconst stallNotice = (lockPath, label, phase, interval) => Effect.suspend(() => {\n let seconds = 0;\n return Effect.suspend(() => {\n seconds += Duration.toSeconds(interval);\n return Console.error(phase.current === \"waiting\"\n ? `alchemy: ${seconds}s waiting for the auth lock '${lockPath}' (${label}). ` +\n `Another alchemy process holds it; if none is running, delete that directory.`\n : `alchemy: ${label} has been running for ${seconds}s while holding the auth lock ` +\n `'${lockPath}'. Re-run with --log-level debug for detail.`);\n }).pipe(Effect.delay(interval), Effect.repeat(Schedule.spaced(interval)));\n});\n/**\n * Serialise execution of `effect` for the same `key`, both within this\n * process (a semaphore) and across processes on the same machine (an atomic\n * lock directory whose mtime is refreshed while held so another process can\n * recover it after a crash).\n *\n * Failure to create or acquire the lock is fatal. Authentication writes its\n * profile state beneath the same root, so continuing without a writable lock\n * cannot produce a valid deployment and would permit concurrent corruption.\n */\nexport const withLock = (key, effect, options) => {\n const safeKey = sanitizeLockKey(key);\n const label = options?.label ?? key;\n let semaphore = semaphores.get(safeKey);\n if (semaphore === undefined) {\n semaphore = Semaphore.makeUnsafe(1);\n semaphores.set(safeKey, semaphore);\n }\n return semaphore.withPermit(Effect.gen(function* () {\n const path = yield* Path.Path;\n // Read `rootDir` here, not at module eval, so the\n // `Profile -> AuthProvider -> Lock -> Profile` import cycle never\n // sees it uninitialised.\n const lockPath = path.join(rootDir, \"lock\", `${safeKey}.lock`);\n const phase = { current: \"waiting\" };\n if (options?.watchdog !== false) {\n yield* Effect.forkScoped(stallNotice(lockPath, label, phase, options?.stallInterval ?? STALL_INTERVAL));\n }\n yield* Effect.logDebug(`auth lock: acquiring '${lockPath}' for ${label}`);\n yield* acquireFileLock(lockPath, options?.timeout ?? DEFAULT_TIMEOUT).pipe(Effect.orDie);\n phase.current = \"held\";\n yield* Effect.logDebug(`auth lock: acquired '${lockPath}' for ${label}`);\n return yield* effect.pipe(Effect.onExit(() => Effect.logDebug(`auth lock: releasing '${lockPath}' for ${label}`)));\n }).pipe(Effect.scoped));\n};\n//# sourceMappingURL=Lock.js.map","import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Schema from \"effect/Schema\";\nimport * as Semaphore from \"effect/Semaphore\";\nimport { withLock } from \"./Lock.js\";\n/**\n * Canonical web host for OAuth provider-agnostic landing pages\n * (`/auth/success`, `/auth/error`). The CLI's loopback server 302s the\n * browser to one of these after handling the OAuth callback. Centralized\n * here so the redirect target lives in exactly one place across all\n * provider OAuth clients.\n */\nexport const AUTH_LANDING_HOST = \"https://alchemy.run\";\nexport const AUTH_SUCCESS_URL = `${AUTH_LANDING_HOST}/auth/success`;\nexport const AUTH_ERROR_URL = `${AUTH_LANDING_HOST}/auth/error`;\n/**\n * Methods on an {@link AuthProviderImpl} that mutate (or could trigger\n * mutation of) on-disk credentials. The factory wraps these in a\n * cross-process file lock keyed by `(profileName, providerName)` so that\n * concurrent processes never refresh / write credentials simultaneously.\n *\n * `prettyPrint` is intentionally excluded: it's read-only display.\n */\nconst LOCKED_METHODS = new Set([\"read\", \"login\", \"logout\", \"configure\"]);\n/**\n * Methods that may drive an interactive flow (prompts, browser-based\n * OAuth, etc.). A process-wide mutex serializes these across providers\n * so that, e.g., Cloudflare's `configure` finishes its prompt sequence\n * before Planetscale's begins — even when the two auth provider Layers\n * are built in parallel as part of a single `providers()` Layer.\n *\n * The clack prompt wrapper in `Util/Clank.ts` enforces per-prompt\n * serialization; this mutex enforces per-flow serialization so the user\n * sees one provider's prompts grouped together rather than interleaved.\n */\nconst INTERACTIVE_METHODS = new Set([\"login\", \"configure\"]);\nconst interactiveMutex = Semaphore.makeUnsafe(1);\nexport class AuthError extends Schema.TaggedError()(\"AuthError\", {\n message: Schema.String,\n cause: Schema.optional(Schema.Defect()),\n}) {\n}\nexport class AuthProviders extends Context.Service()(\"AuthProviders\") {\n}\nexport const AuthProvider = () => (name, impl) => Effect.gen(function* () {\n const ctx = yield* Effect.context();\n const providers = yield* AuthProviders;\n const service = yield* Effect.isEffect(impl)\n ? impl\n : Effect.succeed(impl);\n return yield* Effect.sync(() => (providers[name] = {\n kind: \"AuthProvider\",\n name,\n ...Object.fromEntries(Object.entries(service).map(([methodName, fn]) => [\n methodName,\n (...args) => {\n let eff = fn(...args).pipe(Effect.provideContext(ctx));\n if (LOCKED_METHODS.has(methodName)) {\n // First positional arg is always `profileName`.\n const profileName = args[0];\n eff = withLock(`${profileName}-${name}`, eff, {\n label: `${name}.${methodName} (profile '${profileName}')`,\n // `login`/`configure` legitimately block on the user\n // (browser OAuth, `aws sso login`), and a periodic\n // notice would trample the prompt they are answering.\n watchdog: !INTERACTIVE_METHODS.has(methodName),\n });\n }\n if (INTERACTIVE_METHODS.has(methodName)) {\n eff = Semaphore.withPermits(interactiveMutex, 1)(eff);\n }\n return eff;\n },\n ])),\n }));\n});\n/**\n * Build a Layer that registers an AuthProvider into the {@link AuthProviders}\n * registry when its parent layer is built. Use this from a provider's\n * top-level `providers()` Layer so that `alchemy login` can discover the\n * provider via the registry without forcing credential resolution.\n */\nexport const AuthProviderLayer = () => (name, impl) => Layer.effectDiscard(AuthProvider()(name, impl));\n/**\n * Look up a registered {@link AuthProvider} by name. Fails with\n * {@link AuthError} if the provider hasn't been registered (typically because\n * its layer hasn't been built).\n */\nexport const getAuthProvider = (name) => AuthProviders.use((registry) => registry[name] == null\n ? Effect.fail(new AuthError({\n message: `AuthProvider '${name}' is not registered. Make sure its layer has been provided.`,\n }))\n : Effect.succeed(registry[name]));\n//# sourceMappingURL=AuthProvider.js.map","import * as Config from \"effect/Config\";\nimport * as ConfigProvider from \"effect/ConfigProvider\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport os from \"node:os\";\nimport path from \"pathe\";\nimport { isNonInteractive } from \"../Util/interactive.js\";\nimport { AuthError } from \"./AuthProvider.js\";\nexport const rootDir = path.join(os.homedir(), \".alchemy\");\nexport const configFilePath = path.join(rootDir, \"profiles.json\");\n/**\n * Config key consulted by the various `fromAuthProvider` /\n * `fromEnvironment` layers to pick which named profile in\n * `~/.alchemy/profiles.json` to use. Defaults to `\"default\"`.\n */\nexport const ALCHEMY_PROFILE = Config.string(\"ALCHEMY_PROFILE\").pipe(Config.withDefault(\"default\"));\nexport const CONFIG_VERSION = 0;\nexport class AlchemyConfig extends Context.Service()(\"Alchemy::Profiles\") {\n}\nconst emptyConfig = () => ({\n version: CONFIG_VERSION,\n profiles: {},\n});\nexport class AlchemyProfile extends Context.Service()(\"Alchemy::Profile\") {\n}\n/**\n * Layer that builds the {@link AlchemyProfile} service. Captures the\n * {@link FileSystem.FileSystem} dependency at layer-build time, so any\n * Effect that yields {@link AlchemyProfile} ends up with `R = Profile` (no\n * `FileSystem` leak). Provide this once at the top of your runtime\n * (alongside `PlatformServices` / `NodeContext`).\n */\nexport const ProfileLive = Layer.effect(AlchemyProfile, Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const readConfig = fs\n .readFileString(configFilePath)\n .pipe(Effect.flatMap((data) => Effect.try({\n try: () => {\n const parsed = JSON.parse(data);\n if (parsed?.version !== CONFIG_VERSION) {\n // TODO(sam): this is destructive, should we maintain a chain of migrations from 0 to current?\n return emptyConfig();\n }\n return parsed;\n },\n catch: emptyConfig,\n })), Effect.orElseSucceed(emptyConfig));\n const writeConfig = (config) => fs\n .makeDirectory(path.dirname(configFilePath), { recursive: true })\n .pipe(Effect.flatMap(() => fs.writeFileString(configFilePath, JSON.stringify(config, null, 2))));\n const getProfile = (name) => readConfig.pipe(Effect.map((config) => config.profiles[name]));\n const setProfile = (name, profile) => readConfig.pipe(Effect.tap((config) => Effect.sync(() => (config.profiles[name] = profile))), Effect.flatMap(writeConfig));\n const deleteProfile = (name) => readConfig.pipe(Effect.flatMap((config) => {\n if (!(name in config.profiles)) {\n return Effect.succeed(false);\n }\n delete config.profiles[name];\n return writeConfig(config).pipe(Effect.as(true));\n }));\n const loadOrConfigure = (auth, profileName, ctx) => Effect.flatMap(getProfile(profileName), (existing) => {\n const stored = existing?.[auth.name];\n if (stored) {\n return Effect.succeed(stored);\n }\n // No credentials are configured for this provider+profile. Driving\n // `auth.configure` requires an interactive terminal (clack prompts,\n // browser-based OAuth, ...). In a non-interactive, non-CI context\n // (e.g. a `vitest` run or piped stdout) there is no TTY to drive\n // those prompts, so bail *before* calling `auth.configure`.\n //\n // This matters beyond just avoiding a hang: `configure` is a locked\n // method, so entering it acquires a cross-process auth lockfile. We\n // must avoid creating that lock when we can't actually configure —\n // for OAuth providers a refresh token is typically single-use, so a\n // stray lock left by a doomed configure can wedge concurrent refreshes.\n if (!ctx.ci && isNonInteractive()) {\n return Effect.fail(new AuthError({\n message: `No credentials configured for '${auth.name}' in profile '${profileName}', ` +\n `and this process is non-interactive so it can't be configured interactively. ` +\n `Run \\`alchemy login --profile ${profileName}\\` to configure it, ` +\n `or set CI=1 to use environment-variable credentials.`,\n }));\n }\n return Effect.tap(auth.configure(profileName, ctx), (config) => setProfile(profileName, { ...existing, [auth.name]: config }));\n });\n return {\n readConfig,\n writeConfig,\n getProfile,\n setProfile,\n deleteProfile,\n loadOrConfigure,\n };\n}));\n/**\n * Returns a `ConfigProvider` that overrides `ALCHEMY_PROFILE` with the\n * given `profile` (when explicitly passed via the CLI `--profile` flag),\n * falling through to `base` for everything else.\n *\n * Use this to let the CLI's `--profile <name>` win over `$ALCHEMY_PROFILE`\n * without disturbing other config lookups.\n */\nexport const withProfileOverride = (base, profile) => {\n if (profile === undefined)\n return base;\n const overrides = { ALCHEMY_PROFILE: profile };\n const overrideProvider = ConfigProvider.make((path) => Effect.succeed(path.length === 1 && typeof path[0] === \"string\" && path[0] in overrides\n ? ConfigProvider.makeValue(overrides[path[0]])\n : undefined));\n return ConfigProvider.orElse(base)(overrideProvider);\n};\n//# sourceMappingURL=Profile.js.map","import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Redacted from \"effect/Redacted\";\nimport path from \"pathe\";\nimport { rootDir } from \"./Profile.js\";\nconst credentialsDirPath = path.join(rootDir, \"credentials\");\nexport const profileCredentialsDirPath = (profile) => path.join(credentialsDirPath, profile);\nexport const credentialsFilePath = (profile, provider) => path.join(profileCredentialsDirPath(profile), `${provider}.json`);\nexport class CredentialsStore extends Context.Service()(\"Alchemy::CredentialsStore\") {\n}\nexport const CredentialsStoreLive = Layer.effect(CredentialsStore, Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const read = (profile, provider) => fs.readFileString(credentialsFilePath(profile, provider)).pipe(Effect.catch(() => Effect.succeed(undefined)), Effect.map((data) => {\n if (data === undefined)\n return undefined;\n try {\n return JSON.parse(data);\n }\n catch {\n return undefined;\n }\n }));\n const write = (profile, provider, credentials) => {\n const filePath = credentialsFilePath(profile, provider);\n return fs.makeDirectory(path.dirname(filePath), { recursive: true }).pipe(Effect.flatMap(() => {\n return fs.writeFileString(filePath, JSON.stringify(credentials, null, 2));\n }));\n };\n const remove_ = (profile, provider) => fs\n .remove(credentialsFilePath(profile, provider))\n .pipe(Effect.catch(() => Effect.void));\n const deleteProfile = (profile) => fs\n .remove(profileCredentialsDirPath(profile), { recursive: true })\n .pipe(Effect.catch(() => Effect.void));\n return {\n read,\n write,\n delete: remove_,\n deleteProfile,\n };\n}));\nexport function displayRedacted(r, visibleChars = 4) {\n const raw = Redacted.value(r);\n if (raw.length <= visibleChars)\n return \"****\";\n return `${raw.slice(0, visibleChars)}****`;\n}\n//# sourceMappingURL=Credentials.js.map","import * as Context from \"effect/Context\";\nimport * as Deferred from \"effect/Deferred\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\n/**\n * Per-resource in-memory artifacts shared across a single `Plan.make -> apply`\n * execution.\n *\n * The engine scopes this service by resource `FQN` before invoking lifecycle\n * handlers, so providers should treat it as a resource-local bag for expensive,\n * deterministic intermediate results that can be reused across phases.\n *\n * Expected usage:\n *\n * - `diff` computes an expensive artifact once and stores it\n * - `create` / `update` reads the same artifact and skips recomputing it\n * - artifacts are ephemeral and must never be required for correctness on a\n * later deploy because the bag is reset between runs\n *\n * Example:\n *\n * ```ts\n * const artifacts = yield* Artifacts;\n * const cached = yield* artifacts.get<PreparedBundle>(\"bundle\");\n * if (cached) return cached;\n *\n * const bundle = yield* prepareBundle();\n * yield* artifacts.set(\"bundle\", bundle);\n * return bundle;\n * ```\n */\nexport class Artifacts extends Context.Service()(\"Artifacts\") {\n}\nexport class ArtifactStore extends Context.Service()(\"Artifacts/Store\") {\n}\n/**\n * Create a fresh root store for one deploy/test run.\n */\nexport const createArtifactStore = () => new Map();\nconst getOrCreateBag = (store, fqn) => {\n const existing = store.get(fqn);\n if (existing) {\n return existing;\n }\n const bag = new Map();\n store.set(fqn, bag);\n return bag;\n};\nexport const makeScopedArtifacts = (store, fqn) => {\n const bag = getOrCreateBag(store, fqn);\n return {\n get: (key) => Effect.sync(() => bag.get(key)),\n set: (key, value) => Effect.sync(() => {\n bag.set(key, value);\n }),\n delete: (key) => Effect.sync(() => {\n bag.delete(key);\n }),\n };\n};\nexport const scopedArtifacts = (fqn) => Layer.effect(Artifacts, ArtifactStore.useSync((store) => makeScopedArtifacts(store, fqn)));\n/**\n * Run an effect with a fresh artifact root, replacing any existing store.\n * Use this at top-level entrypoints that intentionally define a new deploy run.\n */\nexport const provideFreshArtifactStore = (effect) => effect.pipe(Effect.provideServiceEffect(ArtifactStore, Effect.sync(createArtifactStore)));\n/**\n * Ensure an artifact root exists, reusing the ambient store when one is already\n * present. This lets nested helpers participate in the same run-scoped cache.\n */\nexport const ensureArtifactStore = (effect) => Effect.serviceOption(ArtifactStore).pipe(Effect.map(Option.getOrUndefined), Effect.flatMap((existing) => effect.pipe(Effect.provideService(ArtifactStore, existing ?? createArtifactStore()))));\nexport const cached = (id) => (eff) => Effect.gen(function* () {\n const artifacts = yield* Artifacts;\n const deferred = yield* Deferred.make();\n const cached = yield* artifacts.get(id);\n if (cached) {\n if (Effect.isEffect(cached)) {\n return yield* cached;\n }\n return cached;\n }\n yield* artifacts.set(id, Deferred.await(deferred));\n const result = yield* eff;\n yield* Deferred.succeed(deferred, result);\n yield* artifacts.set(id, result);\n return result;\n});\n//# sourceMappingURL=Artifacts.js.map","import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nexport class Cli extends Context.Service()(\"CLI\") {\n}\n//# sourceMappingURL=Cli.js.map","import * as Output from \"./Output.js\";\n// special runtime-only symbol for probing the Ref proxy for its metadata\nconst RefMetadata = Symbol.for(\"alchemy/RefMetadata\");\nexport const isRef = (s) => s && s[RefMetadata] !== undefined;\nexport const getRefMetadata = (ref) => ref[RefMetadata];\nexport const ref = (id, { stack, stage, } = {}, type) => {\n const ref = new Proxy({}, {\n get: (_, prop) => {\n if (prop === RefMetadata) {\n return {\n stack,\n stage,\n id,\n type,\n };\n }\n return Output.of(ref)[prop];\n },\n });\n return ref;\n};\n//# sourceMappingURL=Ref.js.map","import * as Context from \"effect/Context\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\n/**\n * AdoptPolicy controls whether the engine should \"adopt\" pre-existing cloud\n * resources that conflict with this stack instead of failing.\n *\n * The engine always calls a provider's `read` lifecycle operation when there\n * is no prior state and `read` is implemented. The provider's job is to\n * report two things:\n *\n * 1. Whether the resource exists (returns attributes vs. `undefined`).\n * 2. Whether *we* own it (plain attributes vs. {@link Unowned}-branded).\n *\n * The engine then routes:\n *\n * | `read` outcome | `adopt: false` | `adopt: true` |\n * | ------------------- | -------------- | ----------------- |\n * | undefined | create | create |\n * | owned (plain attrs) | silent adopt | silent adopt |\n * | {@link Unowned} | fail | takeover (adopt) |\n *\n * \"Owned\" means a provider has affirmatively determined the resource was\n * created by this stack/stage/logical-id (typically by inspecting tags or\n * naming conventions). Resources without ownership semantics simply always\n * return plain attrs — they are treated as owned by default, so silent\n * adoption is the norm and `--adopt` is unnecessary.\n *\n * The policy can be overridden per-effect via {@link adopt} — most commonly\n * applied at the resource or stack scope.\n */\nexport class AdoptPolicy extends Context.Service()(\"AdoptPolicy\") {\n}\n/**\n * Engine-raised failure produced when `read` reports an existing resource\n * marked as {@link Unowned} and `adopt` is `false`. Surface this to the user\n * to indicate they should either re-tag the cloud resource, pick a different\n * physical name, or re-run with `--adopt` (or `adopt(true)`) to force a\n * takeover.\n */\nexport class OwnedBySomeoneElse extends Data.TaggedError(\"OwnedBySomeoneElse\") {\n}\n/**\n * Private symbol used to brand attribute objects returned by `read` as\n * \"exists in cloud, but not owned by this stack/stage/logical-id\".\n *\n * Deliberately *not* registered via `Symbol.for` — the brand is an\n * engine-internal routing hint and must not be observable or\n * forgeable from outside this module. The engine strips it before any\n * state persistence (see {@link stripUnowned}) so it never leaks into\n * the state store, JSON serialization, or downstream `Output`s.\n */\nconst UnownedTag = Symbol(\"alchemy/Unowned\");\n/**\n * Brand a `read` return value as belonging to a different owner.\n *\n * Use this in a provider's `read` implementation when the resource exists in\n * the cloud but a positive ownership check (e.g. tag inspection) shows it\n * was *not* created by this stack/stage/logical-id:\n *\n * ```ts\n * read: Effect.fn(function* ({ id, output, olds }) {\n * const settings = yield* getScriptSettings({ ... }).pipe(\n * Effect.catchTag(\"WorkerNotFound\", () => Effect.succeed(undefined)),\n * );\n * if (!settings) return undefined;\n *\n * const attrs = { workerName, ...buildAttrs(settings) };\n * return hasAlchemyWorkerTags(id, settings.tags) ? attrs : Unowned(attrs);\n * }),\n * ```\n *\n * The returned value is structurally still `T` — there is no wrapper to\n * unwrap. The brand is a non-enumerable symbol that the engine inspects\n * during planning to decide whether to take over (`adopt: true`) or fail\n * loudly (`adopt: false`).\n *\n * Resources without ownership semantics should simply return plain attrs —\n * the engine treats them as owned and silent adoption is the default.\n */\nexport const Unowned = Object.assign((attrs) => {\n const cloned = { ...attrs };\n Object.defineProperty(cloned, UnownedTag, {\n value: true,\n enumerable: false,\n writable: false,\n configurable: false,\n });\n return cloned;\n}, {\n is: (value) => typeof value === \"object\" &&\n value !== null &&\n value[UnownedTag] === true,\n});\n/**\n * Strip the {@link Unowned} brand from an attributes object before persisting\n * it — state should not carry per-deploy ownership-routing metadata.\n *\n * The brand is intentionally non-enumerable, so a plain spread already\n * drops it; the additional `delete` is defense-in-depth in case a future\n * change makes the descriptor enumerable. Always returns a fresh object\n * (never mutates the input).\n */\nexport const stripUnowned = (attrs) => {\n const out = { ...attrs };\n if (UnownedTag in out)\n delete out[UnownedTag];\n return out;\n};\nexport const adopt = ((enabled = true) => (eff) => eff.pipe(typeof enabled === \"boolean\"\n ? Effect.provideService(AdoptPolicy, enabled ?? true)\n : Effect.provideServiceEffect(AdoptPolicy, enabled)));\n//# sourceMappingURL=AdoptPolicy.js.map","/**\n * Separator used in FQN strings.\n */\nexport const FQN_SEPARATOR = \"/\";\n/**\n * Encode an FQN for safe filesystem storage.\n * Replaces `/` (FQN separator) with `__` to avoid subdirectory creation.\n */\nexport const encodeFqn = (fqn) => fqn.replaceAll(FQN_SEPARATOR, \"__\");\n/**\n * Decode a filename back to FQN.\n */\nexport const decodeFqn = (filename) => filename.replaceAll(\"__\", FQN_SEPARATOR);\n/**\n * Convert a NamespaceNode chain to an array of namespace IDs, from root to leaf.\n *\n * @example\n * ```ts\n * const ns = { Id: \"Child\", Parent: { Id: \"Parent\", Parent: { Id: \"Root\" } } };\n * toPath(ns); // [\"Root\", \"Parent\", \"Child\"]\n * ```\n */\nexport const toPath = (ns) => {\n if (!ns)\n return [];\n const path = [];\n let current = ns;\n while (current) {\n path.unshift(current.Id);\n current = current.Parent;\n }\n return path;\n};\n/**\n * Create a fully-qualified name (FQN) from a namespace and logical ID.\n * The FQN is a flat key suitable for state storage.\n *\n * @example\n * ```ts\n * const ns = { Id: \"Child\", Parent: { Id: \"Parent\" } };\n * toFqn(ns, \"MyResource\"); // \"Parent/Child/MyResource\"\n * toFqn(undefined, \"MyResource\"); // \"MyResource\"\n * ```\n */\nexport const toFqn = (ns, logicalId) => {\n const path = toPath(ns);\n path.push(logicalId);\n return path.join(FQN_SEPARATOR);\n};\n/**\n * Parse an FQN back into namespace path segments and the logical ID.\n *\n * @example\n * ```ts\n * parseFqn(\"Parent/Child/MyResource\"); // { path: [\"Parent\", \"Child\"], logicalId: \"MyResource\" }\n * parseFqn(\"MyResource\"); // { path: [], logicalId: \"MyResource\" }\n * ```\n */\nexport const parseFqn = (fqn) => {\n const parts = fqn.split(FQN_SEPARATOR);\n const logicalId = parts.pop();\n return { path: parts, logicalId };\n};\n/**\n * Reconstruct a NamespaceNode chain from a path array.\n *\n * @example\n * ```ts\n * fromPath([\"Parent\", \"Child\"]);\n * // { Id: \"Child\", Parent: { Id: \"Parent\" } }\n * ```\n */\nexport const fromPath = (path) => {\n if (path.length === 0)\n return undefined;\n let node;\n for (const id of path) {\n node = { Id: id, Parent: node };\n }\n return node;\n};\n//# sourceMappingURL=FQN.js.map","import * as Context from \"effect/Context\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport * as Option from \"effect/Option\";\nimport { AlchemyContext } from \"./AlchemyContext.js\";\n/**\n * ProviderModePolicy opts resources OUT of local emulation: when `true`,\n * resources registered while it is in context resolve the **live**\n * provider even during `alchemy dev`.\n *\n * Apply it with the {@link remote} combinator. During `alchemy deploy`\n * everything is live anyway, so the policy only has an effect in dev.\n *\n * Tri-state `Context.Reference`: `undefined` (the default — no explicit\n * decoration, inherit/run default), `true` (`remote()`), `false`\n * (`remote(false)` — explicitly follow the run default again). The unset vs\n * explicit distinction is load-bearing for conflict detection at\n * registration (see `Resource.ts`).\n */\nexport const ProviderModePolicy = Context.Reference(\"ProviderModePolicy\", { defaultValue: () => undefined });\n/**\n * The same resource (identified by FQN) was registered (`yield*`ed) from two\n * places whose ambient {@link ProviderModePolicy} disagree — e.g. once inside\n * `remote()` and once without it. Context-based decoration cannot decide which\n * one wins, so the engine fails loudly instead of silently picking one.\n *\n * Fix: register the resource once and close over the returned value, or make\n * both registration sites agree.\n */\nexport class ConflictingProviderModeError extends Data.TaggedError(\"ConflictingProviderModeError\") {\n}\n/**\n * Prefix marking a locally-emulated resource's physical identity. Local\n * providers fabricate ids/names with this prefix (`dev:<uuid>` queue and\n * namespace ids, `dev:`-prefixed bucket names, ...) so a resource's\n * persisted attributes reveal which runtime hosts it even without the\n * `providerMode` stamp.\n */\nexport const LOCAL_ID_PREFIX = \"dev:\";\n/**\n * Does a persisted attributes value carry a local identity marker — any\n * string value (at any depth) with the {@link LOCAL_ID_PREFIX}? Persisted\n * attrs are plain JSON (state commits strip unresolved values), so a\n * structural scan is safe.\n */\nexport const hasLocalIdentity = (value) => {\n if (typeof value === \"string\")\n return value.startsWith(LOCAL_ID_PREFIX);\n if (Array.isArray(value))\n return value.some(hasLocalIdentity);\n if (typeof value === \"object\" && value !== null) {\n return Object.values(value).some(hasLocalIdentity);\n }\n return false;\n};\n/**\n * The mode a persisted state row was actually reconciled with: its stamped\n * `providerMode`, or — for legacy rows written before stamping existed —\n * `\"local\"` when the persisted attributes carry a {@link LOCAL_ID_PREFIX}\n * identity marker, `\"live\"` otherwise.\n *\n * An unstamped row without a marker predates provider modes or was written\n * by a mode-agnostic provider — in both cases the write acted on the REAL\n * cloud, so the row's physical resource is `\"live\"`. Assuming the current\n * run's mode instead silently adopts a deployed cloud resource as a local\n * instance during `alchemy dev`: the row noops (or restarts locally over\n * the live attrs), gets re-stamped `\"local\"`, and the live resource becomes\n * untracked — it is never deleted by a later destroy or replacement, and\n * its deployed URL keeps serving.\n *\n * An unstamped row WITH a marker (e.g. a queue with a `dev:<uuid>` id\n * written by `alchemy dev` on a pre-stamping version) is the mirror case:\n * assuming `\"live\"` hands the `dev:` identity to the live provider, which\n * sends it to the real cloud API (Cloudflare rejects it as a malformed\n * parameter, permanently wedging the destroy). The marker proves the row\n * was reconciled locally, so it is handled as `\"local\"`.\n *\n * For mode-agnostic providers the returned mode is harmless either way:\n * `providerForMode` ignores the mode when the provider has a single\n * implementation.\n */\nexport const stampedMode = (row) => row.providerMode ?? (hasLocalIdentity(row.attr) ? \"local\" : \"live\");\n/**\n * Run the wrapped resources **remotely (against the real cloud) even during\n * `alchemy dev`** — the opt-out from local emulation. During `alchemy deploy`\n * this is a no-op (everything is remote).\n *\n * Captured at registration time like `adopt()` / `retain()`, so it can be\n * applied to a single resource or a whole scope:\n *\n * ```ts\n * // This queue talks to real Cloudflare even in dev\n * const queue = yield* Queue(\"Jobs\", {}).pipe(Alchemy.remote());\n *\n * // Everything in this scope runs live in dev\n * yield* Effect.gen(function* () {\n * const queue = yield* Queue(\"Jobs\", {});\n * const consumer = yield* Consumer(\"JobsConsumer\", { queue });\n * }).pipe(Alchemy.remote());\n * ```\n *\n * `remote(false)` (or an `Effect<boolean>` resolving to false) removes the\n * pin — the resource follows the run default again.\n *\n * Providers with a single implementation are mode-agnostic and already run\n * live in dev; `remote()` on them is a no-op.\n */\nexport const remote = ((enabled = true) => (eff) => eff.pipe(typeof enabled === \"boolean\"\n ? Effect.provideService(ProviderModePolicy, enabled)\n : Effect.provideServiceEffect(ProviderModePolicy, enabled)));\n/**\n * Resolve the run-level default provider mode:\n *\n * 1. An ambient {@link ProviderModePolicy} of `true` (e.g. `remote()` wrapped\n * around a whole program) forces `\"live\"`.\n * 2. Otherwise `AlchemyContext.dev` decides: `dev: true` → `\"local\"`.\n * 3. Without an AlchemyContext (bare engine tests), default to `\"live\"`.\n */\nexport const defaultProviderMode = Effect.gen(function* () {\n if (yield* ProviderModePolicy)\n return \"live\";\n const ctx = yield* Effect.serviceOption(AlchemyContext);\n return Option.match(ctx, {\n onNone: () => \"live\",\n onSome: (c) => (c.dev ? \"local\" : \"live\"),\n });\n});\n//# sourceMappingURL=ProviderMode.js.map","import * as Context from \"effect/Context\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport { defaultProviderMode } from \"./ProviderMode.js\";\nexport const Provider = (type) => Context.Service()(type);\nconst withDefaultList = (service) => service.list ? service : { ...service, list: () => Effect.succeed([]) };\nexport const effect = (cls, eff) => Layer.effect(\n// @ts-expect-error\nProvider(cls.Type), Effect.map(eff, (service) => ({\n aliases: \"Aliases\" in cls ? cls.Aliases : undefined,\n ...withDefaultList(service),\n})));\nexport const succeed = (cls, service) => \n// @ts-expect-error\nLayer.succeed(Provider(cls.Type), {\n aliases: \"Aliases\" in cls ? cls.Aliases : undefined,\n ...withDefaultList(service),\n});\nexport const ProviderCollection = () => (id) => Context.Service()(id);\nexport const collection = (resources) => Effect.gen(function* () {\n const context = yield* Effect.context();\n const providers = Object.fromEntries(yield* Effect.all(resources.map((resource) => \"Provider\" in resource\n ? resource.Provider.pipe(Effect.map((provider) => [resource.Type, provider]))\n : Effect.succeed([\n resource.key,\n context.mapUnsafe.get(resource.key),\n ])), { concurrency: \"unbounded\" }));\n return {\n kind: \"ProviderCollection\",\n get: (service) => providers[service],\n providers,\n };\n});\nconst isProviderCollectionService = (value) => {\n return (typeof value === \"object\" &&\n value !== null &&\n \"kind\" in value &&\n value.kind === \"ProviderCollection\");\n};\n/**\n * Structural check for a {@link ProviderService} living in the Effect\n * context. Providers are keyed by their canonical resource type; when\n * searching for a legacy alias, the tag key won't match, so lookup has to\n * recognize provider services by shape.\n */\nconst isProviderService = (value) => typeof value === \"object\" &&\n value !== null &&\n \"reconcile\" in value &&\n typeof value.reconcile === \"function\" &&\n \"delete\" in value &&\n typeof value.delete === \"function\";\n/**\n * Resolve the concrete service for `mode` from a provider found in context.\n *\n * - `mode === undefined` → the service as registered (for dual\n * registrations that is the delegating service for the run's default\n * mode).\n * - `mode` given and the provider carries {@link ProviderService.modes} →\n * the (lazily built, memoized) variant for that mode.\n * - `mode` given but the provider is mode-agnostic → the service itself:\n * a single implementation satisfies every mode (hybrid), which is what\n * lets live-only resources (e.g. R2 buckets) participate in dev runs.\n */\nexport const providerForMode = (service, mode) => mode !== undefined && service.modes !== undefined\n ? service.modes[mode]\n : Effect.succeed(service);\n/**\n * Resolve where a resource's deploy-time binding clients should be routed:\n * its registration-captured {@link ResourceLike.Mode} (`Alchemy.remote()`\n * → `\"live\"`) or the run default (`alchemy dev` → `\"local\"`) — the same\n * resolution `Plan.make` applies to lifecycle operations — combined with\n * whether the provider registered a local data plane at all.\n */\nexport const describeDataPlane = (resource) => Effect.gen(function* () {\n const found = yield* tryFindProviderByType(resource.Type);\n if (Option.isNone(found))\n return { kind: \"unregistered\" };\n const provider = found.value;\n if (provider.modes === undefined)\n return { kind: \"agnostic\" };\n const mode = resource.Mode ?? (yield* defaultProviderMode);\n if (mode !== \"local\") {\n const layer = provider.liveDataPlane?.();\n return layer !== undefined\n ? { kind: \"live\", layer }\n : { kind: \"live\" };\n }\n if (provider.localDataPlane === undefined) {\n return { kind: \"undeclared\", providerType: resource.Type };\n }\n return { kind: \"local\", layer: provider.localDataPlane() };\n});\n/**\n * The data-plane override layer for a resource, or `undefined` when its\n * clients target the real cloud for any reason (see\n * {@link describeDataPlane} for which).\n */\nexport const resolveLocalDataPlane = (resource) => describeDataPlane(resource).pipe(Effect.map((plane) => (plane.kind === \"local\" ? plane.layer : undefined)));\nexport const findProviderByType = ((type, mode) => tryFindProviderByType(type, mode).pipe(Effect.flatMap(Option.match({\n onNone: () => Effect.die(`Provider not found for ${type}`),\n onSome: (provider) => Effect.succeed(provider),\n}))));\n/**\n * Typed provider lookup by resource class (or {@link Platform}) value. Infers\n * `R` from the class so `provider.list()` / `provider.read(...)` return the\n * resource's `Attributes` shape — prefer this over {@link findProviderByType},\n * which only takes the type string.\n */\nexport const findProvider = (resource, mode) => findProviderByType((resource.Type ?? resource.key), mode);\n/**\n * A persisted state row references a resource type with no registered\n * provider — the type was removed from the program (or renamed without an\n * alias) while its state row still exists (\"zombie\" row).\n *\n * This is FATAL at plan time: the program and state fundamentally disagree,\n * and without the provider the row's physical resource cannot be deleted\n * anyway, so proceeding would only strand it silently. The plan dies with\n * this error; nothing is deployed or destroyed until the provider is\n * re-registered (or aliased), or the state row is cleared manually.\n */\nexport class MissingProviderError extends Data.TaggedError(\"MissingProviderError\") {\n}\n/** Build the fatal plan-time error for a zombie state row. */\nexport const missingProviderError = (resourceType, fqn) => new MissingProviderError({\n message: `No provider is registered for resource type '${resourceType}' ` +\n `(state row '${fqn}'). The type was removed from the program or ` +\n \"renamed without an alias. Re-register the provider (or add the \" +\n \"old name to the resource's `aliases`) so this row can be \" +\n \"destroyed, or clear the state row manually if the physical \" +\n \"resource is already gone.\",\n resourceType,\n fqn,\n});\nexport const tryFindProviderByType = Effect.fn(function* (resourceType, mode) {\n // When a mode is requested, resolve the found service to that mode's\n // variant (building it lazily if needed) before returning.\n const found = yield* Effect.gen(function* () {\n const Tag = Provider(resourceType);\n const direct = yield* Effect.serviceOption(Tag);\n if (Option.isSome(direct)) {\n return direct;\n }\n const context = yield* Effect.context();\n for (const value of context.mapUnsafe.values()) {\n if (isProviderCollectionService(value)) {\n const provider = value.get(resourceType);\n if (provider) {\n return Option.some(provider);\n }\n }\n }\n // State persisted before a type rename carries the legacy name, so no\n // provider is keyed under it. Fall back to a provider that declares the\n // name in its `aliases` — scanning both bare Provider layers and the\n // members of every ProviderCollection.\n for (const value of context.mapUnsafe.values()) {\n if (isProviderCollectionService(value)) {\n for (const provider of Object.values(value.providers)) {\n if (provider.aliases?.includes(resourceType)) {\n return Option.some(provider);\n }\n }\n }\n else if (isProviderService(value) &&\n value.aliases?.includes(resourceType)) {\n return Option.some(value);\n }\n }\n return Option.none();\n });\n if (Option.isNone(found)) {\n return found;\n }\n return Option.some(yield* providerForMode(found.value, mode));\n});\n//# sourceMappingURL=Provider.js.map","import * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport * as Effectable from \"effect/Effectable\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport { AdoptPolicy } from \"./AdoptPolicy.js\";\nimport { toFqn } from \"./FQN.js\";\nimport { CurrentNamespace } from \"./Namespace.js\";\nimport * as Output from \"./Output.js\";\nimport { Provider } from \"./Provider.js\";\nimport { ConflictingProviderModeError, ProviderModePolicy, } from \"./ProviderMode.js\";\nimport { ref as makeRef } from \"./Ref.js\";\nimport { RemovalPolicy } from \"./RemovalPolicy.js\";\nimport { RenamePolicy } from \"./Rename.js\";\nimport { Self } from \"./Self.js\";\nimport { Stack } from \"./Stack.js\";\nexport const isResource = (value) => {\n // Require the full resource identity (Type AND FQN), not just `Type`:\n // user-authored prop objects legitimately carry a `Type` field (e.g.\n // Amazon States Language states like `{ Type: \"Pass\", End: true }` in a\n // Step Functions definition) and must not be mistaken for resources.\n // Locally-declared resources always expose both as own keys; refs\n // (`Resource.ref(...)`) deliberately report neither via `in` so they keep\n // routing through Output resolution.\n return (typeof value === \"object\" &&\n value !== null &&\n \"Type\" in value &&\n \"FQN\" in value);\n};\n/**\n * Does `value` reference an instance of the resource type `type` —\n * either a locally-declared resource or a `Resource.ref(...)` to one?\n *\n * Two constraints that ad-hoc guards get wrong for refs, which resolve\n * to Output-expression proxies:\n *\n * - Read `.Type` via property access (never `in`): the proxy answers\n * property reads with statically-known values but deliberately does\n * not report key existence (so {@link isResource} keeps routing refs\n * through Output resolution instead of the upstream-node lookup).\n * - Accept `typeof value === \"function\"`: the proxy's target is\n * callable (it needs an `apply` trap), so refs are not `\"object\"`.\n *\n * Either mistake silently rejects refs — in a Worker `env` that\n * degrades the binding to a plain JSON var.\n */\nexport const isResourceOfType = (value, type) => (typeof value === \"object\" || typeof value === \"function\") &&\n value !== null &&\n value.Type === type;\n/**\n * A tagged platform resource declared with neither props nor an inline\n * implementation was `yield*`ed, but its `.make(props, impl)` Layer never\n * built.\n *\n * Such a tag carries no configuration on its own — props AND impl both live\n * on the Layer — so its registration is a forward reference with `undefined`\n * props that the Layer's build repairs (in either order; see the #874\n * circular env-tag pattern). Props still `undefined` once the whole program\n * has evaluated means the Layer was never provided; `Plan.make` fails fast\n * with this error instead of letting the failure surface deep inside\n * whichever provider first reads a prop (e.g. `TypeError: undefined is not\n * an object (evaluating 'news.name')` in the Cloudflare Worker pre-create).\n */\nexport class MissingImplementationError extends Data.TaggedError(\"MissingImplementationError\") {\n}\nexport const missingImplementation = (type, id) => new MissingImplementationError({\n type,\n id,\n message: [\n `${type}<${id}> was yielded without its implementation.`,\n \"\",\n `\\`${id}\\` is declared as a bare tag — no props, no inline implementation — so both come from its \\`.make(...)\\` Layer:`,\n \"\",\n ` export class ${id} extends ${type}<${id}>()(\"${id}\") {}`,\n ` export const ${id}Live = ${id}.make({ /* props */ }, Effect.gen(function* () { /* ... */ }));`,\n \"\",\n `That Layer is not in scope where \\`${id}\\` is yielded. Provide it to the Stack's program:`,\n \"\",\n \" Alchemy.Stack(\",\n ` \"my-stack\",`,\n \" { providers, state },\",\n \" Effect.gen(function* () {\",\n ` const instance = yield* ${id};`,\n ` }).pipe(Effect.provide([${id}Live])),`,\n \" )\",\n \"\",\n `If \\`${id}\\` is not Effect-native, declare it with props instead: \\`()(\"${id}\", { /* props */ })\\`.`,\n ].join(\"\\n\"),\n});\n/**\n * Creates a resource constructor for a concrete resource type.\n *\n * The returned constructor registers the resource on the current stack,\n * resolves input props, exposes output attributes as `Output` expressions, and\n * records bindings contributed by policies and event sources. Resource\n * providers are attached separately through `.provider`.\n */\nexport function Resource(type, options) {\n const defaultRemovalPolicy = options?.defaultRemovalPolicy ?? \"destroy\";\n const self = Self(type);\n const constructor = (id, props) => Effect.gen(function* () {\n const stack = yield* Stack;\n const namespace = yield* CurrentNamespace;\n const fqn = toFqn(namespace, id);\n // `remote()` opts resources out of local emulation during dev. The\n // captured Mode is either \"live\" (pinned) or undefined (run default).\n // The Reference default is `undefined` — \"no explicit decoration\" —\n // which is distinct from an explicit `remote(false)`.\n const ambientPolicy = yield* ProviderModePolicy;\n const ambientMode = ambientPolicy\n ? \"live\"\n : undefined;\n const existing = stack.resources[fqn];\n if (existing) {\n // A resource may be `yield*`ed from several places (idempotent\n // registration). If a later site carries an *explicit* ambient\n // ProviderModePolicy that disagrees with what the resource was\n // registered with, the decorations are conflicting — fail loudly\n // instead of silently picking one. A later site with NO ambient\n // policy simply inherits the registered resource (the common\n // \"reference it from elsewhere\" pattern).\n if (ambientPolicy !== undefined && existing.Mode !== ambientMode) {\n return yield* Effect.die(new ConflictingProviderModeError({\n message: `Resource '${fqn}' was registered with provider mode ` +\n `'${existing.Mode ?? \"default\"}' but is now being registered ` +\n `with conflicting mode '${ambientMode ?? \"default\"}'. A ` +\n \"resource must resolve to a single provider mode: register \" +\n \"it once and close over the returned value, or make both \" +\n \"registration sites agree (e.g. wrap both in the same \" +\n \"`remote()` scope).\",\n fqn,\n existingMode: existing.Mode,\n conflictingMode: ambientMode,\n }));\n }\n // // TODO(sam): check if props are different and die\n return existing;\n }\n const bind = (...args) => typeof args[0] === \"string\"\n ? Effect.gen(function* () {\n const [sid, data] = args;\n (stack.bindings[fqn] ??= []).push({\n sid,\n data,\n });\n return undefined;\n })\n : (data) => {\n const stringifyBindArg = (arg) => {\n if (arg === undefined) {\n return undefined;\n }\n if (Array.isArray(arg)) {\n return arg\n .flatMap((item) => {\n const stringified = stringifyBindArg(item);\n return stringified === undefined ? [] : [stringified];\n })\n .join(\", \");\n }\n if (arg &&\n (typeof arg === \"object\" || typeof arg === \"function\")) {\n if (\"LogicalId\" in arg && typeof arg.LogicalId === \"string\") {\n return arg.LogicalId;\n }\n if (\"id\" in arg && typeof arg.id === \"string\") {\n return arg.id;\n }\n }\n return String(arg);\n };\n return bind(`${args[0]\n .flatMap((text, i) => {\n const stringified = stringifyBindArg(args[i + 1]);\n return stringified !== undefined\n ? [text, stringified]\n : [text];\n })\n .join(\"\")}`, data);\n };\n const target = {\n Type: type,\n Namespace: namespace,\n FQN: fqn,\n LogicalId: id,\n Props: props,\n Provider: ProviderTag,\n RemovalPolicy: yield* Effect.serviceOption(RemovalPolicy).pipe(Effect.map(Option.getOrElse(() => defaultRemovalPolicy))),\n Adopt: yield* Effect.serviceOption(AdoptPolicy).pipe(Effect.map(Option.getOrUndefined)),\n Mode: ambientMode,\n RequiresImplementation: options?.requiresImplementation || undefined,\n // Bare-string former ids resolve against the SAME namespace as the\n // resource's own id, so `renamedFrom(\"Site/Worker\")` declared at the\n // caller's level claims `<callerNs>/Site/Worker`; the `{ fqn }` form\n // is absolute (cross-namespace moves).\n FormerFqns: yield* Effect.serviceOption(RenamePolicy).pipe(Effect.map(Option.match({\n onNone: () => undefined,\n onSome: (formerIds) => formerIds.map((formerId) => typeof formerId === \"string\"\n ? toFqn(namespace, formerId)\n : formerId.fqn),\n }))),\n bind,\n toString() {\n return `Resource<${this.Type}>(${this.LogicalId})`;\n },\n [Symbol.toPrimitive](hint) {\n return hint === \"number\" ? NaN : this.toString();\n },\n };\n const Resource = (stack.resources[fqn] = new Proxy(target, {\n set: (t, prop, value) => {\n t[prop] = value;\n return true;\n },\n get: (t, prop) => typeof prop === \"symbol\" || prop in t\n ? t[prop]\n : new Output.PropExpr(Output.of(Resource), prop),\n }));\n Resource.Props = Effect.isEffect(props)\n ? // @effect-diagnostics-next-line anyUnknownInErrorContext:off\n yield* props.pipe(Effect.provide(Layer.mergeAll(Layer.succeed(Self, Resource), Layer.succeed(Self(type), Resource))))\n : props;\n return Resource;\n });\n const ProviderTag = Provider(type);\n const Service = {\n /**\n * Build a typed reference to a deployed instance of this resource\n * — in the current stack/stage by default, or in another via\n * `options`. Resolves to the same shape as `yield*\n * MyResource(\"id\", props)` so downstream code can read attributes\n * (`ref.someAttr`) exactly the way it would for a locally-declared\n * resource.\n */\n ref: (id, options) => Effect.succeed(Output.of(makeRef(id, options, type))),\n Type: type,\n Provider: ProviderTag,\n Self: self,\n Aliases: options?.aliases,\n };\n const ResourceClass = Object.assign((...args) => typeof args[0] === \"object\"\n ? Object.assign(ResourceClass, args[0])\n : constructor(...args), Service, \n // Make the constructor itself a real Effect: `yield* MyResource` resolves\n // to the constructor function (same as the old `asEffect()`), and\n // `Effect.isEffect(MyResource)` is now true so `Effect.all`/`forEach` work.\n Effectable.Prototype({\n label: `Resource<${type}>`,\n evaluate: () => Effect.succeed((id, props) => constructor(id, props)),\n }));\n return ResourceClass;\n}\n//# sourceMappingURL=Resource.js.map","import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport * as Redacted from \"effect/Redacted\";\n/**\n * Canonicalize a logical key into a key that is safe to use as the name of an\n * environment variable / binding (`[a-zA-Z][a-zA-Z0-9_]*`).\n *\n * `RuntimeContext.set`/`get` are dumb key/value stores: they read and write the\n * key **verbatim**. It is the *caller's* responsibility to hand them a\n * canonical key, since the caller is the one that knows the logical key may\n * contain `.`/`-` (e.g. a dotted config name from `Platform`, or an\n * `Output.toString()` like `\"QueueSinkQueue.queueUrl\"`). Callers run the key\n * through this before calling `set`/`get` so both sides agree.\n */\nexport const sanitizeKey = (key) => key.replaceAll(/[^a-zA-Z0-9]/g, \"_\");\n/**\n * Detect the (already JSON-parsed) {@link RedactedMarker} shape. After\n * `JSON.parse` the marker is a plain object — `Redacted.isRedacted` is\n * always `false` on it — so detection is structural.\n */\nexport const isRedactedMarker = (value) => typeof value === \"object\" &&\n value !== null &&\n value._tag === \"Redacted\" &&\n \"value\" in value;\n/**\n * Returns true when {@link unpackEnvValue}'s `JSON.parse` would reinterpret\n * the raw string as something other than itself — a number (`\"123\"`), a\n * boolean, `null`, or a JSON document. Such strings must stay\n * `JSON.stringify`-packed; everything else round-trips verbatim through the\n * parse-failure fallback.\n */\nconst parsesAsJson = (value) => {\n try {\n JSON.parse(value);\n return true;\n }\n catch {\n return false;\n }\n};\n/**\n * Serialize a binding value for an env var: `Redacted` values are packed as\n * a {@link RedactedMarker}, non-string values as JSON.\n *\n * A plain string is stored **verbatim** whenever `JSON.parse` would reject\n * it — which is almost every real-world string (names, URLs, ids). Packing\n * those too would put `\"my-queue\"` (quote characters included) on the wire,\n * where anything that consumes the raw binding without going through\n * {@link unpackEnvValue} — the Cloudflare dashboard, a hand-written env\n * read, a queue-name comparison against `MessageBatch.queue` — sees the\n * quoted form and mismatches (#1243). Only ambiguous strings (`\"123\"`,\n * `\"null\"`, JSON documents) keep the pack so the read side can't\n * reinterpret them.\n */\nexport const packEnvValue = (value) => Redacted.isRedacted(value)\n ? JSON.stringify({\n _tag: \"Redacted\",\n value: Redacted.value(value),\n })\n : typeof value === \"string\" && !parsesAsJson(value)\n ? value\n : JSON.stringify(value);\n/**\n * Like {@link packEnvValue}, but a `Redacted` input keeps its `Redacted`\n * wrapper on the *outside* of the packed string, so deploy-time code can\n * route secrets through a dedicated channel (Cloudflare `secret_text`,\n * Secrets Store) instead of leaking them as plain env vars. The inner\n * payload still carries the marker for the runtime `get` accessor.\n */\nexport const packEnvValueKeepRedacted = (value) => Redacted.isRedacted(value)\n ? Redacted.make(packEnvValue(value))\n : packEnvValue(value);\n/**\n * Parse an env-var string produced by {@link packEnvValue} back into its\n * value: rebuild `Redacted` from the marker, return other JSON values\n * as-is, and fall back to the raw string for non-JSON input (a verbatim\n * string from `packEnvValue`, or an env var the user set directly).\n * `undefined` passes through.\n *\n * Runtime `get` accessors MUST feed this from the raw environment\n * (`process.env[key]` / the platform env object) — never through\n * `Config.string`: the ambient runtime `ConfigProvider` reifies bound\n * values (unwrapping the marker before it could be detected here), and\n * during init the ambient provider is the interceptor installed in\n * `Platform.ts`, whose runtime branch calls back into `ctx.get(key)` —\n * resolving through `Config` would re-enter it for the same key and\n * recurse forever.\n */\nexport const unpackEnvValue = (raw) => {\n if (raw === undefined) {\n return undefined;\n }\n try {\n const parsed = JSON.parse(raw);\n if (isRedactedMarker(parsed)) {\n return Redacted.make(parsed.value);\n }\n return parsed;\n }\n catch {\n return raw; // assume it's just a string\n }\n};\n/**\n * Context of the runtime environment.\n *\n * E.g. the context of a running Worker, Task, Process, Function\n */\nexport class RuntimeContext extends Context.Service()(\"RuntimeContext\") {\n static phantom = Layer.empty;\n}\nexport const CurrentRuntimeContext = Effect.serviceOption(RuntimeContext).pipe(Effect.map(Option.getOrUndefined));\n//# sourceMappingURL=RuntimeContext.js.map","import * as Context from \"effect/Context\";\nexport class Stage extends Context.Service()(\"Stage\") {\n}\n//# sourceMappingURL=Stage.js.map","import * as Context from \"effect/Context\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nexport const isActionState = (s) => !!s && s.kind === \"action\";\nexport const isResourceState = (s) => !!s && s.kind !== \"task\";\nexport class StateStoreError extends Data.TaggedError(\"StateStoreError\") {\n}\nexport class State extends Context.Service()(\"alchemy/State\") {\n}\n//# sourceMappingURL=State.js.map","import * as Predicate from \"effect/Predicate\";\nimport * as EffectRecord from \"effect/Record\";\nimport * as Redacted from \"effect/Redacted\";\nexport const isPrimitive = (value) => value === undefined ||\n value === null ||\n typeof value === \"boolean\" ||\n typeof value === \"number\" ||\n typeof value === \"string\" ||\n typeof value === \"symbol\" ||\n typeof value === \"bigint\";\nexport const isPlainObject = (value) => {\n if (!Predicate.isObject(value))\n return false;\n return Object.getPrototypeOf(value) === Object.prototype;\n};\n/**\n * Is `value` plain data the engine's deep walkers may traverse — an array,\n * or an object whose prototype is `Object.prototype`/`null`?\n *\n * Everything else (class instances: effect's Effect/Layer/Context, Dates,\n * SDK config objects, functions, ...) is a LEAF for every deep walker in\n * the engine. The engine cannot meaningfully evaluate, diff, or persist\n * *through* a foreign class instance — rebuilding one entry-by-entry strips\n * its prototype — and walking one is not safe: effect ≥4.0.0-beta.103's\n * Context is self-referential (`cacheRoot` points back at itself), which\n * sent the naive walk-everything traversal into unbounded recursion\n * (#1082). Resources and Outputs are detected structurally *before* this\n * gate, so dependencies declared in plain props are unaffected.\n */\nexport const isPlainData = (value) => {\n if (Array.isArray(value))\n return true;\n if (typeof value !== \"object\" || value === null)\n return false;\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n};\n/**\n * Rebuild a plain-data value by mapping each child through `walk`,\n * preserving the shape (array → array, object → object).\n *\n * Cycle-guarded by ancestor path: a value that appears on its own ancestor\n * chain is a true cycle and becomes `undefined` (it could never serialize\n * or persist anyway). The guard is scoped to the current path — NOT a\n * visited-set — so a diamond (the same object legitimately referenced from\n * two places) is rebuilt in both places. Sync DFS only: add/delete around\n * the recursion is race-free. (#1082)\n */\nexport const mapPlainData = (value, ancestors, walk) => {\n if (ancestors.has(value))\n return undefined;\n ancestors.add(value);\n try {\n return Array.isArray(value)\n ? value.map(walk)\n : Object.fromEntries(Object.entries(value).map(([key, child]) => [key, walk(child)]));\n }\n finally {\n ancestors.delete(value);\n }\n};\nexport const stripFields = (value, empty) => {\n if (Array.isArray(value)) {\n return value.map((item) => stripFields(item, empty));\n }\n if (!isPlainObject(value))\n return value;\n return EffectRecord.map(EffectRecord.filter(value, (entry) => entry !== empty), (entry) => stripFields(entry, empty));\n};\nexport const stripNullFields = (value) => stripFields(value, null);\nexport const stripUndefinedFields = (value) => stripFields(value, undefined);\nexport const unwrapRedacted = (value) => {\n if (Redacted.isRedacted(value)) {\n return Redacted.value(value);\n }\n if (Array.isArray(value)) {\n return value.map(unwrapRedacted);\n }\n if (!isPlainObject(value))\n return value;\n return EffectRecord.map(value, unwrapRedacted);\n};\n//# sourceMappingURL=data.js.map","import * as Config from \"effect/Config\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport { pipe } from \"effect/Function\";\nimport { SingleShotGen } from \"effect/Utils\";\nimport { getRefMetadata, isRef } from \"./Ref.js\";\nimport { isResource } from \"./Resource.js\";\nimport { RuntimeContext, sanitizeKey } from \"./RuntimeContext.js\";\nimport { Stack } from \"./Stack.js\";\nimport { Stage } from \"./Stage.js\";\nimport * as State from \"./State/State.js\";\nimport { isPlainData, isPrimitive } from \"./Util/data.js\";\nconst inspect = Symbol.for(\"nodejs.util.inspect.custom\");\nexport const of = (resource) => {\n if (isRef(resource)) {\n const metadata = getRefMetadata(resource);\n return new RefExpr(metadata.stack, metadata.stage, metadata.id, \n // Surface the target's resource type and logical id as\n // statically-known properties so duck-typing classifiers (Worker\n // env bindings) and label/bind templates (`${resource.LogicalId}`,\n // `host.bind\\`...\\``) identify the ref exactly like a\n // locally-declared resource.\n {\n LogicalId: metadata.id,\n ...(metadata.type !== undefined ? { Type: metadata.type } : {}),\n });\n }\n return new ResourceExpr(resource);\n};\nexport const asOutput = (t) => isOutput(t)\n ? t\n : Effect.isEffect(t)\n ? new EffectExpr(VoidExpr, () => t)\n : new LiteralExpr(t);\n/**\n * Lift a plan-time Effect into an {@link Output}.\n *\n * The effect runs when the stack resolves the Output during plan/deploy —\n * with the stack's services (cloud credentials, region, ...) provided — and\n * never inside a deployed runtime: constructing the Output is inert, so\n * helpers built on `fromEffect` (e.g. AMI lookups) are safe to call from\n * composition code that is re-executed inside a Function/Worker/Instance\n * bundle.\n *\n * The effect must not fail (`E = never`) — die with a descriptive error for\n * unresolvable lookups.\n */\nexport const fromEffect = (effect) => new EffectExpr(VoidExpr, () => effect);\nexport const isOutput = (value) => value &&\n (typeof value === \"object\" || typeof value === \"function\") &&\n ExprSymbol in value;\nexport const ExprSymbol = Symbol.for(\"alchemy/Expr\");\nconst exprKind = (node) => node?.[ExprSymbol]?.kind ?? node?.kind;\nexport const isExpr = (value) => value &&\n (typeof value === \"object\" || typeof value === \"function\") &&\n ExprSymbol in value;\nexport class BaseExpr {\n // we use a kind tag instead of instanceof to protect ourselves from duplicate alchemy module imports\n constructor() { }\n as() {\n return this;\n }\n [Symbol.iterator]() {\n // @ts-expect-error - TODO(sam): fix this (works at runtime, but maybe indicates a bad assumption)\n return new SingleShotGen(this.asEffect());\n }\n asEffect() {\n return this.bind(this.toString());\n }\n bind(id) {\n // `set`/`get` store keys verbatim, so canonicalize here (the caller's job).\n const key = sanitizeKey(id);\n return RuntimeContext.pipe(Effect.flatMap((ctx) => Effect.map(ctx.set(key, this), (k) => ctx.get(k))));\n }\n pipe(...fns) {\n // @ts-expect-error\n return pipe(this, ...fns);\n }\n toString() {\n return this[inspect]();\n }\n}\nexport const isResourceExpr = (node) => exprKind(node) === \"ResourceExpr\";\nexport class ResourceExpr extends BaseExpr {\n src;\n stables;\n kind = \"ResourceExpr\";\n constructor(src, stables) {\n super();\n this.src = src;\n this.stables = stables;\n return proxy(this);\n }\n [inspect]() {\n return this.src.LogicalId;\n }\n}\nexport const isPropExpr = (node) => exprKind(node) === \"PropExpr\";\nexport class PropExpr extends BaseExpr {\n expr;\n identifier;\n kind = \"PropExpr\";\n constructor(expr, identifier) {\n super();\n this.expr = expr;\n this.identifier = identifier;\n return proxy(this);\n }\n [inspect]() {\n return `${this.expr[inspect]()}.${this.identifier.toString()}`;\n }\n}\nexport const literal = (value) => new LiteralExpr(value);\nexport const isLiteralExpr = (node) => exprKind(node) === \"LiteralExpr\";\nexport class LiteralExpr extends BaseExpr {\n value;\n kind = \"LiteralExpr\";\n constructor(value) {\n super();\n this.value = value;\n return proxy(this);\n }\n [inspect]() {\n return String(this.value);\n }\n}\nexport const VoidExpr = new LiteralExpr(void 0);\nexport const map = ((...args) => args.length === 1\n ? (output) => new ApplyExpr(output, args[0])\n : new ApplyExpr(args[0], args[1]));\n//Output.ApplyExpr<any, any, ResourceLike, any>\nexport const isApplyExpr = (node) => exprKind(node) === \"ApplyExpr\";\nexport class ApplyExpr extends BaseExpr {\n expr;\n f;\n kind = \"ApplyExpr\";\n constructor(expr, f) {\n super();\n this.expr = expr;\n this.f = f;\n return proxy(this);\n }\n [inspect]() {\n return `${this.expr[inspect]()}.map(${this.f.toString()})`;\n }\n}\nexport const mapEffect = (fn) => (output) => new EffectExpr(output, fn);\nexport const flatMap = ((...args) => args.length === 1\n ? (output) => new FlatMapExpr(output, args[0])\n : new FlatMapExpr(args[0], args[1]));\nexport const isFlatMapExpr = (node) => exprKind(node) === \"FlatMapExpr\";\nexport class FlatMapExpr extends BaseExpr {\n expr;\n f;\n kind = \"FlatMapExpr\";\n constructor(expr, f) {\n super();\n this.expr = expr;\n this.f = f;\n return proxy(this);\n }\n [inspect]() {\n return `${this.expr[inspect]()}.flatMap(${this.f.toString()})`;\n }\n}\nexport const isEffectExpr = (node) => exprKind(node) === \"EffectExpr\";\nexport class EffectExpr extends BaseExpr {\n expr;\n f;\n kind = \"EffectExpr\";\n constructor(expr, f) {\n super();\n this.expr = expr;\n this.f = f;\n return proxy(this);\n }\n [inspect]() {\n return `${this.expr[inspect]()}.mapEffect(${this.f.toString()})`;\n }\n}\nexport const isNamedExpr = (node) => exprKind(node) === \"NamedExpr\";\n/**\n * Wraps another `Expr` and overrides its `toString()` / inspect output.\n *\n * `BaseExpr` derives the binding id from `this.toString()`, so\n * wrapping an expression in `NamedExpr` makes that derived id stable and\n * caller-controlled (e.g. an env var name like `\"API_KEY\"`).\n */\nexport class NamedExpr extends BaseExpr {\n expr;\n bindingName;\n kind = \"NamedExpr\";\n constructor(expr, bindingName) {\n super();\n this.expr = expr;\n this.bindingName = bindingName;\n return proxy(this);\n }\n [inspect]() {\n return this.bindingName;\n }\n}\nexport const named = (expr, name) => new NamedExpr(expr, name);\nexport const all = (...outs) => new AllExpr(outs);\nexport const isAllExpr = (node) => exprKind(node) === \"AllExpr\";\nexport class AllExpr extends BaseExpr {\n outs;\n kind = \"AllExpr\";\n constructor(outs) {\n super();\n this.outs = outs;\n return proxy(this);\n }\n [inspect]() {\n return `all(${this.outs.map((out) => out[inspect]()).join(\", \")})`;\n }\n}\nexport const isRefExpr = (node) => exprKind(node) === \"RefExpr\";\nexport class RefExpr extends BaseExpr {\n stack;\n stage;\n resourceId;\n stables;\n kind = \"RefExpr\";\n constructor(stack, stage, resourceId, \n /**\n * Statically-known properties of the ref's target (currently its\n * resource `Type`), served as literals by the proxy instead of\n * `PropExpr`s — mirrors {@link ResourceExpr}'s `stables`.\n */\n stables) {\n super();\n this.stack = stack;\n this.stage = stage;\n this.resourceId = resourceId;\n this.stables = stables;\n return proxy(this);\n }\n [inspect]() {\n return `ref(${this.resourceId}, { stack: ${this.stack}, stage: ${this.stage} })`;\n }\n}\nexport const isStackRefExpr = (node) => exprKind(node) === \"StackRefExpr\";\n/**\n * A reference to the persisted output of a Stack at `(stack, stage)`.\n *\n * Resolved at evaluation time by reading `state.getOutput({ stack,\n * stage })`. Distinct from {@link RefExpr}, which references a\n * single resource's attributes within a stack/stage. `stage` may be\n * `undefined`, in which case it falls back to the current stage.\n */\nexport class StackRefExpr extends BaseExpr {\n stack;\n stage;\n kind = \"StackRefExpr\";\n constructor(stack, stage) {\n super();\n this.stack = stack;\n this.stage = stage;\n return proxy(this);\n }\n [inspect]() {\n return `stackRef(${this.stack}${this.stage ? `, { stage: ${this.stage} }` : \"\"})`;\n }\n}\n/**\n * Build an `Output<A>` referencing the persisted output of another\n * Stack. The returned Effect resolves to a lazy `Output<A>` whose\n * value is read from the state store at plan/apply time.\n *\n * Returns `Effect<Output<A>>` (not `Output<A>` directly) so that\n * `yield* Output.stackRef(...)` reads ergonomically inside an Effect\n * generator and lines up with `Resource.ref` and `Stack.stage.<name>`.\n */\nexport const stackRef = (stack, options = {}) => Effect.succeed(new StackRefExpr(stack, options.stage));\nexport const filter = (...outs) => outs.filter(isOutput);\nexport const interpolate = (template, ...args) => all(...args.map((arg) => (isOutput(arg) ? arg : literal(arg)))).pipe(map((args) => template\n .map((str, i) => str + (args[i] == null ? \"\" : String(args[i])))\n .join(\"\")));\nfunction proxy(self) {\n const target = Object.assign(() => { }, self);\n if (inspect in self) {\n Object.defineProperty(target, inspect, {\n value: self[inspect].bind(self),\n configurable: true,\n });\n }\n const proxy = new Proxy(target, {\n has: (_, prop) => prop === ExprSymbol || prop === inspect\n ? true\n : // Statically-known literal props (`Type`, `LogicalId` on\n // resource/ref exprs) are visible to `in` checks so duck-typing\n // code paths (e.g. `\"LogicalId\" in arg`) treat them like real\n // properties, matching what `get` serves.\n ((isResourceExpr(self) || isRefExpr(self)) &&\n self.stables !== undefined &&\n prop in self.stables) ||\n prop in self,\n get: (target, prop) => prop === Symbol.toPrimitive\n ? (hint) => {\n // Any JS-level coercion of an unresolved Output produces a\n // placeholder that *looks* like a real value but isn't:\n //\n // - `string` / `default` hints (`${output}`, `output + \"\"`,\n // `==` against a primitive) previously fell through to\n // `self.toString()` and returned the inspect form\n // (e.g. \"tunnel.tunnelId\"). The bogus string flowed\n // into resource props and into the cloud — only\n // surfacing as an opaque downstream error (see PR\n // description for a real Cloudflare DNS landing).\n //\n // - `number` hint (`+output`, `output * 2`,\n // `Math.max(0, output)`) previously returned NaN, which\n // propagates silently through arithmetic and lands as\n // \"the API rejected a NaN field\" much later.\n //\n // All three hints fail loud at the coercion site with a\n // pointer to the right composition API.\n throw new Error(`Cannot coerce Output<${self[inspect]()}> to a ` +\n `${hint === \"number\" ? \"number\" : \"string\"} via JS coercion. ` +\n `Use Output.interpolate\\`...\\` or Output.map(output, fn) ` +\n `to compose Outputs — the value isn't known until deploy time.`);\n }\n : prop === ExprSymbol\n ? self\n : prop === inspect\n ? target[inspect]\n : (isResourceExpr(self) || isRefExpr(self)) &&\n self.stables &&\n prop in self.stables\n ? self.stables[prop]\n : prop in self\n ? typeof self[prop] === \"function\" &&\n !(\"kind\" in self)\n ? new PropExpr(proxy, prop)\n : self[prop]\n : new PropExpr(proxy, prop),\n apply: (_, thisArg, args) => {\n if (isPropExpr(self)) {\n // Method-style combinators on an Output proxy. `map`/`apply` and\n // `mapEffect`/`effect` are aliases that mirror the standalone\n // `Output.map` / `Output.mapEffect` / `Output.flatMap` functions.\n if (self.identifier === \"map\" || self.identifier === \"apply\") {\n return new ApplyExpr(self.expr, args[0]);\n }\n else if (self.identifier === \"mapEffect\" ||\n self.identifier === \"effect\") {\n return new EffectExpr(self.expr, args[0]);\n }\n else if (self.identifier === \"flatMap\") {\n return new FlatMapExpr(self.expr, args[0]);\n }\n }\n return undefined;\n },\n });\n return proxy;\n}\n/// Evaluation\nexport class MissingSourceError extends Data.TaggedError(\"MissingSourceError\") {\n}\nexport class InvalidReferenceError extends Data.TaggedError(\"InvalidReferenceError\") {\n}\nexport const evaluate = (expr, upstream, ancestors = new Set()) => Effect.gen(function* () {\n if (isResource(expr)) {\n const srcId = expr.FQN;\n const src = upstream[srcId];\n if (!src) {\n // type-safety should prevent this but let the caller decide how to handle it\n return yield* new MissingSourceError({\n message: `Source ${srcId} not found`,\n srcId,\n });\n }\n return src;\n }\n else if (isOutput(expr)) {\n if (isResourceExpr(expr)) {\n const srcId = expr.src.FQN;\n const src = upstream[srcId];\n if (!src) {\n // type-safety should prevent this but let the caller decide how to handle it\n return yield* new MissingSourceError({\n message: `Source ${srcId} not found`,\n srcId,\n });\n }\n return src;\n }\n else if (isLiteralExpr(expr)) {\n return expr.value;\n }\n else if (isApplyExpr(expr)) {\n return expr.f(yield* evaluate(expr.expr, upstream));\n }\n else if (isEffectExpr(expr)) {\n // TODO(sam): the same effect shoudl be memoized so that it's not run multiple times\n return yield* expr.f(yield* evaluate(expr.expr, upstream));\n }\n else if (isFlatMapExpr(expr)) {\n // Resolve the source, hand it to `f` to produce a new Output, then\n // recursively evaluate that Output (flattening one level).\n const value = yield* evaluate(expr.expr, upstream);\n return yield* evaluate(expr.f(value), upstream);\n }\n else if (isAllExpr(expr)) {\n return yield* Effect.all(expr.outs.map((out) => evaluate(out, upstream)));\n }\n else if (isPropExpr(expr)) {\n return (yield* evaluate(expr.expr, upstream))?.[expr.identifier];\n }\n else if (isNamedExpr(expr)) {\n return yield* evaluate(expr.expr, upstream);\n }\n else if (isRefExpr(expr)) {\n const state = yield* yield* State.State;\n const stack = expr.stack ?? (yield* Stack).name;\n const stage = expr.stage ?? (yield* Stage);\n const resource = yield* state.get({\n stack,\n stage,\n fqn: expr.resourceId,\n });\n if (!resource) {\n return yield* Effect.fail(new InvalidReferenceError({\n message: `Reference to '${expr.resourceId}' in stack '${stack}' and stage '${stage}' not found. Have you deployed '${stage}' or '${stack}'?`,\n stack,\n stage,\n resourceId: expr.resourceId,\n }));\n }\n // RefExpr targets persisted resources; tasks aren't cross-stack\n // referenceable. Return the resource's output attrs, otherwise the\n // task's output value, otherwise undefined.\n return resource.attr ?? resource.output;\n }\n else if (isStackRefExpr(expr)) {\n const state = yield* yield* State.State;\n const stack = expr.stack;\n const stage = expr.stage ?? (yield* Stage);\n const output = yield* state.getOutput({ stack, stage });\n if (output == null) {\n return yield* Effect.fail(new InvalidReferenceError({\n message: `Reference to stack '${stack}' at stage '${stage}' not found. Have you deployed stage '${stage}' of '${stack}'?`,\n stack,\n stage,\n resourceId: stack,\n }));\n }\n return output;\n }\n }\n if (Config.isConfig(expr)) {\n // Resolve Config against the deploy environment — see resolveInput in\n // Plan.ts for rationale. `Config.redacted` resolves to a `Redacted`,\n // which stays opaque via the leaf fallthrough below.\n return yield* evaluate(yield* expr, upstream, ancestors);\n }\n else if (isPlainData(expr)) {\n if (ancestors.has(expr)) {\n return undefined;\n }\n const nested = new Set(ancestors).add(expr);\n if (Array.isArray(expr)) {\n return yield* Effect.all(expr.map((item) => evaluate(item, upstream, nested)));\n }\n return Object.fromEntries(yield* Effect.all(Object.entries(expr).map(([key, value]) => evaluate(value, upstream, nested).pipe(Effect.map((value) => [key, value])))));\n }\n // Everything else is a leaf returned by identity: Duration, Redacted,\n // Date, and effect runtime values (a Worker's `exports` carries each\n // DO's `constructor` Effect and captured `services` Context). Rebuilding\n // a class instance entry-by-entry strips its prototype, and effect\n // ≥4.0.0-beta.103's Context is cyclic (#1082). This sits after\n // `Config.isConfig` on purpose — Configs are Effects but must resolve.\n return expr;\n});\nexport const hasOutputs = (value) => Object.keys(upstreamAny(value)).length > 0;\n/**\n * Cycle guard shared by the upstream walkers. Marks `value` as visited in\n * `seen`; returns true when it was already visited (the caller returns `{}`\n * — the first visit already contributed the subtree's resources to the\n * FQN-keyed union, so skipping repeats is lossless).\n */\nconst alreadySeen = (value, seen) => {\n if (seen.has(value)) {\n return true;\n }\n seen.add(value);\n return false;\n};\n// The dependency rule (#1082): a Resource or Output IS a dependency; plain\n// data (arrays, plain objects) is traversed to find them; every other value\n// — class instances like effect's Effect/Layer/Context, Dates, SDK objects,\n// functions — is a leaf. See `isPlainData` in Util/data.ts for why leaves\n// must never be walked.\nexport const upstreamAny = (value, seen = new WeakSet()) => {\n if (isResource(value)) {\n return { [value.FQN]: value };\n }\n else if (isExpr(value)) {\n return upstream(value, seen);\n }\n else if (isPlainData(value)) {\n if (alreadySeen(value, seen)) {\n return {};\n }\n return Object.assign({}, ...Object.values(value).map((value) => resolveUpstream(value, seen)));\n }\n return {};\n};\n// TODO(sam): add a type\nexport const upstream = (expr, seen = new WeakSet()) => {\n if (isResource(expr)) {\n return {\n [expr.FQN]: expr,\n };\n }\n else if (isResourceExpr(expr)) {\n return {\n [expr.src.FQN]: expr.src,\n };\n }\n else if (isPropExpr(expr)) {\n return upstream(expr.expr, seen);\n }\n else if (isAllExpr(expr)) {\n return Object.assign({}, ...expr.outs.map((out) => upstream(out, seen)));\n }\n else if (isEffectExpr(expr) ||\n isApplyExpr(expr) ||\n isFlatMapExpr(expr) ||\n isNamedExpr(expr)) {\n return upstream(expr.expr, seen);\n }\n else if (isPlainData(expr)) {\n if (alreadySeen(expr, seen)) {\n return {};\n }\n return Object.values(expr)\n .map((v) => upstream(v, seen))\n .reduce(toObject, {});\n }\n return {};\n};\n// TODO(sam): add a type\nexport const resolveUpstream = (value, seen = new WeakSet()) => {\n if (isPrimitive(value)) {\n return {};\n }\n else if (isResource(value)) {\n return { [value.FQN]: value };\n }\n else if (isOutput(value)) {\n return upstream(value, seen);\n }\n else if (isPlainData(value)) {\n if (alreadySeen(value, seen)) {\n return {};\n }\n return Object.fromEntries(Object.values(value)\n .map((v) => resolveUpstream(v, seen))\n .flatMap(Object.entries));\n }\n return {};\n};\nconst toObject = (acc, v) => ({\n ...acc,\n ...v,\n});\nexport const log = (_value) => Effect.gen(function* () {\n // TODO(sam): implement a log effect\n});\nexport const toEnvKey = (id, suffix) => `${replace(toUpper(id))}_${replace(toUpper(suffix))}`;\nexport const toUpper = (str) => str.toUpperCase();\nconst replace = (str) => str.replace(/-/g, \"_\");\n//# sourceMappingURL=Output.js.map","import * as ConfigProvider from \"effect/ConfigProvider\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Option from \"effect/Option\";\nexport const loadConfigProvider = (envFile) => {\n if (Option.isSome(envFile)) {\n return ConfigProvider.fromDotEnv({ path: envFile.value }).pipe(Effect.map((dotEnv) => ConfigProvider.orElse(dotEnv, ConfigProvider.fromEnv())));\n }\n return Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const exists = yield* fs.exists(\".env\");\n if (!exists) {\n return ConfigProvider.fromEnv();\n }\n return ConfigProvider.orElse(ConfigProvider.fromEnv(), yield* ConfigProvider.fromDotEnv({ path: \".env\" }));\n });\n};\n//# sourceMappingURL=ConfigProvider.js.map","import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Effectable from \"effect/Effectable\";\nexport const effectClass = ((impl) => impl === undefined\n ? (innerImpl) => effectClass(innerImpl)\n : Object.assign(class {\n }, \n // Spreading the Effect prototype onto the class (static side) makes the\n // class itself a real Effect — `Effect.isEffect(X)` is true, so\n // `Effect.all([X])` / `Effect.forEach` work — and subclasses\n // (`class Y extends effectClass(impl)`) inherit the protocol statically.\n Effectable.Prototype({\n label: \"alchemy/EffectClass\",\n evaluate: () => impl,\n })));\nexport const taggedFunction = (tag, fn) => {\n // The Proxy below forwards every Effect-protocol key to `tag` (already an\n // Effect), so `asEffect`/`[Symbol.iterator]`/`pipe` need no explicit\n // override — only `toString` diverges.\n const overrides = {\n toString: () => `${tag.toString()}.${fn.name}`,\n };\n return new Proxy(fn, {\n get: (target, prop, receiver) => Reflect.has(overrides, prop)\n ? Reflect.get(overrides, prop, receiver)\n : Reflect.has(target, prop)\n ? Reflect.get(target, prop, receiver)\n : Reflect.get(tag, prop, tag),\n has: (target, prop) => Reflect.has(overrides, prop) ||\n Reflect.has(target, prop) ||\n Reflect.has(tag, prop),\n });\n};\nexport const isYieldableEffect = (value) => Effect.isEffect(value) &&\n typeof value[Symbol.iterator] ===\n \"function\";\nexport const isEffectClassLike = (value) => typeof value === \"function\" &&\n typeof value.asEffect === \"function\";\nexport const isYieldableEffectLike = (value) => (isYieldableEffect(value) || isEffectClassLike(value)) &&\n !(\"~alchemy/Kind\" in value);\nexport const toEffectInterface = (raw) => ({\n raw,\n ...Object.fromEntries(Object.entries(raw).map(([key, value]) => [\n key,\n typeof value === \"function\"\n ? (...args) => Effect.tryPromise(async () => value(...args))\n : value,\n ])),\n});\n//# sourceMappingURL=effect.js.map","import * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Logger from \"effect/Logger\";\nimport { Path } from \"effect/Path\";\nimport { AlchemyContext } from \"../AlchemyContext.js\";\nexport const fileLogger = Effect.fn(function* (...segments) {\n const { dotAlchemy } = yield* AlchemyContext;\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path;\n const logFile = path.join(dotAlchemy, \"log\", ...segments);\n yield* fs.makeDirectory(path.dirname(logFile), { recursive: true });\n return yield* Logger.formatLogFmt.pipe(Logger.toFile(logFile, {\n flag: \"a\",\n }));\n});\n//# sourceMappingURL=FileLogger.js.map","import * as Effect from \"effect/Effect\";\nimport * as NodeNet from \"node:net\";\n/**\n * The process's working directory, captured ONCE at module load.\n *\n * Relative user paths (Vite roots, asset directories) must resolve against\n * this instead of a live `process.cwd()` read: third-party code sharing the\n * process can change the working directory transiently — most notably\n * cross-spawn, which `process.chdir`s into a spawn's `cwd` to resolve its\n * binary on PATH and then chdirs back. A live read racing that window\n * resolves against an unrelated directory. (`State/LocalState.ts` anchors\n * the state tree the same way, for the same reason.)\n */\nexport const initialCwd = process.cwd();\n/**\n * Opt out of cross-spawn's temporary `process.chdir` dance.\n *\n * cross-spawn (bundled inside vite, wrangler, next, tinyexec, playwright,\n * tsx, prisma, …) resolves a spawn's binary by `process.chdir`ing the\n * WHOLE parent process into the spawn's `cwd`, calling `which.sync`, and\n * chdiring back. In an alchemy process — which runs many resource builds\n * and hashers concurrently on one event loop — every fiber that touches a\n * relative path can race that window and resolve against an unrelated\n * directory.\n *\n * `process.chdir.disabled = true` is NODE'S OWN convention: Node sets it\n * on `process.chdir` inside worker threads (where chdir is forbidden),\n * and cross-spawn checks it to skip the dance. Setting it on the main\n * thread opts us into the exact mode every cross-spawn copy already runs\n * in inside jest/vitest/playwright workers daily — not an untested path.\n * The flag is purely advisory: `process.chdir` itself keeps working, and\n * an audit of the dependency tree shows the only readers are bundled\n * cross-spawn copies; nothing else writes or consults it.\n *\n * Behavior delta: a spawn combining a custom `cwd` with a command that is\n * neither absolute nor on PATH (e.g. `./scripts/build.sh`). POSIX still\n * works (cross-spawn falls back to the raw command; the OS resolves it in\n * the child's cwd). On Windows that shape can fail to resolve — the same\n * limitation those tools already have inside worker threads. Everything\n * alchemy and its toolchains spawn is absolute or on PATH, and `Command`\n * resources use effect's ChildProcess (plain spawn, no cross-spawn).\n */\nexport const disableCrossSpawnChdir = () => {\n process.chdir.disabled = true;\n};\nexport const isTransformTypesSupported = (version = process.versions.node) => {\n const [major, minor] = version.split(\".\").map(Number);\n return (major === 22 && minor >= 7) || (major >= 23 && major < 26);\n};\n/**\n * Node CLI flags that transparently transform TypeScript types so `.ts`\n * entry points work the same way they do under Bun. Empty when the running\n * Node doesn't support (or no longer needs) the experimental flag.\n */\nexport const transformTypesFlags = (version = process.versions.node) => isTransformTypesSupported(version)\n ? [\"--experimental-transform-types\", \"--no-warnings=ExperimentalWarning\"]\n : [];\n/**\n * Ask the OS for an unused TCP port, release it, and return its number.\n *\n * The port is only available, not reserved: another process can claim it\n * before the caller binds. Callers should keep the gap short and still handle\n * `EADDRINUSE`.\n */\nexport const findAvailablePort = (host = \"127.0.0.1\") => Effect.callback((resume) => {\n const server = NodeNet.createServer();\n server.unref();\n server.once(\"error\", (error) => resume(Effect.fail(error)));\n server.listen(0, host, () => {\n const address = server.address();\n const port = typeof address === \"object\" && address !== null\n ? address.port\n : undefined;\n server.close((error) => {\n if (error) {\n resume(Effect.fail(error));\n }\n else if (port !== undefined) {\n resume(Effect.succeed(port));\n }\n else {\n resume(Effect.fail(new Error(\"Failed to allocate an available port\")));\n }\n });\n });\n});\n//# sourceMappingURL=Node.js.map","import * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport { defaultTeardown } from \"effect/Runtime\";\nimport { disableCrossSpawnChdir } from \"./Node.js\";\nconst isBun = typeof Bun !== \"undefined\";\nconst importPlatformPeer = (peerDependency, load) => load().catch(() => {\n console.error([\n `Alchemy could not load the required peer dependency \"${peerDependency}\".`,\n `Install a compatible version of \"${peerDependency}\" in the same project as \"alchemy\".`,\n \"If it is already installed, you may be running a globally installed Alchemy CLI; run the project-local CLI instead.\",\n ].join(\"\\n\"));\n process.exit(1);\n});\n/**\n * Constructs a layer with different implementations for Bun and Node.\n */\nexport const platformLayer = (constructors) => Layer.unwrap(Effect.promise(async () => {\n if (isBun) {\n return await constructors.bun();\n }\n else {\n return await constructors.node();\n }\n}));\nexport const PlatformServices = platformLayer({\n bun: async () => {\n const [BunServices, BunSocket] = await Promise.all([\n importPlatformPeer(\"@effect/platform-bun\", () => import(\"@effect/platform-bun/BunServices\")),\n importPlatformPeer(\"@effect/platform-bun\", () => import(\"@effect/platform-bun/BunSocket\")),\n ]);\n return Layer.merge(BunServices.layer, BunSocket.layerWebSocketConstructor);\n },\n node: async () => {\n const [NodeServices, NodeSocket] = await Promise.all([\n importPlatformPeer(\"@effect/platform-node\", () => import(\"@effect/platform-node/NodeServices\")),\n importPlatformPeer(\"@effect/platform-node\", () => import(\"@effect/platform-node/NodeSocket\")),\n ]);\n return Layer.merge(NodeServices.layer, NodeSocket.layerWebSocketConstructor);\n },\n});\n/**\n * ALWAYS exit once the main effect completes. The platform `runMain` default\n * only force-exits on failure or signal interruption — a *successful*\n * `alchemy deploy`/`destroy` otherwise lingers for ~100 seconds after \"Done\"\n * while keep-alive sockets (Cloudflare API agents, provider sidecar handles)\n * pin the event loop until the remote side closes them. All Effect finalizers\n * have already run by the time teardown is invoked; the macrotask hop lets\n * any buffered stdout drain before the process exits.\n */\nconst exitingTeardown = (exit, onExit) => {\n defaultTeardown(exit, (code) => {\n const finalCode = code !== 0 ? code : Number(process.exitCode ?? 0) || 0;\n setTimeout(() => process.exit(finalCode), 0);\n onExit(finalCode);\n });\n};\nexport const runMain = (effect, options) => {\n // Every alchemy process (CLI, exec child, sidecar, build/dev runners)\n // runs concurrent effects that depend on a stable working directory —\n // forbid cross-spawn's transient process-wide chdir (see Util/Node.ts).\n disableCrossSpawnChdir();\n const opts = {\n ...options,\n teardown: options?.teardown ?? exitingTeardown,\n };\n if (isBun) {\n void importPlatformPeer(\"@effect/platform-bun\", () => import(\"@effect/platform-bun/BunRuntime\")).then((BunRuntime) => BunRuntime.runMain(effect, opts));\n }\n else {\n void importPlatformPeer(\"@effect/platform-node\", () => import(\"@effect/platform-node/NodeRuntime\")).then((NodeRuntime) => NodeRuntime.runMain(effect, opts));\n }\n};\nexport const httpServer = (port = 0, host = \"127.0.0.1\") => platformLayer({\n bun: async () => {\n const BunHttpServer = await importPlatformPeer(\"@effect/platform-bun\", () => import(\"@effect/platform-bun/BunHttpServer\"));\n // `idleTimeout: 0` disables Bun's default 10s request idle timeout.\n // The RPC spawner serves a long-lived `/logs` stream (sidecar output\n // forwarded to the exec child's renderer) that can legitimately sit\n // idle between lines; Bun would otherwise sever it mid-session.\n return BunHttpServer.layer({ hostname: host, port, idleTimeout: 0 });\n },\n node: async () => {\n const [NodeHttpServer, Http] = await Promise.all([\n importPlatformPeer(\"@effect/platform-node\", () => import(\"@effect/platform-node/NodeHttpServer\")),\n import(\"node:http\"),\n ]);\n return NodeHttpServer.layerServer(Http.createServer, { host, port });\n },\n});\n//# sourceMappingURL=PlatformServices.js.map","import { ConfigProvider } from \"effect/ConfigProvider\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport { FileSystem } from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Logger from \"effect/Logger\";\nimport * as Option from \"effect/Option\";\nimport { Path } from \"effect/Path\";\nimport * as Scope from \"effect/Scope\";\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\";\nimport { AlchemyContext, AlchemyContextLive } from \"./AlchemyContext.js\";\nimport { provideFreshArtifactStore } from \"./Artifacts.js\";\nimport { AuthProviders } from \"./Auth/AuthProvider.js\";\nimport { CredentialsStore, CredentialsStoreLive } from \"./Auth/Credentials.js\";\nimport { AlchemyProfile, ProfileLive } from \"./Auth/Profile.js\";\nimport { Cli } from \"./Cli/Cli.js\";\nimport * as Output from \"./Output.js\";\nimport { Stage } from \"./Stage.js\";\nimport { loadConfigProvider } from \"./Util/ConfigProvider.js\";\nimport { effectClass, taggedFunction } from \"./Util/effect.js\";\nimport { fileLogger } from \"./Util/FileLogger.js\";\nimport { PlatformServices } from \"./Util/PlatformServices.js\";\nexport const Stack = Object.assign(taggedFunction(Context.Service()(\"Stack\"), (stackName, options, eff) => {\n if (!stackName) {\n return (stackName) => Object.assign(\n // by default, reference the stack at the \"current\" stage of the importer\n Output.stackRef(stackName).pipe(effectClass), {\n stackName,\n stage: createStageProxy(stackName),\n state: options?.state,\n providers: options?.providers,\n make: (options, eff) => \n // @ts-expect-error\n Stack(stackName, options, eff),\n });\n }\n return eff.pipe(\n // @ts-expect-error\n make({\n name: stackName,\n ...options,\n }), (eff) => Object.assign(eff, {\n stackName,\n stage: createStageProxy(stackName),\n state: options?.state,\n providers: options?.providers,\n }));\n}));\nconst createStageProxy = (stackName) => new Proxy({}, {\n get: (_, stage) => Output.stackRef(stackName, { stage }),\n});\nexport const StackName = Stack.use((stack) => Effect.succeed(stack.name));\nexport const make = (options) => (effect) => Effect.scope.pipe(Effect.flatMap((scope) => {\n if (options.state == null) {\n return Effect.die(new Error(`Stack \"${options.name}\" is missing a state store. ` +\n `Add a \\`state\\` layer to the stack options, e.g.:\\n` +\n ` Alchemy.Stack(\"${options.name}\", {\\n` +\n ` providers: Cloudflare.providers(),\\n` +\n ` state: Cloudflare.state(), // <-- required\\n` +\n ` }, ...)\\n` +\n `See https://alchemy.run/state-store for available state stores.`));\n }\n if (options.providers == null) {\n return Effect.die(new Error(`Stack \"${options.name}\" is missing a providers layer. ` +\n `Add a \\`providers\\` layer to the stack options, e.g.:\\n` +\n ` Alchemy.Stack(\"${options.name}\", {\\n` +\n ` providers: Cloudflare.providers(), // <-- required\\n` +\n ` state: Cloudflare.state(),\\n` +\n ` }, ...)`));\n }\n return options.providers.pipe(Layer.provideMerge(options.state), Layer.provideMerge(Layer.effect(Stack, Stage.pipe(Effect.map((stage) => options.stack ?? {\n name: options.name,\n stage,\n resources: {},\n bindings: {},\n actions: {},\n })))), Layer.buildWithScope(scope));\n}), Effect.flatMap((context) => Effect.all([\n effect,\n Stack,\n Effect.context(),\n]).pipe(Effect.map(([output, stack, services]) => ({\n ...stack,\n output,\n services: Context.merge(services, context),\n})), Effect.provideContext(context))));\nexport const CurrentStack = Effect.serviceOption(Stack)\n .pipe(Effect.map(Option.getOrUndefined));\nconst platform = Layer.mergeAll(PlatformServices, FetchHttpClient.layer, Logger.layer([fileLogger(\"out\")], { mergeWithExisting: true }), Layer.provide(ProfileLive, PlatformServices), Layer.provide(CredentialsStoreLive, PlatformServices));\n// override alchemy state store, CLI/reporting, state, and Config\nconst alchemy = (overrides) => Layer.mergeAll(\n// CLI.inkCLI(),\n// optional\noverrides?.dev\n ? Layer.provide(Layer.effect(AlchemyContext, AlchemyContext.useSync((ctx) => ({ ...ctx, dev: overrides.dev }))), AlchemyContextLive)\n : AlchemyContextLive);\nexport const evalStack = (effect, fn, options) => {\n const body = Effect.gen(function* () {\n const stack = yield* effect;\n const configProvider = yield* loadConfigProvider(Option.none());\n return yield* fn(stack).pipe(provideFreshArtifactStore, Effect.provide(Layer.succeedContext(stack.services).pipe(Layer.provideMerge(Layer.succeed(ConfigProvider, configProvider)))));\n }).pipe(Effect.provide(Layer.effect(AuthProviders, Effect.serviceOption(AuthProviders).pipe(Effect.map(Option.getOrElse(() => ({}))))).pipe(Layer.provideMerge(Layer.succeed(Stage, options.stage)), Layer.provideMerge(Layer.provideMerge(alchemy({ dev: options.dev }), platform)))));\n return options.scope === undefined\n ? Effect.scoped(body)\n : Scope.provide(body, options.scope);\n};\n//# sourceMappingURL=Stack.js.map","import * as Duration from \"effect/Duration\";\nimport * as Redacted from \"effect/Redacted\";\nimport { isResource } from \"../Resource.js\";\n/**\n * JSON marker used to tag a `Redacted<T>` value when writing state.\n * The reviver recognises objects with exactly this key and rebuilds\n * the `Redacted` wrapper on read.\n */\nexport const REDACTED_MARKER = \"__redacted__\";\n/**\n * JSON marker used to tag a `Duration` value when writing state.\n * The reviver recognises objects with exactly this key and rebuilds\n * a real `Duration` instance on read so that downstream code can call\n * `Duration.toSeconds`, `Duration.toMillis`, etc. without first\n * decoding `Duration.toJSON`'s `{_id,_tag,...}` shape.\n */\nexport const DURATION_MARKER = \"__duration__\";\n/**\n * JSON marker used to tag a `Date` value when writing state. The reviver\n * recognises objects with exactly this key and rebuilds a real `Date`\n * instance on read, so a Date-typed prop read back out of persisted state\n * (`olds` in provider `diff`/`delete`/`read`) is a `Date` again — not the\n * bare ISO string `JSON.stringify` would otherwise leave behind.\n */\nexport const DATE_MARKER = \"__date__\";\nconst decodeDate = (encoded) => {\n if (typeof encoded !== \"string\")\n return undefined;\n const date = new Date(encoded);\n return Number.isNaN(date.getTime()) ? undefined : date;\n};\n/**\n * Rebuild a {@link Duration.Duration} from `Duration.toJSON`'s\n * `{_id,_tag,millis?,nanos?}` shape. Shared by state persistence and the\n * RPC sidecar — that JSON is not a valid `Duration.Input`.\n */\nexport const decodeDuration = (encoded) => {\n if (encoded === null || typeof encoded !== \"object\")\n return undefined;\n const json = encoded;\n switch (json._tag) {\n case \"Millis\":\n return json.millis !== undefined\n ? Duration.millis(json.millis)\n : undefined;\n case \"Nanos\":\n return json.nanos !== undefined\n ? Duration.nanos(BigInt(json.nanos))\n : undefined;\n case \"Infinity\":\n return Duration.infinity;\n case \"NegativeInfinity\":\n return Duration.negativeInfinity;\n default:\n return undefined;\n }\n};\n/**\n * Recursively encode a state value for JSON serialisation.\n *\n * - `Redacted<T>` values are wrapped as `{ [REDACTED_MARKER]: <inner> }`\n * so the actual string is persisted rather than the `<redacted>`\n * placeholder produced by the default `toJSON`.\n * - `Resource` instances are flattened to `{ id, type, props, attr }`\n * so persisted state matches the schema used by the loader.\n * - Plain objects and arrays are walked structurally.\n */\nexport const encodeState = (value) => {\n if (value === null ||\n value === undefined ||\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\")\n return value;\n if (Redacted.isRedacted(value)) {\n return {\n [REDACTED_MARKER]: encodeState(Redacted.value(value)),\n };\n }\n if (Duration.isDuration(value)) {\n // `JSON.stringify(Duration.seconds(N))` already invokes Duration.toJSON,\n // but encodeState is also called for code paths that don't go through\n // `JSON.stringify` (e.g. the HTTP state-store). Tag with our marker so\n // the reviver can unambiguously rebuild a real Duration instance —\n // Duration.toJSON's `{_id,_tag,...}` shape is NOT a valid Duration.Input.\n return {\n [DURATION_MARKER]: value.toJSON(),\n };\n }\n // Dates are serializable leaves and must round-trip: walking one\n // structurally would persist `{}` (`Object.entries(new Date())` is empty)\n // — and every later plan would then diff the empty object against the\n // program's Date and churn a phantom update forever. Tag with our marker\n // so the reviver rebuilds a real Date instance; rows written before the\n // marker carry a bare ISO string, which `canonicalize` in Diff.ts still\n // compares as equal to a live Date, so legacy rows never churn either.\n if (value instanceof Date) {\n return { [DATE_MARKER]: value.toJSON() };\n }\n if (isResource(value)) {\n return {\n id: value.LogicalId,\n type: value.Type,\n props: encodeState(value.Props),\n attr: encodeState(value.Attributes),\n };\n }\n if (Array.isArray(value))\n return value.map(encodeState);\n if (typeof value === \"object\") {\n const result = {};\n for (const [k, v] of Object.entries(value)) {\n result[k] = encodeState(v);\n }\n return result;\n }\n return value;\n};\n/**\n * JSON reviver that rebuilds `Redacted<T>` values that were written\n * through {@link encodeState}. Intended for use with `JSON.parse`.\n */\nexport const reviveState = (_key, value) => {\n if (value !== null && typeof value === \"object\" && !Array.isArray(value)) {\n const obj = value;\n if (REDACTED_MARKER in obj) {\n return Redacted.make(obj[REDACTED_MARKER]);\n }\n if (DURATION_MARKER in obj) {\n const decoded = decodeDuration(obj[DURATION_MARKER]);\n if (decoded !== undefined)\n return decoded;\n }\n // Exact single-key match only — unlike the legacy REDACTED/DURATION\n // markers there is no pre-marker data to tolerate, so a user object\n // that merely CONTAINS the key alongside other fields is never\n // collapsed into a Date (mirrors reviveStateRecursive's strictness).\n if (DATE_MARKER in obj && Object.keys(obj).length === 1) {\n const decoded = decodeDate(obj[DATE_MARKER]);\n if (decoded !== undefined)\n return decoded;\n }\n }\n return value;\n};\n/**\n * Recursively walk an already-decoded value and rebuild `Redacted<T>`\n * instances from `{ [REDACTED_MARKER]: <inner> }` envelopes. Mirror\n * image of {@link encodeState} for callers that hold a parsed JS\n * value rather than a JSON string (e.g. the HTTP state-store client,\n * which receives values pre-parsed by `HttpApiClient`).\n */\nexport const reviveStateRecursive = (value) => {\n if (value === null || typeof value !== \"object\")\n return value;\n if (Array.isArray(value))\n return value.map(reviveStateRecursive);\n const obj = value;\n const keys = Object.keys(obj);\n if (keys.length === 1 && keys[0] === REDACTED_MARKER) {\n return Redacted.make(reviveStateRecursive(obj[REDACTED_MARKER]));\n }\n if (keys.length === 1 && keys[0] === DURATION_MARKER) {\n const decoded = decodeDuration(obj[DURATION_MARKER]);\n if (decoded !== undefined)\n return decoded;\n }\n if (keys.length === 1 && keys[0] === DATE_MARKER) {\n const decoded = decodeDate(obj[DATE_MARKER]);\n if (decoded !== undefined)\n return decoded;\n }\n const result = {};\n for (const [k, v] of Object.entries(obj)) {\n result[k] = reviveStateRecursive(v);\n }\n return result;\n};\n//# sourceMappingURL=StateEncoding.js.map","import * as Cause from \"effect/Cause\";\nimport * as Context from \"effect/Context\";\nimport * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport { flow } from \"effect/Function\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as Schema from \"effect/Schema\";\nimport * as Stream from \"effect/Stream\";\nimport * as NodeUtil from \"node:util\";\nimport * as Output from \"../Output.js\";\nimport { isRedactedMarker } from \"../RuntimeContext.js\";\nimport { decodeDuration, DURATION_MARKER, encodeState, } from \"../State/StateEncoding.js\";\nexport const wrapRpcHandlers = (handlers, streamKeys) => {\n return Object.fromEntries(Object.entries(handlers).map(([key, value]) => [\n key,\n typeof value === \"function\"\n ? streamKeys?.includes(key)\n ? wrapRpcStreamHandler(value)\n : wrapRpcEffectHandler(value)\n : typeof value === \"object\" && value !== null && !Array.isArray(value)\n ? wrapRpcHandlers(value)\n : value,\n ]));\n};\nexport const unwrapRpcHandlers = (handlers, streamKeys) => {\n return Object.fromEntries(Object.entries(handlers).map(([key, value]) => [\n key,\n typeof value === \"function\"\n ? streamKeys?.includes(key)\n ? unwrapRpcStreamHandler(value)\n : unwrapRpcEffectHandler(value)\n : typeof value === \"object\" && value !== null && !Array.isArray(value)\n ? unwrapRpcHandlers(value)\n : value,\n ]));\n};\nconst serializeError = Schema.encodeSync(Schema.Defect());\nconst wrapRpcEffectHandler = (handler) => flow((args) => deserializeRpcArgs(args), (args) => handler(...args), Effect.exit, Effect.map((exit) => {\n if (exit._tag === \"Success\") {\n // Success values need the same marker treatment as args: provider\n // attributes can legitimately carry `Redacted` secrets (e.g. a local\n // container's bound env), and a raw Redacted reaching capnweb dies\n // with `TypeError: Cannot serialize value: <redacted>`.\n return {\n _tag: \"Success\",\n value: serializeRpcArgs(exit.value),\n };\n }\n return {\n _tag: \"Failure\",\n cause: exit.cause.reasons.map((reason) => {\n switch (reason._tag) {\n case \"Fail\":\n return {\n _tag: \"Fail\",\n error: serializeError(reason.error),\n };\n case \"Die\":\n return { _tag: \"Die\", defect: serializeError(reason.defect) };\n case \"Interrupt\":\n return { _tag: \"Interrupt\", fiberId: reason.fiberId };\n }\n }),\n };\n}), Effect.runPromise);\nconst wrapRpcStreamHandler = (handler) => flow((args) => deserializeRpcArgs(args), (args) => handler(...args), (stream) => Stream.toReadableStream(stream));\nconst unwrapRpcEffectHandler = (handler) => flow((...args) => serializeRpcArgs(args), (args) => Effect.promise(() => handler(args)), Effect.flatMap((exit) => {\n if (exit._tag === \"Success\") {\n // Mirror of the wrap side: rebuild `Redacted` wrappers from their\n // wire markers so callers get the same shape an in-process provider\n // returns.\n return Exit.succeed(deserializeRpcArgs(exit.value));\n }\n return Exit.failCause(Cause.fromReasons(exit.cause.map((reason) => {\n switch (reason._tag) {\n case \"Fail\":\n return Cause.makeFailReason(reason.error);\n case \"Die\":\n return Cause.makeDieReason(reason.defect);\n case \"Interrupt\":\n return Cause.makeInterruptReason(reason.fiberId);\n }\n })));\n}));\nconst unwrapRpcStreamHandler = (handler) => flow((...args) => serializeRpcArgs(args), (args) => handler(args), (stream) => Stream.fromReadableStream({\n evaluate: () => stream,\n onError: (error) => error,\n}));\nconst serializeRpcArgs = (value) => {\n if (Redacted.isRedacted(value)) {\n return {\n _tag: \"Redacted\",\n value: Redacted.value(value),\n };\n }\n // Output must be tested BEFORE Effect.isEffect — Output exprs are yieldable\n // and would otherwise be misclassified as plain Effects.\n if (Output.isOutput(value)) {\n return {\n _tag: \"Output\",\n description: NodeUtil.inspect(value),\n };\n }\n // Runtime-only effect values riding in props (e.g. a Worker's `exports`\n // carries each DO's `constructor` Effect and captured `services` Context —\n // passed through prop resolution by identity since #1094). They cannot\n // cross the wire (function-valued internals kill capnweb) and the sidecar\n // never runs them (`stripEffects` drops them from `news` provider-side), so\n // ship a marker that deserializes back into an equivalent leaf: an Effect\n // that dies loudly if it IS ever run, keeping `isResolved`/`stripEffects`\n // semantics identical on both sides of the boundary.\n if (Effect.isEffect(value)) {\n return {\n _tag: \"~alchemy/Rpc/Effect\",\n description: NodeUtil.inspect(value),\n };\n }\n if (Context.isContext(value)) {\n return {\n _tag: \"~alchemy/Rpc/Context\",\n description: NodeUtil.inspect(value),\n };\n }\n // Duration has `toJSON` (so the structural walk below skips it) but\n // capnweb cannot serialize the live Effect Duration object — it dies\n // with `TypeError: Cannot serialize value: 15000 millis`. Use the same\n // `{ __duration__: toJSON() }` envelope as persisted state.\n if (Duration.isDuration(value)) {\n return encodeState(value);\n }\n if (typeof value === \"function\") {\n return null;\n }\n if (Array.isArray(value)) {\n return value.map(serializeRpcArgs);\n }\n if (value && typeof value === \"object\" && !(\"toJSON\" in value)) {\n return Object.fromEntries(Object.entries(value).map(([key, child]) => [\n key,\n serializeRpcArgs(child),\n ]));\n }\n return value;\n};\nconst isEffectMarker = (value) => \"_tag\" in value &&\n value._tag === \"~alchemy/Rpc/Effect\" &&\n \"description\" in value &&\n typeof value.description === \"string\";\nconst isContextMarker = (value) => \"_tag\" in value &&\n value._tag === \"~alchemy/Rpc/Context\" &&\n \"description\" in value &&\n typeof value.description === \"string\";\nconst isDurationEnvelope = (value) => DURATION_MARKER in value && Object.keys(value).length === 1;\nconst deserializeRpcArgs = (value) => {\n if (Array.isArray(value)) {\n return value.map(deserializeRpcArgs);\n }\n else if (typeof value === \"object\" && value !== null) {\n // These values are serialized as `{_tag: \"Redacted\", value: ...}` and `{_tag: \"Output\", description: ...}`,\n // so we need to detect them manually - Redacted.isRedacted and Output.isOutput do not work.\n if (isRedactedMarker(value)) {\n return Redacted.make(value.value);\n }\n else if (\"_tag\" in value &&\n value._tag === \"Output\" &&\n \"description\" in value &&\n typeof value.description === \"string\") {\n return new Output.NamedExpr(new Output.EffectExpr(Output.VoidExpr, () => Effect.never), value.description);\n }\n else if (isEffectMarker(value)) {\n // Rebuild an Effect-typed leaf so `isResolved`/`stripEffects` classify\n // it exactly like the original; dies loudly if anything ever runs it.\n const description = value.description;\n return Effect.suspend(() => Effect.die(new Error(`An Effect from the resource's props cannot cross the RPC provider boundary and was replaced by a placeholder: ${description}`)));\n }\n else if (isContextMarker(value)) {\n return Context.empty();\n }\n else if (isDurationEnvelope(value)) {\n return decodeDuration(value[DURATION_MARKER]) ?? value;\n }\n return Object.fromEntries(Object.entries(value).map(([key, child]) => [\n key,\n deserializeRpcArgs(child),\n ]));\n }\n return value;\n};\n//# sourceMappingURL=RpcSerialization.js.map","import * as Config from \"effect/Config\";\nimport * as ConfigProvider from \"effect/ConfigProvider\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport { AlchemyContext } from \"../AlchemyContext.js\";\nimport { AuthProviders } from \"../Auth/AuthProvider.js\";\nimport { CredentialsStoreLive } from \"../Auth/Credentials.js\";\nimport { ProfileLive, withProfileOverride } from \"../Auth/Profile.js\";\nimport { Stack } from \"../Stack.js\";\nimport { Stage } from \"../Stage.js\";\nimport { loadConfigProvider } from \"../Util/ConfigProvider.js\";\n/** Query parameter carrying the JSON {@link SessionEnvironment} on session websockets. */\nexport const SESSION_ENV_PARAM = \"alchemy-session-env\";\nexport const encodeSessionEnvironment = (env) => JSON.stringify(env);\nexport const decodeSessionEnvironment = (raw) => JSON.parse(raw);\nexport const layer = (environment) => Layer.mergeAll(ProfileLive, CredentialsStoreLive, Layer.succeed(AuthProviders, {}), ConfigProvider.layer(loadConfigProvider(Option.fromNullishOr(environment.envFile)).pipe(Effect.map((base) => withProfileOverride(base, environment.profile)))), Layer.succeed(AlchemyContext, environment.alchemyContext), Layer.succeed(Stack, {\n name: environment.stack.name,\n stage: environment.stack.stage,\n resources: {},\n bindings: {},\n actions: {},\n}), Layer.succeed(Stage, environment.stack.stage));\nexport const RPC_SERVER_ENVIRONMENT_KEY = \"ALCHEMY_RPC_SERVER_ENVIRONMENT\";\n/** The spawn-time environment the parent baked into the child's process env. */\nexport const fromProcessEnv = Config.string(RPC_SERVER_ENVIRONMENT_KEY).pipe(Config.map((raw) => JSON.parse(raw)));\n/**\n * Legacy single-stack boot: the full environment (including the stack) baked\n * into the process env at spawn time. Used by children that serve exactly one\n * stack for their whole lifetime (e.g. the Vite dev-server child, which gets\n * an explicit environment from `startViteChild`). RPC sidecars do NOT use\n * this — their sessions each carry a {@link SessionEnvironment}.\n */\nexport const fromEnv = () => Layer.unwrap(fromProcessEnv.pipe(Effect.flatMap((environment) => environment.stack === undefined ||\n environment.alchemyContext === undefined\n ? Effect.die(new Error(`${RPC_SERVER_ENVIRONMENT_KEY} carries no stack/alchemyContext — this child requires the legacy single-stack environment`))\n : Effect.succeed(layer({\n profile: environment.profile,\n envFile: environment.envFile,\n stack: environment.stack,\n alchemyContext: environment.alchemyContext,\n })))));\n//# sourceMappingURL=RpcServerEnvironment.js.map","import { newWebSocketRpcSession } from \"capnweb\";\nimport * as Cache from \"effect/Cache\";\nimport * as Config from \"effect/Config\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as HttpBody from \"effect/unstable/http/HttpBody\";\nimport * as HttpClient from \"effect/unstable/http/HttpClient\";\nimport { AlchemyContext } from \"../AlchemyContext.js\";\nimport { Stack } from \"../Stack.js\";\nimport { unwrapRpcHandlers } from \"./RpcSerialization.js\";\nimport { encodeSessionEnvironment, SESSION_ENV_PARAM, } from \"./RpcServerEnvironment.js\";\nexport class RpcProviderProxy extends Context.Service()(\"alchemy/Local/RpcProviderProxy\") {\n}\nexport const SPAWNER_URL_ENV_KEY = \"ALCHEMY_RPC_SPAWNER_URL\";\n/**\n * Separator for the session-cache key. `\\u0000` cannot appear in either half:\n * JSON.stringify escapes control characters and URLs cannot carry raw NULs.\n */\nconst SESSION_KEY_SEPARATOR = \"\\u0000\";\nconst make = Effect.fn(function* (spawnerUrl) {\n const client = yield* HttpClient.HttpClient;\n const getSession = Effect.fn(function* (serverEntryUrl, sessionEnv) {\n const payload = { serverEntryUrl };\n const response = yield* client.post(spawnerUrl, {\n body: yield* HttpBody.json(payload),\n });\n // The spawner returns one shared child per entry URL; the stack-specific\n // environment rides the session websocket so the child can build (and\n // memoize) a provider context per stack.\n const body = yield* response.text;\n if (response.status !== 200) {\n return yield* Effect.fail(new Error(`RPC spawner POST ${spawnerUrl} returned ${response.status}: ${body.slice(0, 300)}`));\n }\n let websocketUrl;\n try {\n websocketUrl = new URL(body);\n }\n catch {\n return yield* Effect.fail(new Error(`RPC spawner POST ${spawnerUrl} did not return a websocket URL (got ${JSON.stringify(body.slice(0, 200))})`));\n }\n if (websocketUrl.protocol !== \"ws:\" && websocketUrl.protocol !== \"wss:\") {\n return yield* Effect.fail(new Error(`RPC spawner POST ${spawnerUrl} returned a non-websocket URL: ${websocketUrl.toString()}`));\n }\n websocketUrl.searchParams.set(SESSION_ENV_PARAM, sessionEnv);\n return newWebSocketRpcSession(websocketUrl.toString());\n }, (effect, serverEntryUrl) => Effect.catch(effect, (error) => Effect.die(new Error(`Failed to create provider RPC session for \"${serverEntryUrl}\"`, {\n cause: error,\n }))));\n // A websocket that drops (sidecar crash/restart, abnormal 1006 close)\n // permanently breaks the capnweb session, and a cached broken session would\n // poison every subsequent call — including test-runner retries.\n // `onRpcBroken` fires on disconnect and evicts the entry, so the next `get`\n // re-registers with the spawner (which respawns the sidecar child if it\n // died). Assigned after the cache exists; the callback only fires on live\n // sessions, which the cache must already contain.\n let evictBrokenSession = () => { };\n const cache = yield* Cache.make({\n lookup: (key) => {\n const separator = key.indexOf(SESSION_KEY_SEPARATOR);\n return getSession(key.slice(0, separator), key.slice(separator + 1)).pipe(Effect.tap((session) => Effect.sync(() => session.onRpcBroken(() => evictBrokenSession(key)))));\n },\n capacity: Infinity,\n });\n evictBrokenSession = (key) => Effect.runFork(Cache.invalidate(cache, key));\n return RpcProviderProxy.of({\n get: Effect.fn(function* (mainUrl, providerName) {\n const alchemyContext = yield* AlchemyContext;\n const stack = yield* Stack;\n const sessionEnv = encodeSessionEnvironment({\n alchemyContext,\n stack: { name: stack.name, stage: stack.stage },\n });\n const key = mainUrl + SESSION_KEY_SEPARATOR + sessionEnv;\n const fetchProvider = Effect.gen(function* () {\n const session = yield* Cache.get(cache, key);\n return yield* Effect.tryPromise(() => session.getProvider(providerName));\n });\n // One in-place reconnect: if the session broke mid-call (the broken\n // callback may not have evicted it yet), drop it and re-register once\n // before giving up.\n const provider = yield* fetchProvider.pipe(Effect.catch(() => Cache.invalidate(cache, key).pipe(Effect.andThen(fetchProvider))), Effect.orDie);\n // The served shape omits the process-local `mode`/`modes` variant\n // machinery (see RpcProviderService); the unwrapped stub is a plain\n // (mode-agnostic) ProviderService.\n return unwrapRpcHandlers(provider, [\"tail\"]);\n }),\n });\n});\nexport const layer = (url) => Layer.effect(RpcProviderProxy, make(url));\nexport const fromEnv = () => Layer.effect(RpcProviderProxy, Config.string(SPAWNER_URL_ENV_KEY).pipe(Effect.flatMap(make)));\n//# sourceMappingURL=RpcProviderProxy.js.map","import * as Cache from \"effect/Cache\";\nimport * as Config from \"effect/Config\";\nimport * as Console from \"effect/Console\";\nimport * as Context from \"effect/Context\";\nimport * as Deferred from \"effect/Deferred\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Queue from \"effect/Queue\";\nimport * as Scope from \"effect/Scope\";\nimport * as Stream from \"effect/Stream\";\nimport * as HttpClient from \"effect/unstable/http/HttpClient\";\nimport * as HttpServer from \"effect/unstable/http/HttpServer\";\nimport { HttpServerRequest } from \"effect/unstable/http/HttpServerRequest\";\nimport * as HttpServerResponse from \"effect/unstable/http/HttpServerResponse\";\nimport * as ChildProcess from \"effect/unstable/process/ChildProcess\";\nimport * as ChildProcessSpawner from \"effect/unstable/process/ChildProcessSpawner\";\nimport { fileURLToPath } from \"node:url\";\nimport { transformTypesFlags } from \"../Util/Node.js\";\nimport { httpServer } from \"../Util/PlatformServices.js\";\nimport { SPAWNER_URL_ENV_KEY } from \"./RpcProviderProxy.js\";\nimport { RPC_SERVER_ENVIRONMENT_KEY, } from \"./RpcServerEnvironment.js\";\nexport class RpcSpawner extends Context.Service()(\"alchemy/Local/RpcSpawner\") {\n}\n/**\n * Path on the spawner's HTTP server that streams sidecar output as NDJSON\n * ({@link SidecarLogLine} per line). Consumed by {@link forwardSidecarLogs}\n * from the exec child, which owns the terminal renderer.\n */\nexport const LOGS_PATH = \"/logs\";\nexport const make = Effect.fn(function* ({ profile, envFile, }) {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const scope = yield* Effect.scope;\n const cache = yield* Cache.make({\n lookup: (serverEntryUrl) => spawn(serverEntryUrl).pipe(Scope.provide(scope)),\n capacity: Infinity,\n });\n // Sidecar output hub. During `alchemy dev` this process (the outer dev\n // command) shares the tty with the exec child, and the exec child owns the\n // repainting progress renderer (Ink patches its `console`). Printing\n // sidecar lines RAW from here interleaves with the renderer's repaints and\n // corrupts the region (stacked/duplicated frames). So: when an exec child\n // is subscribed via the /logs endpoint, hand lines to it and let it print\n // through its (patched) console; only print from this process as a\n // fallback when no subscriber is connected (e.g. during a --watch restart\n // gap, when no renderer is alive either).\n const subscribers = new Set();\n const publish = (line) => Effect.suspend(() => {\n if (subscribers.size > 0) {\n for (const notify of subscribers)\n notify(line);\n return Effect.void;\n }\n // Through the Console SERVICE so runners that override it (e.g.\n // alchemy-test's per-test buffer) capture the sidecar's output.\n return line.channel === \"stderr\"\n ? Console.error(line.line)\n : Console.log(line.line);\n });\n const spawn = Effect.fn(function* (serverEntryUrl) {\n const bin = typeof globalThis.Bun !== \"undefined\" ? \"bun\" : \"node\";\n const main = fileURLToPath(serverEntryUrl);\n // Stack-specific context is deliberately absent: sessions carry their\n // own SessionEnvironment, so one child serves every stack.\n const environment = {\n profile,\n envFile,\n };\n const command = ChildProcess.make(bin, {\n bun: [\"run\", main],\n // Under Node, transparently strip TypeScript types so that `.ts`\n // entry points work the same way they do under Bun. Mirrors what\n // `dev.ts` already does for the outer process, so the dev experience\n // is symmetric on both runtimes whether the entry came from `src/`\n // (dev/tests) or `lib/` (published packages).\n node: main.endsWith(\".ts\") ? [...transformTypesFlags(), main] : [main],\n }[bin], {\n stdout: \"pipe\",\n // Piped (NOT inherited) so the child's output routes through the\n // Effect Console service: raw writes to the parent's fd corrupt the\n // test runner's reporter/TUI. The drain below is mandatory — an\n // unread pipe eventually fills and blocks the child.\n stderr: \"pipe\",\n detached: false,\n env: {\n [RPC_SERVER_ENVIRONMENT_KEY]: JSON.stringify(environment),\n },\n extendEnv: true,\n });\n const handle = yield* spawner.spawn(command);\n yield* handle.stderr.pipe(Stream.decodeText, Stream.splitLines, Stream.runForEach((line) => publish({ channel: \"stderr\", line })), Effect.ignore, Effect.forkScoped);\n // This scope is the child handle's sole owner. Graceful shutdown runs this\n // finalizer; abrupt parent loss closes the RPC parent connection and the\n // child self-terminates (both paths are covered by RpcSpawnerCleanup).\n const kill = handle.kill({ forceKillAfter: \"500 millis\" });\n yield* Effect.addFinalizer(() => kill.pipe(Effect.ignore));\n const url = yield* getRpcAddress(handle.stdout, (line) => publish({ channel: \"stdout\", line }));\n const ws = yield* Effect.acquireRelease(Effect.sync(() => new WebSocket(new URL(\"/parent\", url))), (ws) => Effect.sync(() => ws.close()));\n return {\n url,\n isRunning: Effect.zipWith(handle.isRunning, Effect.sync(() => ws.readyState === WebSocket.CONNECTING ||\n ws.readyState === WebSocket.OPEN), (a, b) => a && b, { concurrent: true }),\n kill,\n };\n });\n const register = Effect.fn(function* (serverEntryUrl, attempt = 0) {\n const child = yield* Cache.get(cache, serverEntryUrl);\n if (yield* child.isRunning) {\n return child.url;\n }\n if (attempt > 3) {\n return yield* Effect.die(new Error(`Failed to spawn RPC server for \"${serverEntryUrl}\" after ${attempt} attempts.`));\n }\n yield* child.kill;\n yield* Cache.invalidate(cache, serverEntryUrl);\n return yield* register(serverEntryUrl, attempt + 1);\n });\n const server = yield* HttpServer.HttpServer;\n const encoder = new TextEncoder();\n yield* server.serve(Effect.gen(function* () {\n const request = yield* HttpServerRequest;\n if (request.url.startsWith(LOGS_PATH)) {\n // Long-lived NDJSON stream of sidecar output. The subscriber (exec\n // child) prints these lines through its own console, which the Ink\n // renderer patches — inserting them above the progress region\n // instead of tearing it. Client disconnect interrupts the stream\n // and unregisters the subscriber.\n const queue = yield* Queue.make();\n const notify = (line) => {\n Queue.offerUnsafe(queue, encoder.encode(`${JSON.stringify(line)}\\n`));\n };\n subscribers.add(notify);\n return HttpServerResponse.stream(Stream.fromQueue(queue).pipe(Stream.ensuring(Effect.sync(() => subscribers.delete(notify)))), { contentType: \"application/x-ndjson\" });\n }\n const payload = (yield* request.json);\n const url = yield* register(payload.serverEntryUrl);\n return HttpServerResponse.text(url);\n }));\n return RpcSpawner.of({\n url: HttpServer.formatAddress(server.address),\n });\n});\nexport const layerServer = (environment) => Layer.effect(RpcSpawner, make(environment)).pipe(Layer.provide(httpServer()));\nconst RPC_ADDRESS_REGEX = /(<ALCHEMY_RPC_ADDRESS>)(.+)(<\\/ALCHEMY_RPC_ADDRESS>)/;\nconst getRpcAddress = (stdout, publish) => Effect.gen(function* () {\n const address = yield* Deferred.make();\n let done = false;\n yield* stdout.pipe(Stream.decodeText, Stream.splitLines, Stream.runForEach((line) => {\n if (done) {\n return publish(line);\n }\n const match = line.match(RPC_ADDRESS_REGEX);\n if (match) {\n done = true;\n return Deferred.succeed(address, match[2]);\n }\n return Effect.void;\n }), Effect.forkScoped);\n return yield* Deferred.await(address);\n});\nconst parseSidecarLogLine = (raw) => {\n try {\n const parsed = JSON.parse(raw);\n return typeof parsed?.line === \"string\" ? parsed : undefined;\n }\n catch {\n return undefined;\n }\n};\n/**\n * Pull sidecar output from the spawner (the outer `alchemy dev` process)\n * into THIS process's Console. The exec child owns the terminal renderer —\n * Ink patches its `console`, so lines printed here are inserted cleanly\n * above the repainting progress region instead of racing it on the shared\n * tty. Forks in the ambient scope and never fails: when no spawner is\n * configured (`ALCHEMY_RPC_SPAWNER_URL` absent — plain deploy/destroy) it is\n * a no-op, and if the connection drops the spawner's own fallback printing\n * takes over.\n */\nexport const forwardSidecarLogs = Config.string(SPAWNER_URL_ENV_KEY).pipe(Effect.flatMap((spawnerUrl) => {\n const streamOnce = Effect.gen(function* () {\n const client = yield* HttpClient.HttpClient;\n const response = yield* client.get(new URL(LOGS_PATH, spawnerUrl).toString());\n yield* response.stream.pipe(Stream.decodeText, Stream.splitLines, Stream.runForEach((raw) => Effect.suspend(() => {\n const parsed = parseSidecarLogLine(raw);\n if (parsed === undefined)\n return Effect.void;\n return parsed.channel === \"stderr\"\n ? Console.error(parsed.line)\n : Console.log(parsed.line);\n })));\n });\n // Keep the subscription alive for the whole dev session: reconnect\n // (paced) if the stream ends or errors. While disconnected the spawner's\n // fallback printing covers the gap; the loop dies with the ambient scope.\n return streamOnce.pipe(Effect.ignore, Effect.andThen(Effect.sleep(\"1 second\")), Effect.forever);\n}), Effect.ignore, Effect.forkScoped, Effect.asVoid);\n//# sourceMappingURL=RpcSpawner.js.map","import * as Effect from \"effect/Effect\";\nimport { RuntimeContext } from \"./RuntimeContext.js\";\n/**\n * Runtime context bridge that lets an {@link Action} read Resource Outputs.\n *\n * Actions are peculiar: their init Effect runs at plan/stack-eval time (before\n * any resource exists) while their body runs at apply time (after upstreams are\n * materialized). To make `yield* db.databaseId` work inside an Action we split\n * the {@link RuntimeContext} into two cooperating halves that share nothing but\n * a sanitized key:\n *\n * - {@link makeCaptureContext} is provided while the init Effect runs. Its\n * `set(key, output)` records the referenced {@link Output} (so the engine can\n * add a dependency edge and later resolve it) and its `get(key)` hands back a\n * *deferred* accessor — an Effect that re-reads whatever `RuntimeContext` is\n * ambient when it actually runs.\n * - {@link makeResolveContext} is provided around the Action body at apply\n * time. Its `get(key)` returns the already-resolved value for that key.\n *\n * Because the accessor produced at init re-reads `RuntimeContext`, yielding it\n * inside the body resolves against the apply-time context — no shared mutable\n * state, no infinite recursion (the resolve context's `get` is terminal).\n */\nconst base = (id) => ({\n Type: \"Action\",\n id,\n env: {},\n});\n/**\n * Capture context — provided while an Action's init Effect runs. Records every\n * Output referenced via `yield* output` into `captures`, keyed by the Output's\n * sanitized key, and returns deferred accessors.\n */\nexport const makeCaptureContext = (captures) => ({\n ...base(\"capture\"),\n set: (key, output) => Effect.sync(() => {\n captures[key] = output;\n return key;\n }),\n // Deferred: re-read the ambient RuntimeContext at run time. At apply this is\n // the resolve context below; its `get` returns the materialized value. The\n // `RuntimeContext` requirement is erased at the Action boundary (`Run` is\n // typed `Effect<Out, any, any>`) and satisfied by the resolve context, so\n // the accessor presents as `Effect<T | undefined>`.\n get: ((key) => Effect.flatMap(RuntimeContext, (ctx) => ctx.get(key))),\n});\n/**\n * Resolve context — provided around an Action body at apply time. `resolved`\n * maps each captured key to its value (already evaluated against the tracker).\n */\nexport const makeResolveContext = (resolved) => ({\n ...base(\"resolve\"),\n set: (key) => Effect.succeed(key),\n get: (key) => Effect.succeed(resolved[key]),\n});\n//# sourceMappingURL=ActionRuntimeContext.js.map","/**\n * The credential-demand seam for credential-free `alchemy dev`.\n *\n * A dev run whose plan is entirely local must never touch (or prompt for)\n * cloud credentials. When the plan DOES need the cloud — a resource opted\n * out of local emulation via `Alchemy.remote()`, a local Worker binding\n * that proxies to a remote resource (`dev: { remote: true }`), or the\n * deletion of a row that was last reconciled live — credentials are\n * demanded exactly once, up front, in the exec process (which owns the\n * tty), BEFORE apply begins:\n *\n * - interactive: the provider's existing `configure` flow runs, prefixed\n * with a human-readable reason naming the demanding resources\n * (threaded via {@link ConfigureContext}'s `reason`).\n * - non-interactive: fail with the typed {@link CredentialsRequired}\n * error naming the demanding resources and pointing at `alchemy login`.\n *\n * The RPC sidecar never prompts — its stdio is piped and it only ever\n * reads credentials persisted by this seam (or a prior `alchemy login`).\n *\n * Non-dev runs (`alchemy deploy` / `destroy`) never enter this seam:\n * state-store init and live providers drive the pre-existing lazy\n * credential-resolution flow unchanged.\n */\nimport * as Config from \"effect/Config\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport * as Option from \"effect/Option\";\nimport { isNonInteractive } from \"../Util/interactive.js\";\nimport { AuthProviders } from \"./AuthProvider.js\";\nimport { ALCHEMY_PROFILE, AlchemyProfile } from \"./Profile.js\";\n/**\n * A dev-mode plan needs cloud credentials, none are configured for the\n * active profile, and the process is non-interactive so the configure flow\n * cannot run. The message names the demanding resources and the fix.\n */\nexport class CredentialsRequired extends Data.TaggedError(\"CredentialsRequired\") {\n}\nconst describeReason = (reason) => {\n switch (reason) {\n case \"remote\":\n return \"runs against the real cloud via Alchemy.remote()\";\n case \"remote-binding\":\n return \"has a binding that proxies to a remote resource (dev: { remote: true })\";\n case \"live-delete\":\n return \"deletes an instance that was deployed to the real cloud\";\n }\n};\n/** `\"AWS.S3.Bucket\"` → `\"AWS\"` (the auth-provider name). */\nconst cloudOf = (type) => type.split(\".\")[0] ?? type;\nconst resourceLines = (demand) => demand.resources\n .map((r) => ` - ${r.fqn} (${describeReason(r.reason)})`)\n .join(\"\\n\");\n/**\n * Build the typed {@link CredentialsRequired} failure for a demand.\n * Exported so tests can pin the message format.\n */\nexport const credentialsRequired = (demand, profileName) => new CredentialsRequired({\n provider: demand.provider,\n resources: demand.resources.map((r) => r.fqn),\n reason: [...new Set(demand.resources.map((r) => r.reason))].join(\", \"),\n message: `${demand.provider} credentials are required, but none are configured ` +\n `for profile '${profileName}' and this process is non-interactive so ` +\n \"they can't be configured now.\\n\" +\n `These resources require ${demand.provider} credentials:\\n` +\n `${resourceLines(demand)}\\n` +\n `Run \\`alchemy login --profile ${profileName}\\` to configure ` +\n \"credentials, or set CI=1 to use environment-variable credentials.\",\n});\n/**\n * The human-readable reason shown at the top of an interactive configure\n * flow triggered by this seam (threaded via {@link ConfigureContext}).\n */\nconst demandBanner = (demand) => `This dev session requires ${demand.provider} credentials:\\n` +\n resourceLines(demand);\nconst bindingDemandsRemote = (bindings) => (bindings ?? []).some((binding) => {\n // A binding being REMOVED needs no runtime proxy — the restarted\n // local instance simply no longer carries it.\n if (binding.action === \"delete\")\n return false;\n const data = binding.data;\n return (data != null &&\n typeof data === \"object\" &&\n data.devRemote != null &&\n typeof data.devRemote === \"object\" &&\n Object.values(data.devRemote).some((remote) => remote === true));\n});\n/**\n * Scan a plan for rows that need live (cloud) credentials during a dev\n * run, grouped by cloud provider:\n *\n * 1. resources whose resolved provider mode is `\"live\"` (`Alchemy.remote()`)\n * 2. resources whose binding data carries a truthy `devRemote` entry\n * (the local runtime proxies that binding to the real cloud)\n * 3. planned deletions of rows stamped `providerMode: \"live\"`\n *\n * Pure and side-effect-free — callers gate on the run being a dev run\n * (in a live run every dual-provider row resolves `\"live\"` and the\n * pre-existing lazy credential flow applies instead).\n *\n * Mode-agnostic rows (`mode === undefined`, single-implementation\n * providers that run live even in dev) are deliberately NOT collected:\n * they resolve credentials lazily exactly as they do today.\n */\nexport const collectCredentialDemands = (plan) => {\n const byProvider = new Map();\n const add = (type, fqn, reason) => {\n const provider = cloudOf(type);\n const resources = byProvider.get(provider) ?? new Map();\n if (!resources.has(fqn))\n resources.set(fqn, reason);\n byProvider.set(provider, resources);\n };\n for (const [fqn, node] of Object.entries(plan.resources)) {\n if (node.mode === \"live\") {\n add(node.resource.Type, fqn, \"remote\");\n }\n else if (bindingDemandsRemote(node.bindings)) {\n add(node.resource.Type, fqn, \"remote-binding\");\n }\n }\n for (const [fqn, node] of Object.entries(plan.deletions)) {\n if (node !== undefined && node.mode === \"live\") {\n add(node.resource.Type, fqn, \"live-delete\");\n }\n }\n return [...byProvider.entries()].map(([provider, resources]) => ({\n provider,\n resources: [...resources.entries()].map(([fqn, reason]) => ({\n fqn,\n reason,\n })),\n }));\n};\n/**\n * Ensure credentials exist for every demand, prompting at most once per\n * provider and only when nothing is configured yet:\n *\n * - already configured for the active profile → no-op (never re-prompts)\n * - missing + interactive → the provider's `configure` flow runs (via\n * `AlchemyProfile.loadOrConfigure`), prefixed with a reason naming the\n * demanding resources\n * - missing + non-interactive (and not CI) → typed\n * {@link CredentialsRequired} failure\n * - CI → `loadOrConfigure` picks the provider's non-interactive default\n * (env-var credentials), matching every other CI path\n *\n * Demands whose cloud has no registered auth provider are skipped (bare\n * engine runs with test providers demand nothing). All context is\n * resolved optionally, so the effect is safe to run in any environment.\n */\nexport const demandCredentials = Effect.fn(\"Alchemy.demandCredentials\")(function* (demands, options) {\n if (demands.length === 0)\n return;\n const registry = Option.getOrUndefined(yield* Effect.serviceOption(AuthProviders));\n const profile = Option.getOrUndefined(yield* Effect.serviceOption(AlchemyProfile));\n if (registry === undefined || profile === undefined)\n return;\n const profileName = yield* ALCHEMY_PROFILE;\n const ci = yield* Config.boolean(\"CI\").pipe(Config.withDefault(false));\n const nonInteractive = options?.nonInteractive ?? isNonInteractive();\n for (const demand of demands) {\n const auth = registry[demand.provider];\n if (auth == null)\n continue;\n const existing = yield* profile.getProfile(profileName);\n if (existing?.[auth.name] != null)\n continue;\n if (!ci && nonInteractive) {\n return yield* credentialsRequired(demand, profileName);\n }\n const ctx = { ci, reason: demandBanner(demand) };\n yield* profile.loadOrConfigure(auth, profileName, ctx);\n }\n});\n/**\n * The one-call seam wired into the dev path: scan the plan for live\n * demand and, if any, run {@link demandCredentials} BEFORE apply begins.\n */\nexport const demandPlanCredentials = (plan, options) => demandCredentials(collectCredentialDemands(plan), options);\n//# sourceMappingURL=Demand.js.map","import * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as Output from \"./Output.js\";\nimport { isPlainData, isPrimitive, mapPlainData } from \"./Util/data.js\";\n/**\n * Returns true when `value` (or any nested leaf) is still an unresolved\n * plan-time expression — i.e. an `Output`/`Expr` or an `Effect` that was\n * not fully evaluated by `resolveInput` in Plan.ts.\n *\n * Use at the top of a provider `diff` to short-circuit before field access:\n *\n * ```ts\n * if (!isResolved(news)) return undefined;\n * const resolved = news as MyProps;\n * ```\n */\nexport const hasUnresolvedInputs = (value) => _hasUnresolved(value);\nexport const isResolved = (value) => !_hasUnresolved(value);\nconst _hasUnresolved = (value, seen = new WeakSet()) => {\n if (value == null || isPrimitive(value))\n return false;\n if (Output.isExpr(value) || Effect.isEffect(value))\n return true;\n // Only plain data is traversed; any other class instance (Layer, Context,\n // Date, SDK objects) is a resolved leaf — see isPlainData (#1082).\n if (isPlainData(value)) {\n if (seen.has(value))\n return false;\n seen.add(value);\n return Object.values(value).some((v) => _hasUnresolved(v, seen));\n }\n return false;\n};\n/**\n * Deeply replace every unresolved plan-time expression (an `Output`/`Expr`\n * or an un-evaluated `Effect`) with `undefined`, leaving resolved values\n * (including opaque `Redacted`/`Duration` instances) intact.\n *\n * Persisted resource state must only ever hold plain data. Durable (JSON)\n * state stores already enforce this implicitly — Output proxies are\n * function-typed, so `JSON.stringify` silently drops them — but the\n * in-memory store used by tests retains live proxies, which would later be\n * fed back into provider lifecycle operations as `olds` after an\n * interrupted apply (e.g. `read` during a destroy plan) and blow up on\n * first string coercion. Sanitizing at the commit boundary keeps both\n * store kinds consistent with the provider contract that `olds` is\n * resolved `Props`.\n */\nexport const stripUnresolved = (value) => _stripUnresolved(value);\nconst _stripUnresolved = (value, \n// Ancestor-path cycle guard: a value on its own ancestor chain is cut to\n// `undefined` (a cycle can never persist). Sync DFS, so add/delete around\n// the recursion is race-free and keeps shared diamond references intact\n// (#1082).\nancestors = new WeakSet()) => {\n if (value == null || isPrimitive(value))\n return value;\n if (Output.isExpr(value) || Effect.isEffect(value))\n return undefined;\n // Serializable leaves — the only class instances persisted state may\n // carry (StateEncoding knows Redacted/Duration; Date JSON-encodes).\n // Rebuilding them structurally would strip their prototype.\n if (Redacted.isRedacted(value) ||\n Duration.isDuration(value) ||\n value instanceof Date) {\n return value;\n }\n if (isPlainData(value)) {\n return mapPlainData(value, ancestors, (child) => _stripUnresolved(child, ancestors));\n }\n // Any other class instance (Layer, Context, SDK objects) is runtime-only\n // wiring that can't round-trip through JSON — a beta.103 Context is even\n // cyclic (#1082). Persisted state holds plain data only.\n return undefined;\n};\n/**\n * Deeply replace Effect-valued entries with `undefined`, leaving resolved\n * values AND unresolved `Output`/`Expr`s intact.\n *\n * Effect-valued props — e.g. a tagged Worker class in `env` (the\n * circular-bindings pattern) — can never be evaluated inside lifecycle\n * operations, and {@link stripUnresolved} drops them from persisted state at\n * the commit boundary. A provider `diff` that wants its structural change\n * detection to still run despite them strips them first, so `isResolved`\n * gates only on genuinely-unresolved Outputs (#874). The Effects' deploy-time\n * identity is carried by the resolved binding data instead.\n */\nexport const stripEffects = (value) => _stripEffects(value);\nconst _stripEffects = (value, \n// Ancestor-path cycle guard — see _stripUnresolved (#1082).\nancestors = new WeakSet()) => {\n if (value == null || isPrimitive(value))\n return value;\n // Output proxies are left intact (so `isResolved` still sees them); they\n // must be tested BEFORE `Effect.isEffect` because Output exprs are\n // yieldable and would otherwise be misclassified as plain Effects.\n if (Output.isExpr(value))\n return value;\n if (Effect.isEffect(value))\n return undefined;\n if (Redacted.isRedacted(value) ||\n Duration.isDuration(value) ||\n value instanceof Date) {\n return value;\n }\n if (isPlainData(value)) {\n return mapPlainData(value, ancestors, (child) => _stripEffects(child, ancestors));\n }\n // Non-plain instances (Layer, Context, SDK objects) are dropped with\n // Effects — same runtime-only rationale, and their internals may be\n // cyclic (effect ≥4.0.0-beta.103's Context — #1082).\n return undefined;\n};\nexport const somePropsAreDifferent = (olds, news, props) => {\n for (const prop of props) {\n if (olds[prop] !== news[prop]) {\n return true;\n }\n }\n return false;\n};\nexport const anyPropsAreDifferent = (olds, news) => {\n for (const prop in olds) {\n if (olds[prop] !== news[prop]) {\n return true;\n }\n }\n for (const prop in news) {\n if (!(prop in olds)) {\n return true;\n }\n }\n return false;\n};\nexport const havePropsChanged = (oldProps, newProps) => Output.hasOutputs(newProps) ||\n // Compare both sides through `stripUnresolved` so the comparison is\n // symmetric with the commit boundary: persisted props can never hold an\n // Effect or Output expr (stripped at commit / silently dropped by JSON\n // serialization), while desired props may still carry them — e.g. a tagged\n // Worker class in `env` serializes via its `toJSON` to\n // `{\"_id\":\"Effect\",...}` and would otherwise report a phantom change on\n // every plan, forever (#874). Unresolved Outputs in `newProps` are already\n // caught by the `hasOutputs` guard above, so stripping here never hides a\n // real difference.\n JSON.stringify(canonicalize(stripUnresolved(oldProps ?? {}), false)) !==\n JSON.stringify(canonicalize(stripUnresolved(newProps ?? {}), false));\n/**\n * Sort-keys deep equality for plain data (objects, arrays, primitives).\n * Use in provider `diff` handlers instead of ad-hoc `JSON.stringify` comparisons.\n *\n * By default, `null` and `undefined` are treated as distinct. Pass\n * `{ stripNullish: true }` to opt into treating them as equivalent.\n */\nexport const deepEqual = (a, b, options) => JSON.stringify(canonicalize(a, options?.stripNullish ?? false)) ===\n JSON.stringify(canonicalize(b, options?.stripNullish ?? false));\nconst canonicalize = (value, stripNullish, \n// Ancestor-path cycle guard — see _stripUnresolved (#1082).\nancestors = new WeakSet()) => {\n if (stripNullish && value == null)\n return undefined;\n if (Redacted.isRedacted(value)) {\n return {\n _tag: \"Redacted\",\n value: Redacted.value(value),\n };\n }\n // JSON-safe leaves compare by their serialized form (Duration/Date have\n // toJSON).\n if (Duration.isDuration(value) || value instanceof Date)\n return value;\n if (isPlainData(value)) {\n const rebuilt = mapPlainData(value, ancestors, (child) => canonicalize(child, stripNullish, ancestors));\n if (rebuilt === undefined || Array.isArray(rebuilt))\n return rebuilt;\n // Deterministic key order for the JSON.stringify comparison. Filtering\n // after the walk is JSON-equivalent to filtering before it —\n // undefined-valued keys are dropped by JSON.stringify either way.\n return Object.fromEntries(Object.entries(rebuilt)\n .filter(([, nested]) => !stripNullish || nested != null)\n .sort(([a], [b]) => a.localeCompare(b)));\n }\n if (value && typeof value === \"object\") {\n // Non-plain instances (Effect, Layer, Context, SDK objects) never\n // canonicalize — walking them is unsafe (cyclic on effect\n // ≥4.0.0-beta.103 — #1082) and comparing them is meaningless.\n return undefined;\n }\n return value;\n};\n/**\n * Deterministic ordering for binding rows.\n *\n * Bindings are registered by concurrently-built layers (a Function/Worker's\n * capability layers run real IO — bundling, fs — before calling `host.bind`),\n * so the registration order of `stack.bindings[fqn]` is not stable across\n * deploys. `diffBindings` itself is sid-keyed and order-insensitive, but the\n * row order flows into provider `diff`/`reconcile` inputs and persisted\n * state — any consumer that hashes or deep-compares the binding array (e.g.\n * a metadata hash over bindings) would churn on registration-order flips.\n * Sorting by `sid` at every boundary makes binding rows stable.\n */\nconst bySid = (a, b) => a.sid < b.sid ? -1 : a.sid > b.sid ? 1 : 0;\nexport const sortBindings = (bindings) => [...bindings].sort(bySid);\n/**\n * Collapse bindings that share the same `sid`, keeping the last occurrence,\n * and return them in deterministic (sid-sorted) order.\n *\n * The same binding can be recorded more than once on a target resource — e.g.\n * a KV namespace bound to both a Worker and a Workflow ends up pushed twice to\n * `stack.bindings[fqn]`. `diffBindings` already collapses these implicitly via\n * its `Map` keyed by `sid`, so the `reconcile` path never observes duplicates.\n * Use this helper to give a provider's `diff` handler the same de-duplicated\n * binding set, keeping plan-time hashing consistent with deploy-time.\n */\nexport const dedupeBindings = (bindings) => sortBindings(Array.from(new Map(bindings.map((b) => [b.sid, b])).values()));\nexport const diffBindings = (oldBindings, newBindings) => {\n const oldMap = new Map(oldBindings.map((b) => [b.sid, b]));\n const newMap = new Map(newBindings.map((b) => [b.sid, b]));\n return sortBindings([\n ...Array.from(oldMap)\n .filter(([sid]) => !newMap.has(sid))\n .map(([sid, old]) => ({\n sid,\n action: \"delete\",\n data: old.data,\n })),\n ...Array.from(newMap).map(([sid, binding]) => {\n const old = oldMap.get(sid);\n return {\n sid,\n action: (!old\n ? \"create\"\n : havePropsChanged(old.data, binding.data)\n ? \"update\"\n : \"noop\"),\n data: binding.data,\n };\n }),\n ]);\n};\n//# sourceMappingURL=Diff.js.map","import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\n/** A 16-byte (128-bit) random hex-encoded string representing an physical instance of a logical resource */\nexport class InstanceId extends Context.Service()(\"instance-id\") {\n}\n/**\n * @returns Hex-encoded instance ID (16 random bytes)\n */\nexport const generateInstanceId = () => Effect.sync(() => {\n const bytes = new Uint8Array(16);\n crypto.getRandomValues(bytes);\n return Array.from(bytes)\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\");\n});\n//# sourceMappingURL=InstanceId.js.map","import * as Effect from \"effect/Effect\";\nexport const assertDefined = (value, message) => {\n if (!value) {\n throw new Error(message);\n }\n return value;\n};\nexport const asEffect = (effect) => typeof effect?.asEffect === \"function\"\n ? effect.asEffect()\n : Effect.isEffect(effect)\n ? effect\n : Effect.succeed(effect);\n//# sourceMappingURL=types.js.map","import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport { makeCaptureContext } from \"./ActionRuntimeContext.js\";\nimport { toFqn } from \"./FQN.js\";\nimport { CurrentNamespace } from \"./Namespace.js\";\nimport * as Output from \"./Output.js\";\nimport { RuntimeContext } from \"./RuntimeContext.js\";\nimport { Stack } from \"./Stack.js\";\nexport const isAction = (value) => typeof value === \"object\" && value !== null && value?.Kind === \"action\";\nexport function Action(...args) {\n if (args.length === 0) {\n // Tagged form: Action<Self, In, Out>()(type)\n return (type) => makeActionClass(type, undefined);\n }\n // Inline form: Action(type, runnerOrInit)\n const [type, initOrRun] = args;\n return makeActionClass(type, initOrRun);\n}\nconst isRunnerEffect = (v) => Effect.isEffect(v);\nconst makeActionClass = (type, baked) => {\n // Pre-resolve baked init/runner into a single Effect<Runner, _, Req>. Use\n // Effect.cached so the init's body runs at most once per process — every\n // action instance after the first reuses the resolved runner without paying\n // the init cost (or re-yielding its dependencies).\n let resolveRunner;\n if (baked !== undefined) {\n resolveRunner = isRunnerEffect(baked)\n ? Effect.runSync(Effect.cached(baked))\n : Effect.succeed(baked);\n }\n // Tagged form needs a Context tag so the user can supply the runner\n // through a Layer. Inline form bakes the runner in and skips the tag.\n const SelfTag = baked\n ? undefined\n : Context.Service(`alchemy/Action<${type}>`);\n // Outputs referenced via `yield* output` inside the init Effect land here,\n // recorded by the capture RuntimeContext. Shared per definition — the init\n // runs at most once (Effect.cached), so captures are inherently\n // per-definition, matching how the init's `Req` bubbles per definition.\n const captures = {};\n const captureContext = makeCaptureContext(captures);\n const constructor = (...args) => {\n const [id, input] = args.length === 1 ? [type, args[0]] : args;\n return Effect.gen(function* () {\n const run = resolveRunner\n ? yield* resolveRunner.pipe(Effect.provideService(RuntimeContext, captureContext))\n : (yield* SelfTag);\n return yield* registerAction(type, id, input, run, captures);\n });\n };\n const extra = { Type: type };\n if (SelfTag) {\n extra.Self = SelfTag;\n // `.make(initOrRun)` — accepts either a direct runner or an init Effect.\n // For init form we use `Layer.effect` so the init's Req surfaces on the\n // Layer, and run it under the capture RuntimeContext so `yield* output`\n // accessors are recorded just like the inline form; for runners we use\n // `Layer.succeed` (nothing to capture).\n extra.make = (initOrRun) => isRunnerEffect(initOrRun)\n ? Layer.effect(SelfTag, initOrRun.pipe(Effect.provideService(RuntimeContext, captureContext)))\n : Layer.succeed(SelfTag, initOrRun);\n }\n return Object.assign(constructor, extra);\n};\nconst registerAction = (type, id, input, run, captures) => Effect.gen(function* () {\n const stack = yield* Stack;\n const namespace = yield* CurrentNamespace;\n const fqn = toFqn(namespace, id);\n const actions = (stack.actions ??= {});\n const existing = actions[fqn];\n if (existing)\n return Output.of(existing);\n // FQN collision check: actions share the same FQN namespace as resources\n // so the dependency graph stays unified. Rejecting overlaps here makes\n // the constraint obvious at registration time.\n if (stack.resources[fqn]) {\n return yield* Effect.die(new Error(`Action '${fqn}' collides with a Resource of the same logical id`));\n }\n const target = {\n Kind: \"action\",\n Type: type,\n Namespace: namespace,\n FQN: fqn,\n LogicalId: id,\n Input: input,\n Captures: captures,\n Run: run,\n Output: undefined,\n };\n target.toString = () => `Action<${type}>(${id})`;\n actions[fqn] = target;\n // `yield* Sync({...})` returns `Output<Out>`. The engine writes the\n // materialized value into `tracker[fqn]` during apply; `Output.of(action)`\n // resolves a ResourceExpr by looking up `outputs[fqn]` — which is\n // precisely that materialized value. Property access into the returned\n // Output chains through the standard PropExpr proxy.\n return Output.of(target);\n});\n//# sourceMappingURL=Action.js.map","import * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Metric from \"effect/Metric\";\n/**\n * Counter for resource lifecycle operations. Tagged per call with\n * `resource_type`, `op` (`precreate`/`create`/`update`/`delete`/`read`),\n * and `status` (`success`/`error`).\n */\nexport const resourceCounter = Metric.counter(\"alchemy.resource.operations\", {\n description: \"Number of resource lifecycle operations dispatched by alchemy apply.\",\n incremental: true,\n});\n/**\n * Histogram of how long each lifecycle operation takes.\n */\nexport const resourceDuration = Metric.timer(\"alchemy.resource.duration\", {\n description: \"Wall-clock duration of resource lifecycle operations dispatched by alchemy apply.\",\n});\n/**\n * Counter for CLI command invocations.\n */\nexport const cliCounter = Metric.counter(\"alchemy.cli.invocations\", {\n description: \"Number of alchemy CLI command invocations.\",\n incremental: true,\n});\n/**\n * Counter for Cloudflare State Store bootstrap/deploy operations.\n * Tagged per call with `op` (e.g. `deploy`) and `status`\n * (`success`/`error`) so that the deploy success rate of the\n * state store itself can be tracked separately from regular\n * resource lifecycle ops.\n */\nexport const stateStoreCounter = Metric.counter(\"alchemy.state_store.operations\", {\n description: \"Number of Cloudflare State Store deploy/bootstrap operations dispatched by alchemy.\",\n incremental: true,\n});\n/**\n * Counter for State store layer construction. Tagged with `id` (the\n * `StateService.id` slug) so we can answer \"how many distinct projects\n * are using each backend\" from the corresponding `state_store.init`\n * spans. Open-ended on purpose: third-party state stores get counted\n * automatically by setting their `StateService.id`.\n */\nexport const stateStoreInitCounter = Metric.counter(\"alchemy.state_store.inits\", {\n description: \"Number of times a State store layer is constructed.\",\n incremental: true,\n});\n/**\n * Wraps a resource lifecycle Effect to record a counter + timer entry,\n * tagged with `resource_type`, `op`, and `status` (`success`/`error`).\n *\n * Usage:\n * ```ts\n * provider.reconcile(input).pipe(recordResourceOp(node.resource.Type, \"create\"))\n * ```\n */\nexport const recordResourceOp = (resourceType, op) => (self) => Effect.suspend(() => {\n const startNs = process.hrtime.bigint();\n const baseAttrs = { resource_type: resourceType, op };\n return self.pipe(Effect.onExit((exit) => recordOutcome(baseAttrs, Exit.isSuccess(exit) ? \"success\" : \"error\", elapsed(startNs))));\n});\n/**\n * Wraps a CLI command Effect to bump {@link cliCounter} with the\n * outcome (`success`/`error`).\n */\nexport const recordCli = (command) => (self) => self.pipe(Effect.onExit((exit) => Metric.update(Metric.withAttributes(cliCounter, {\n command,\n status: Exit.isSuccess(exit) ? \"success\" : \"error\",\n}), 1)));\n/**\n * Wraps a Cloudflare State Store deploy/bootstrap Effect to bump\n * {@link stateStoreCounter} with the outcome (`success`/`error`),\n * tagged with the given `op`.\n */\nexport const recordStateStoreOp = (op) => (self) => self.pipe(Effect.onExit((exit) => Metric.update(Metric.withAttributes(stateStoreCounter, {\n op,\n status: Exit.isSuccess(exit) ? \"success\" : \"error\",\n}), 1)));\n/**\n * Wraps a State store construction Effect to:\n *\n * 1. Bump {@link stateStoreInitCounter} tagged with `id`.\n * 2. Open a `state_store.init` span carrying\n * `alchemy.state_store.id` so Axiom (which can't query metric\n * datasets via APL) can group projects by backend.\n *\n * The `id` is read off the constructed `StateService.id` field, so any\n * third-party state-store implementation gets tracked just by setting\n * a stable slug there. Apply at every `Layer.effect(State, …)` site\n * exactly once.\n */\nexport const recordStateStoreInit = (self) => \n// The debug lines bracket the first phase of a deploy that can block on\n// credential resolution (see `Auth/Lock.ts`). Without them a stalled\n// deploy produces no output at all, at any log level, and there is\n// nothing to tell \"hung\" apart from \"slow\".\nEffect.logDebug(\"state store: initializing\").pipe(Effect.andThen(self), Effect.tap((service) => Effect.all([\n Effect.logDebug(`state store: ready (${service.id})`),\n Metric.update(Metric.withAttributes(stateStoreInitCounter, { id: service.id }), 1),\n Effect.annotateCurrentSpan(\"alchemy.state_store.id\", service.id),\n], { discard: true })), Effect.withSpan(\"state_store.init\"));\nconst elapsed = (startNs) => Duration.nanos(process.hrtime.bigint() - startNs);\nconst recordOutcome = (baseAttrs, status, duration) => {\n const attrs = { ...baseAttrs, status };\n return Effect.all([\n Metric.update(Metric.withAttributes(resourceCounter, attrs), 1),\n Metric.update(Metric.withAttributes(resourceDuration, attrs), duration),\n ], { discard: true });\n};\n//# sourceMappingURL=Metrics.js.map","/**\n * Compute the set of graph nodes that participate in a dependency cycle.\n *\n * A node is considered \"in a cycle\" iff it sits in a strongly-connected\n * component (SCC) of size > 1, or has a self-edge (size-1 SCC that loops\n * back to itself).\n *\n * Implementation is iterative Tarjan's algorithm to avoid blowing the JS\n * call stack on very wide graphs.\n */\nexport const findCycleMembers = (edges) => {\n const cycleMembers = new Set();\n let index = 0;\n const indexOf = new Map();\n const lowlink = new Map();\n const onStack = new Set();\n const stack = [];\n const callStack = [];\n const startNode = (node) => {\n indexOf.set(node, index);\n lowlink.set(node, index);\n index += 1;\n stack.push(node);\n onStack.add(node);\n callStack.push({ node, childIdx: 0 });\n };\n for (const root of Object.keys(edges)) {\n if (indexOf.has(root))\n continue;\n startNode(root);\n while (callStack.length > 0) {\n const frame = callStack[callStack.length - 1];\n const children = edges[frame.node] ?? [];\n if (frame.childIdx < children.length) {\n const child = children[frame.childIdx];\n frame.childIdx += 1;\n if (!indexOf.has(child)) {\n startNode(child);\n continue;\n }\n if (onStack.has(child)) {\n lowlink.set(frame.node, Math.min(lowlink.get(frame.node), indexOf.get(child)));\n }\n continue;\n }\n // All children processed: maybe close an SCC.\n if (lowlink.get(frame.node) === indexOf.get(frame.node)) {\n const scc = [];\n for (;;) {\n const w = stack.pop();\n onStack.delete(w);\n scc.push(w);\n if (w === frame.node)\n break;\n }\n if (scc.length > 1) {\n for (const fqn of scc)\n cycleMembers.add(fqn);\n }\n else {\n // Size-1 SCC: only counts as a cycle if it has a self-edge.\n const only = scc[0];\n if ((edges[only] ?? []).includes(only)) {\n cycleMembers.add(only);\n }\n }\n }\n // Pop frame and propagate lowlink up to the parent.\n callStack.pop();\n const parent = callStack[callStack.length - 1];\n if (parent) {\n const cur = lowlink.get(parent.node);\n const childLow = lowlink.get(frame.node);\n if (childLow < cur)\n lowlink.set(parent.node, childLow);\n }\n }\n }\n return cycleMembers;\n};\n//# sourceMappingURL=scc.js.map","import * as Effect from \"effect/Effect\";\nimport { stableValue } from \"./stable.js\";\nexport const sha256 = (input) => Effect.promise(async () => {\n const digest = await crypto.subtle.digest(\"SHA-256\", toArrayBuffer(input));\n const hashArray = Array.from(new Uint8Array(digest));\n return hashArray.map((b) => b.toString(16).padStart(2, \"0\")).join(\"\");\n});\nexport const sha256Object = (input) => sha256(JSON.stringify(stableValue(input)));\n/**\n * Stable sha256 hex digest of a resolved Task input. Unlike\n * {@link sha256Object} this does not stabilize key ordering — it hashes the\n * raw `JSON.stringify(input ?? null)` so identical inputs map to identical\n * hashes for caching/equality checks.\n */\nexport const hashInput = (input) => sha256(JSON.stringify(input ?? null));\nconst toArrayBuffer = (input) => {\n if (input instanceof ArrayBuffer) {\n return input;\n }\n if (typeof input === \"string\") {\n return new TextEncoder().encode(input);\n }\n return input.buffer.slice(input.byteOffset, input.byteOffset + input.byteLength);\n};\n//# sourceMappingURL=sha256.js.map","/** @effect-diagnostics anyUnknownInErrorContext:off */\n/** @effect-diagnostics missingEffectError:off */\nimport * as Config from \"effect/Config\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport * as Option from \"effect/Option\";\nimport { asEffect } from \".//Util/types.js\";\nimport { isAction } from \"./Action.js\";\nimport { AdoptPolicy, OwnedBySomeoneElse, stripUnowned, Unowned, } from \"./AdoptPolicy.js\";\nimport { AlchemyContext } from \"./AlchemyContext.js\";\nimport { Artifacts, ArtifactStore, createArtifactStore, ensureArtifactStore, makeScopedArtifacts, } from \"./Artifacts.js\";\nimport { dedupeBindings, diffBindings, havePropsChanged, isResolved, } from \"./Diff.js\";\nimport { parseFqn } from \"./FQN.js\";\nimport { generateInstanceId, InstanceId } from \"./InstanceId.js\";\nimport * as Output from \"./Output.js\";\nimport { findProviderByType, missingProviderError, Provider, providerForMode, tryFindProviderByType, } from \"./Provider.js\";\nimport { defaultProviderMode, stampedMode, } from \"./ProviderMode.js\";\nimport { isResource, missingImplementation, } from \"./Resource.js\";\nimport {} from \"./Stack.js\";\nimport { isActionState, State, } from \"./State/index.js\";\nimport { isPlainData, mapPlainData } from \"./Util/data.js\";\nimport { findCycleMembers } from \"./Util/scc.js\";\nimport { hashInput } from \"./Util/sha256.js\";\nexport const isCRUD = (node) => {\n return (node &&\n typeof node === \"object\" &&\n (node.action === \"create\" ||\n node.action === \"update\" ||\n node.action === \"replace\" ||\n node.action === \"noop\"));\n};\nexport const make = (stack, options = {}) => \n// @ts-expect-error\nEffect.gen(function* () {\n const state = yield* yield* State;\n const resources = Object.values(stack.resources);\n const actions = Object.values(stack.actions ?? {});\n // A bare platform tag yields a forward reference registered with\n // `undefined` props (and `RequiresImplementation`); its `.make(props,\n // impl)` Layer repairs the props when it builds (in either order — the\n // #874 circular env-tag pattern). Props still `undefined` after the\n // whole program evaluated means the tag was yielded but its Layer was\n // never provided — fail fast naming the class and its Layer instead of\n // letting a provider read `undefined` props (#1054). Plain resources\n // may legitimately be yielded without props (a reference to\n // already-deployed state), so the check is scoped to platform tags.\n for (const resource of resources) {\n if (resource.RequiresImplementation && resource.Props === undefined) {\n yield* Effect.die(missingImplementation(resource.Type, resource.LogicalId));\n }\n }\n // TODO(sam): rename terminology to Stack\n const stackName = stack.name;\n const stage = stack.stage;\n // Resolve the effective adoption setting for this plan. AdoptPolicy\n // (provided by the CLI or scoped via `adopt(...)`) takes precedence; if\n // unset, fall back to the AlchemyContext's `adopt` default; otherwise\n // adoption is disabled.\n const shouldAdopt = Effect.gen(function* () {\n const fromService = yield* Effect.serviceOption(AdoptPolicy);\n if (Option.isSome(fromService))\n return fromService.value;\n const ctx = yield* Effect.serviceOption(AlchemyContext);\n return Option.match(ctx, {\n onNone: () => false,\n onSome: (c) => c.adopt,\n });\n });\n // The run-level default provider mode (`alchemy dev` → \"local\",\n // `alchemy deploy` → \"live\"). A resource-scoped `remote()` (captured on\n // the resource at registration as `Mode`) opts out of local emulation.\n const runDefaultMode = yield* defaultProviderMode;\n /**\n * Resolve the effective provider mode and the concrete provider\n * service for a resource.\n *\n * The mode only \"sticks\" when the provider actually distinguishes\n * modes (registered via `ProviderLayer.dual`). Mode-agnostic providers\n * satisfy any requested mode with their single implementation — in a\n * dev run, a construct that mixes emulatable resources with live-only\n * ones (e.g. R2 buckets) just works.\n */\n const resolveProviderAndMode = Effect.fn(function* (resource) {\n const base = yield* findProviderByType(resource.Type);\n const mode = base.modes !== undefined\n ? (resource.Mode ?? runDefaultMode)\n : undefined;\n const provider = yield* providerForMode(base, mode);\n return { provider, mode };\n });\n /**\n * Has this resource switched provider modes since it was last\n * reconciled? Rows without a persisted mode were written by a\n * pre-provider-mode engine (or a provider that only became dual-mode\n * later) — their physical resource is LIVE unless its attrs carry a\n * `dev:` identity marker proving it was reconciled locally (see\n * {@link stampedMode}). A dev run replaces unstamped live rows exactly\n * like stamped live rows; live runs replace unstamped marker rows.\n */\n const hasModeSwitched = (mode, oldState) => mode !== undefined &&\n oldState !== undefined &&\n stampedMode(oldState) !== mode;\n const resourceFqns = yield* state.list({\n stack: stackName,\n stage: stage,\n });\n const oldResources = yield* Effect.all(resourceFqns.map((fqn) => state.get({ stack: stackName, stage: stage, fqn })), { concurrency: \"unbounded\" });\n // Snapshot of every persisted row, keyed by FQN. The rename resolution\n // below reads from this map instead of issuing per-FQN `state.get`s —\n // every renamedFrom-decorated resource (each StaticSite carries one\n // forever) would otherwise add two round-trips per resource to every\n // plan against a remote state store. Plan is read-only, so the\n // snapshot cannot go stale within this run.\n const persistedRows = new Map(resourceFqns.map((fqn, i) => [fqn, oldResources[i]]));\n // ── FQN renames ──────────────────────────────────────────────────────\n // Map every former FQN claimed via `renamedFrom(...)` to its claimant's\n // current FQN. Two resources claiming the same former FQN is ambiguous\n // and fatal. A former FQN MAY still be actively declared — that is the\n // \"old id reused by a new resource\" case: the rename claim wins the\n // row (it is an explicit user statement that the row was theirs), and\n // the reusing resource plans a fresh create.\n const formerFqnClaims = new Map();\n for (const resource of resources) {\n for (const formerFqn of resource.FormerFqns ?? []) {\n if (formerFqn === resource.FQN)\n continue;\n const claimant = formerFqnClaims.get(formerFqn);\n if (claimant !== undefined && claimant !== resource.FQN) {\n return yield* Effect.die(new Error(`Resources '${claimant}' and '${resource.FQN}' both claim ` +\n `former FQN '${formerFqn}' via renamedFrom(...). A former ` +\n \"FQN can migrate to exactly one resource — remove the \" +\n \"decoration from one of them.\"));\n }\n formerFqnClaims.set(formerFqn, resource.FQN);\n }\n }\n // Resolve every rename migration up-front against the state snapshot,\n // BEFORE any node is built — other resources' planning depends on the\n // outcome (a resource declared at a former FQN whose row is migrating\n // away must start from scratch).\n //\n // For each renamer, in former-id declaration order (most recent\n // first):\n //\n // - `source` is the row that defines the resource's physical identity:\n // the row at its own FQN when present AND type-matching, otherwise\n // the first type-matching former row (→ `moved`).\n // - every OTHER type-matching former row sharing `source.instanceId`\n // is a leftover from an interrupted migration (only migration copies\n // instanceIds) — collected for state-only cleanup.\n // - former rows with a different instanceId belong to someone else and\n // are left to normal orphan handling; former rows with a different\n // resourceType (modulo registered type-aliases) can never be this\n // resource's row and are skipped entirely.\n // - a FOREIGN-typed row at the renamer's own FQN blocks the migration\n // fatally: landing the migrated row there would silently abandon\n // that row's cloud resource.\n const renameMigrations = new Map();\n const migratedRowFqns = new Set();\n const resolveRenamer = Effect.fn(function* (resource) {\n const provider = Option.getOrUndefined(yield* tryFindProviderByType(resource.Type));\n const allowedTypes = new Set([\n resource.Type,\n ...(provider?.aliases ?? []),\n ]);\n const persisted = persistedRows.get(resource.FQN);\n const persistedRow = isActionState(persisted)\n ? undefined\n : persisted;\n // A row at this resource's own FQN that a PREVIOUSLY RESOLVED\n // renamer claimed (a same-deploy shift: A→B while B→C — C took the\n // row at B) is moving away: it is not ours to keep and it does not\n // block the migration landing here.\n const rowTaken = migratedRowFqns.has(resource.FQN);\n const ownRow = !rowTaken &&\n persistedRow !== undefined &&\n allowedTypes.has(persistedRow.resourceType)\n ? persistedRow\n : undefined;\n let source = ownRow;\n let adopted = ownRow;\n const renamedFrom = [];\n for (const formerFqn of resource.FormerFqns) {\n if (formerFqnClaims.get(formerFqn) !== resource.FQN)\n continue;\n // The same former id may be listed twice (or resolve identically);\n // collect each former row once.\n if (renamedFrom.includes(formerFqn))\n continue;\n const formerPersisted = persistedRows.get(formerFqn);\n if (formerPersisted === undefined || isActionState(formerPersisted)) {\n continue;\n }\n const formerRow = formerPersisted;\n if (!allowedTypes.has(formerRow.resourceType))\n continue;\n if (source === undefined) {\n source = formerRow;\n adopted = {\n ...formerRow,\n fqn: resource.FQN,\n logicalId: resource.LogicalId,\n namespace: resource.Namespace,\n };\n renamedFrom.push(formerFqn);\n }\n else if (source.instanceId === formerRow.instanceId) {\n renamedFrom.push(formerFqn);\n }\n }\n if (renamedFrom.length === 0)\n return;\n if (persistedRow !== undefined && ownRow === undefined && !rowTaken) {\n return yield* Effect.die(new Error(`Cannot migrate '${renamedFrom[0]}' to '${resource.FQN}': a ` +\n `state row of a different type ('${persistedRow.resourceType}') ` +\n `already occupies '${resource.FQN}'. Migrating over it would ` +\n \"silently abandon that row's cloud resource. Delete or \" +\n \"rename the conflicting resource first, then re-deploy.\"));\n }\n renameMigrations.set(resource.FQN, {\n row: adopted,\n renamedFrom,\n moved: adopted !== ownRow,\n });\n for (const formerFqn of renamedFrom)\n migratedRowFqns.add(formerFqn);\n });\n // Resolve renamers in claim-dependency order: when resource R's OWN\n // FQN is claimed as a former id by resource S (a same-deploy shift:\n // A→B while B→C), S must resolve first — whether S takes R's row\n // decides whether R still owns it, or falls back to ITS former rows.\n // Iterate to fixpoint; anything left is a claim CYCLE (a swap: A⇄B),\n // which cannot be persisted safely — the migrations would overwrite\n // and delete each other's rows — and dies loudly.\n let pendingRenamers = resources.filter((r) => r.FormerFqns?.length);\n const resolvedRenamers = new Set();\n while (pendingRenamers.length > 0) {\n const ready = pendingRenamers.filter((resource) => {\n const claimant = formerFqnClaims.get(resource.FQN);\n return claimant === undefined || resolvedRenamers.has(claimant);\n });\n if (ready.length === 0) {\n return yield* Effect.die(new Error(`Rename cycle detected among [${pendingRenamers\n .map((r) => `'${r.FQN}'`)\n .join(\", \")}]: their renamedFrom(...) declarations claim each other's ` +\n \"FQNs. Swapping ids in one deploy is not supported — rename \" +\n \"through a temporary id across two deploys instead.\"));\n }\n for (const resource of ready) {\n yield* resolveRenamer(resource);\n resolvedRenamers.add(resource.FQN);\n }\n pendingRenamers = pendingRenamers.filter((r) => !resolvedRenamers.has(r.FQN));\n }\n /**\n * Fetch the persisted row for a declared resource, resolving renames\n * (see the pre-computed `renameMigrations` above):\n *\n * - a renamer plans from its migrated row (`renamedFrom` rides onto\n * the plan node; apply persists the move before any lifecycle op)\n * - a resource declared at a former FQN whose row is migrating away\n * starts from scratch — the row is NOT its state, whatever the FQN\n * says\n */\n const getPersistedRow = Effect.fn(function* (resource) {\n const migration = renameMigrations.get(resource.FQN);\n if (migration !== undefined) {\n return {\n row: migration.row,\n renamedFrom: migration.renamedFrom,\n renameMoved: migration.moved,\n };\n }\n const persisted = yield* state.get({\n stack: stackName,\n stage: stage,\n fqn: resource.FQN,\n });\n const row = isActionState(persisted)\n ? undefined\n : persisted;\n if (row !== undefined && migratedRowFqns.has(resource.FQN)) {\n return { row: undefined, renamedFrom: undefined, renameMoved: false };\n }\n return { row, renamedFrom: undefined, renameMoved: false };\n });\n const resolvedResources = {};\n const resolveResource = (resourceExpr) => Effect.gen(function* () {\n // Tasks share the ResourceExpr machinery but have no provider /\n // stable-properties story at plan time. Leave the expression\n // unsubstituted — Apply resolves it from the tracker at run time.\n if (isAction(resourceExpr.src)) {\n return resourceExpr;\n }\n // @ts-expect-error\n return yield* (resolvedResources[resourceExpr.src.FQN] ??=\n yield* Effect.cached(Effect.gen(function* () {\n const resource = resourceExpr.src;\n const { provider, mode } = yield* resolveProviderAndMode(resource);\n const props = materializeStableRefs(yield* resolveInput(resource.Props));\n // Falls back to the row at a former FQN (`renamedFrom`) so a\n // renamed resource's stable attributes keep flowing to\n // downstream diffs across the migration.\n const { row: oldState } = yield* getPersistedRow(resource);\n if (!oldState || oldState.status === \"creating\") {\n return resourceExpr;\n }\n // The resource is switching provider modes (local ⇄ live):\n // it will be replaced, so nothing about the persisted attrs\n // is stable for downstream consumers.\n if (hasModeSwitched(mode, oldState)) {\n return resourceExpr;\n }\n const oldProps = oldState.status === \"updating\"\n ? oldState.old.props\n : oldState.props;\n // Normalize both sides through `dedupeBindings` so the binding\n // sets handed to `diff` are deduped AND sid-sorted — provider\n // diffs that hash/compare the arrays never churn on\n // registration-order flips (or on legacy unsorted state).\n const oldBindings = dedupeBindings(oldState.bindings ?? []);\n const newBindings = dedupeBindings(stack.bindings[resource.FQN] ?? []);\n const diff = yield* provider.diff\n ? provider\n .diff({\n id: resource.LogicalId,\n fqn: resource.FQN,\n olds: oldProps,\n instanceId: oldState.instanceId,\n news: props,\n output: oldState.attr,\n oldBindings,\n newBindings,\n })\n .pipe(providePlanScope(resource.FQN, oldState.instanceId))\n : Effect.succeed(undefined);\n // A present `diff.stables` is authoritative for this update and\n // overrides `provider.stables`. We only fall back to the\n // provider-level \"always stable\" list when the diff does not\n // return one (e.g. no diff fn, or a diff that omits `stables`).\n const stables = diff?.stables ?? provider.stables ?? [];\n const withStables = (output) => stables.length > 0\n ? new Output.ResourceExpr(resourceExpr.src, Object.fromEntries(stables.map((stable) => [stable, output?.[stable]])))\n : // if there are no stable properties, treat every property as changed\n resourceExpr;\n if (diff == null) {\n if (havePropsChanged(oldProps, props)) {\n // the props have changed but the provider did not provide any hints as to what is stable\n // so we must assume everything has changed\n return withStables(oldState?.attr);\n }\n }\n else if (diff.action === \"update\") {\n return withStables(oldState?.attr);\n }\n else if (diff.action === \"replace\") {\n return resourceExpr;\n }\n // `--force` upgrades this resource's noop to an update (see the\n // diff mapping in the resource-graph pass below), so its\n // `reconcile` WILL re-run and may produce fresh attributes —\n // that is the point of --force. Returning the persisted attr\n // snapshot here would bake potentially-stale values into every\n // consumer's plan props and binding data, so consumers would\n // keep the stale attrs even though the upstream just\n // re-reconciled. Expose only the stable attributes and let\n // apply re-evaluate the rest against the forced reconcile's\n // fresh output.\n if (options.force) {\n return withStables(oldState?.attr);\n }\n if (oldState.status === \"created\" ||\n oldState.status === \"updated\" ||\n oldState.status === \"replaced\") {\n // we can safely return the attributes if we know they have stabilized\n return oldState?.attr;\n }\n else {\n // we must assume the resource doesn't exist if it hasn't stabilized\n return resourceExpr;\n }\n })));\n });\n /**\n * Resolve an input value as far as *truth* permits, keeping everything\n * else evaluable. A whole-resource reference to an updating upstream\n * stays a `ResourceExpr` (its stable attributes riding along): the\n * non-stable attributes are unknown at plan time and MUST be\n * re-evaluated — Apply runs `Output.evaluate(node.props, outputs)`\n * against the upstream's fresh post-reconcile attributes right before\n * `reconcile`. This is the value plan nodes carry; the diff-facing view\n * is derived from it by {@link materializeStableRefs}.\n */\n const resolveInput = (input, \n // Ancestor chain of the current walk. A value that appears on its own\n // ancestor path is a true cycle and is cut to `undefined` (a cycle can\n // never persist or serialize anyway); an immutable per-level set (not\n // a shared visited-set) keeps legitimately-shared diamond references\n // intact and is race-free under `concurrency: \"unbounded\"` (#1082).\n ancestors = new Set()) => Effect.gen(function* () {\n if (!input) {\n return input;\n }\n else if (Output.isExpr(input)) {\n return yield* resolveOutput(input);\n }\n else if (Config.isConfig(input)) {\n // Config is a lazy reference to the deploy environment. Resolve it\n // here so the concrete value flows into diffing/hashing (an opaque\n // Config hashes the same regardless of the underlying value) and so\n // providers receive a resolved value instead of a Config object.\n // `Config.redacted` resolves to a `Redacted`, which stays opaque via\n // the branch below.\n return yield* resolveInput(yield* input, ancestors);\n }\n else if (isResource(input)) {\n // Resource objects have dynamic properties (path, hash, etc.) that are\n // created on-demand by a Proxy getter and aren't enumerable via Object.entries.\n // Resolve the ResourceExpr to get the actual resource output, then continue\n // resolving any nested outputs in the result.\n const resourceExpr = Output.of(input);\n const resolved = yield* resolveOutput(resourceExpr);\n if (Output.isResourceExpr(resolved)) {\n // Still-unresolved reference (creating, replacing, or updating\n // upstream) — keep it evaluable for Apply.\n return resolved;\n }\n return yield* resolveInput(resolved, ancestors);\n }\n else if (isPlainData(input)) {\n if (ancestors.has(input)) {\n return undefined;\n }\n const nested = new Set(ancestors).add(input);\n if (Array.isArray(input)) {\n return yield* Effect.all(input.map((item) => resolveInput(item, nested)), { concurrency: \"unbounded\" });\n }\n return Object.fromEntries(yield* Effect.all(Object.entries(input).map(([key, value]) => resolveInput(value, nested).pipe(Effect.map((value) => [key, value]))), { concurrency: \"unbounded\" }));\n }\n // Everything else is an opaque leaf returned by identity: Duration,\n // Redacted, Date, and effect runtime values (a Worker's `exports`\n // carries each DO's `constructor` Effect and captured `services`\n // Context). Rebuilding a class instance entry-by-entry would strip\n // its prototype, and effect ≥4.0.0-beta.103's Context is cyclic\n // (#1082). Redacted additionally stays wrapped to preserve the\n // secrecy boundary. This sits after `Config.isConfig` on purpose —\n // Configs are Effects but must still resolve.\n return input;\n });\n /**\n * Project a {@link resolveInput} resolution into the DIFF-facing view:\n * replace each whole-resource `ResourceExpr` that carries stable\n * attributes (an upstream being *updated* in place — see `withStables` in\n * `resolveResource`) with a plain object of those stables, so the known\n * values flow into the consumer's `diff` and `havePropsChanged` instead\n * of the whole reference looking unresolved and `isResolved`\n * short-circuiting (#670 — this forced the Neon `Branch` to hand-extract\n * `project.projectId`).\n *\n * The projection is deliberately lossy — diffs compare VALUES. Plan nodes\n * never carry it: they keep the evaluable resolution so `reconcile` sees\n * the upstream's fresh non-stable attributes (e.g. a Lambda Version's\n * `version` number — #993's alias promotion bug).\n */\n const materializeStableRefs = (input, \n // Ancestor-path cycle guard — see resolveInput (#1082). Sync DFS, so\n // add/delete around the recursion is race-free.\n ancestors = new WeakSet()) => {\n // Expr checks come first: Output proxies are callable, so a plain\n // `typeof input === \"object\"` guard would let them slip through.\n if (Output.isResourceExpr(input) && input.stables) {\n return materializeStableRefs(input.stables, ancestors);\n }\n else if (Output.isExpr(input)) {\n // Genuinely unknown (e.g. a creating upstream) — nothing to show diff.\n return input;\n }\n else if (!input || !isPlainData(input)) {\n // Primitives and non-plain instances (Duration, Redacted, Date,\n // Effect/Layer/Context) are leaves — see isPlainData (#1082).\n return input;\n }\n return mapPlainData(input, ancestors, (child) => materializeStableRefs(child, ancestors));\n };\n const resolveOutput = (expr) => Effect.gen(function* () {\n if (Output.isResourceExpr(expr)) {\n return yield* resolveResource(expr);\n }\n else if (Output.isPropExpr(expr)) {\n const upstream = yield* resolveOutput(expr.expr);\n return upstream?.[expr.identifier];\n }\n else if (Output.isApplyExpr(expr)) {\n const upstream = yield* resolveOutput(expr.expr);\n return Output.hasOutputs(upstream) ? expr : expr.f(upstream);\n }\n else if (Output.isEffectExpr(expr)) {\n const upstream = yield* resolveOutput(expr.expr);\n return Output.hasOutputs(upstream) ? expr : yield* expr.f(upstream);\n }\n else if (Output.isFlatMapExpr(expr)) {\n const upstream = yield* resolveOutput(expr.expr);\n // Source still unresolved -> keep the flatMap intact for a later pass.\n // Otherwise run `f` to produce the next Output and resolve into it.\n return Output.hasOutputs(upstream)\n ? expr\n : yield* resolveOutput(Output.asOutput(expr.f(upstream)));\n }\n else if (Output.isAllExpr(expr)) {\n return yield* Effect.all(expr.outs.map(resolveOutput), {\n concurrency: \"unbounded\",\n });\n }\n else if (Output.isLiteralExpr(expr)) {\n return expr.value;\n }\n else if (Output.isRefExpr(expr)) {\n const refStack = expr.stack ?? stackName;\n const refStage = expr.stage ?? stage;\n const refState = yield* state\n .get({\n stack: refStack,\n stage: refStage,\n fqn: expr.resourceId,\n })\n .pipe(Effect.orDie);\n if (!refState) {\n return yield* Effect.die(new Output.InvalidReferenceError({\n message: `Reference to '${expr.resourceId}' in stack '${refStack}' and stage '${refStage}' not found. Have you deployed '${refStage}' of '${refStack}'?`,\n stack: refStack,\n stage: refStage,\n resourceId: expr.resourceId,\n }));\n }\n return refState.attr ?? refState.output;\n }\n else if (Output.isStackRefExpr(expr)) {\n const refStack = expr.stack;\n const refStage = expr.stage ?? stage;\n const output = yield* state\n .getOutput({\n stack: refStack,\n stage: refStage,\n })\n .pipe(Effect.orDie);\n if (output == null) {\n return yield* Effect.die(new Output.InvalidReferenceError({\n message: `Reference to stack '${refStack}' at stage '${refStage}' not found. Have you deployed stage '${refStage}' of '${refStack}'?`,\n stack: refStack,\n stage: refStage,\n resourceId: refStack,\n }));\n }\n return output;\n }\n else if (Output.isNamedExpr(expr)) {\n return yield* resolveOutput(expr.expr);\n }\n return yield* Effect.die(new Error(\"Not implemented yet\" + expr.kind));\n });\n // map of resource FQN -> its downstream dependencies (resources that depend on it)\n const oldDownstreamDependencies = Object.fromEntries(oldResources\n .filter((resource) => !!resource)\n .map((resource) => [resource.fqn, resource.downstream]));\n // Build a set of FQNs for the new resources to detect orphans\n const newResourceFqns = new Set(resources.map((r) => r.FQN));\n const newActionFqns = new Set(actions.map((t) => t.FQN));\n // Unified set used wherever the DAG must include both kinds.\n const newNodeFqns = new Set([...newResourceFqns, ...newActionFqns]);\n // Map FQN -> list of upstream FQNs (resources this one depends on via props).\n // Tasks contribute upstream edges through their `Input` expression.\n const newUpstreamDependencies = Object.fromEntries([\n ...resources.map((resource) => [\n resource.FQN,\n Object.values(Output.upstreamAny(resource.Props)).map((r) => r.FQN),\n ]),\n ...actions.map((action) => [\n action.FQN,\n // An Action depends on the resources referenced by its Input *and*\n // any Output captured via `yield* output` inside its init Effect.\n Array.from(new Set([\n ...Object.values(Output.upstreamAny(action.Input)).map((r) => r.FQN),\n ...Object.values(Output.upstreamAny(action.Captures)).map((r) => r.FQN),\n ])),\n ]),\n ]);\n // Map FQN -> list of upstream FQNs from bindings\n const bindingUpstreamDependencies = Object.fromEntries(resources.map((resource) => [\n resource.FQN,\n Object.values(Output.upstreamAny(stack.bindings[resource.FQN] ?? [])).map((r) => r.FQN),\n ]));\n // Combined prop + binding upstream for the desired graph, including\n // references to resources outside the current graph so delete validation can\n // tell whether any surviving resource still points at an orphan.\n const rawUpstreamDependencies = Object.fromEntries([\n ...resources.map((resource) => {\n const fqn = resource.FQN;\n const propDeps = newUpstreamDependencies[fqn] ?? [];\n const bindDeps = bindingUpstreamDependencies[fqn] ?? [];\n return [fqn, [...new Set([...propDeps, ...bindDeps])]];\n }),\n // Actions have no bindings — their upstream is input + init captures,\n // both already folded into newUpstreamDependencies above.\n ...actions.map((action) => {\n const fqn = action.FQN;\n return [fqn, newUpstreamDependencies[fqn] ?? []];\n }),\n ]);\n // Combined prop + binding upstream, filtered to resources/tasks in this\n // graph for scheduling and cycle detection.\n const allUpstreamDependencies = Object.fromEntries([\n ...resources.map((resource) => {\n const fqn = resource.FQN;\n const deps = rawUpstreamDependencies[fqn] ?? [];\n return [fqn, deps.filter((dep) => newNodeFqns.has(dep))];\n }),\n ...actions.map((action) => {\n const fqn = action.FQN;\n const deps = newUpstreamDependencies[fqn] ?? [];\n return [fqn, deps.filter((dep) => newNodeFqns.has(dep))];\n }),\n ]);\n // Resources that participate in a cycle when both prop and binding\n // edges are considered. Used below to decide whether an acyclic\n // binding edge should also become a downstream edge.\n const combinedCycleMembers = findCycleMembers(allUpstreamDependencies);\n // Map FQN -> list of downstream FQNs (resources/actions that depend on\n // this one).\n //\n // Prop edges always become downstream edges — they can't form cycles\n // (the resource graph is a DAG by construction once props are fully\n // resolved). Binding edges become downstream edges too, except when\n // they participate in a cycle in the combined graph: mutual bindings\n // (A binds to B's data, B binds to A's data) intentionally do not\n // create downstream edges, so deletion does not deadlock waiting on\n // each other (see the \"binding-only cycles inside a construct\" test\n // in `plan.test.ts`).\n //\n // Including acyclic binding edges is required for cloud APIs that\n // enforce the binding at the provider level — e.g. a Cloudflare\n // Worker with a `service` binding to another Worker cannot delete\n // the upstream worker until the downstream worker's binding has been\n // removed. Without the binding edge in `downstream`, the two delete\n // concurrently and the upstream delete fails with\n // `ServiceBindingConflict`.\n //\n // Actions don't have bindings, so for action upstreams we use only\n // prop edges (which collapse to `newUpstreamDependencies` lookups).\n const computeDownstream = (upFqn) => {\n const downstream = [];\n for (const [downFqn, upstreams] of Object.entries(rawUpstreamDependencies)) {\n if (downFqn === upFqn)\n continue;\n if (!upstreams.includes(upFqn))\n continue;\n const isPropEdge = (newUpstreamDependencies[downFqn] ?? []).includes(upFqn);\n if (isPropEdge) {\n downstream.push(downFqn);\n continue;\n }\n // Binding-only edge — exclude when both endpoints sit inside\n // the same SCC of the combined graph.\n if (combinedCycleMembers.has(upFqn) &&\n combinedCycleMembers.has(downFqn)) {\n continue;\n }\n downstream.push(downFqn);\n }\n return downstream;\n };\n const newDownstreamDependencies = Object.fromEntries([\n ...resources.map((resource) => [resource.FQN, computeDownstream(resource.FQN)]),\n ...actions.map((action) => [action.FQN, computeDownstream(action.FQN)]),\n ]);\n const resourceGraph = Object.fromEntries((yield* Effect.all(resources.map(Effect.fn(\"plan.diff.resource\")(function* (resource) {\n const { provider, mode } = yield* resolveProviderAndMode(resource);\n const id = resource.LogicalId;\n const fqn = resource.FQN;\n // Apply-facing props (stored on the plan node): whole-resource\n // references to updating upstreams stay evaluable `ResourceExpr`s.\n // Apply runs `Output.evaluate(node.props, outputs)` right before\n // `reconcile`, so these references resolve to the upstream's\n // fresh post-reconcile attributes.\n const applyProps = yield* resolveInput(resource.Props);\n // Diff-facing view of the same resolution: stable attributes\n // materialized so their known values flow into `diff` /\n // `havePropsChanged`.\n const news = materializeStableRefs(applyProps);\n const downstream = newDownstreamDependencies[fqn] ?? [];\n // Apply-facing binding rows, mirroring `applyProps`: payloads\n // whose data embeds a whole-resource reference to an updating\n // upstream keep it as an evaluable `ResourceExpr`. Apply runs\n // `Output.evaluate(node.bindings, outputs)` right before\n // `reconcile`, so the host receives the upstream's fresh\n // post-reconcile attributes. Collapse duplicates by sid so the\n // binding set handed to `diff` matches what `reconcile` receives\n // (see `dedupeBindings`).\n const applyBindings = dedupeBindings(yield* resolveInput(stack.bindings[fqn] ?? []));\n // Diff-facing view of the same rows: stable attributes\n // materialized so `diffBindings` / `provider.diff` compare known\n // values. Terminal commits still persist the payload the provider\n // actually reconciled with (#874) — Apply commits the evaluated\n // `bindingOutputs`, not these plan-time shapes.\n const newBindings = materializeStableRefs(applyBindings);\n // The row is looked up at the resource's FQN with a fallback to\n // its former FQNs (`renamedFrom`); a row found under a former\n // FQN arrives here already remapped to the new identity, and\n // `renamedFrom` rides onto the plan node so apply persists the\n // move. (A Task previously holding this FQN is treated as no\n // prior state — its row is reaped by `actionDeletions` below.)\n const { row: persistedRow, renamedFrom, renameMoved, } = yield* getPersistedRow(resource);\n let oldState = persistedRow;\n // Engine-level adoption. When there is no prior state, always\n // consult `provider.read` (if implemented) so the engine — not\n // each lifecycle method — owns the existence/ownership decision.\n //\n // The provider returns one of:\n // - `undefined` → resource doesn't exist; create it\n // - plain attrs → exists and is owned by us; silent adopt\n // - `Unowned(attrs)` → exists but is *not* ours\n //\n // Routing:\n // - owned → adopt the `created` state\n // from attrs and continue\n // through the normal diff\n // path (so subsequent props\n // drift produces an update).\n // - unowned + adopt enabled → take over: adopt the\n // `created` state and let the\n // next update overwrite tags.\n // - unowned + adopt disabled → fail with\n // `OwnedBySomeoneElse`.\n //\n // Plan construction is side-effect-free: the adopted `created`\n // state is only held in-memory here (to drive the diff) and rides\n // onto the plan node as `node.state`. Persisting it to the state\n // store happens exclusively during APPLY of that node (the update\n // lifecycle commits `updating` / `updated` carrying this state).\n // If planning persisted here, a mere `alchemy plan` / `--dry-run`\n // would claim ownership of an unowned cloud resource, arming a\n // later unrelated deploy to orphan-delete it. See\n // https://github.com/alchemy-run/alchemy/issues/793.\n //\n // After a cold-start adoption (engine just discovered an\n // existing cloud resource via `read`), force the engine's\n // normal `update` path so the provider can re-sync ownership\n // tags, configuration, etc. against the desired props.\n // Adoption carries state with `props: news`, so the default\n // diff sees no drift and would noop — which would leave any\n // foreign-owned tags / divergent config in place. Forcing\n // update keeps the deploy idempotent: if cloud state already\n // matches news, the provider's update is a no-op write.\n //\n // Skip the adoption probe entirely when `news` still contains\n // unresolved upstream Outputs (e.g. a `streamArn` referencing\n // a stream being created in the same plan). Calling `read` with\n // an unresolved value would surface as `ParseError` from the\n // SDK protocol layer. Resources whose props depend on\n // not-yet-created upstreams cannot themselves be pre-existing\n // — there's nothing to adopt.\n // A resource declared at a former FQN whose row just migrated\n // away is genuinely NEW by declaration — skip the probe. Its\n // predecessor's physical resource still carries tags branded\n // with THIS logical id (the migrated row's reconcile hasn't\n // re-branded them yet), so a tag-based `read` would find it\n // and silently adopt the very resource that was renamed away.\n const reusesMigratedFqn = migratedRowFqns.has(fqn);\n let forceUpdateAfterAdoption = false;\n if (oldState === undefined &&\n provider.read &&\n isResolved(news) &&\n !reusesMigratedFqn) {\n const adoptInstanceId = yield* generateInstanceId();\n const readResult = yield* provider\n .read({\n id,\n fqn,\n instanceId: adoptInstanceId,\n olds: news,\n output: undefined,\n })\n .pipe(providePlanScope(fqn, adoptInstanceId));\n if (readResult !== undefined) {\n const isUnowned = Unowned.is(readResult);\n // A resource-scoped `adopt(...)` (captured on the resource at\n // registration) overrides the stack/CLI default.\n const adoptThis = resource.Adopt ?? (yield* shouldAdopt);\n if (isUnowned && !adoptThis) {\n return yield* new OwnedBySomeoneElse({\n message: `Cannot adopt resource '${fqn}' (${resource.Type}): ` +\n \"it exists in the cloud but is not owned by this \" +\n \"stack/stage/logical-id. Re-run with `--adopt` (or \" +\n \"wrap the effect in `adopt(true)`) to take it over.\",\n resourceType: resource.Type,\n logicalId: id,\n });\n }\n const adoptedState = {\n status: \"created\",\n fqn,\n logicalId: id,\n instanceId: adoptInstanceId,\n namespace: resource.Namespace,\n resourceType: resource.Type,\n props: news,\n attr: stripUnowned(readResult),\n providerVersion: provider.version ?? 0,\n bindings: [],\n downstream,\n removalPolicy: resource.RemovalPolicy,\n providerMode: mode,\n };\n // In-memory only — do NOT persist here. Plan.make runs for\n // `alchemy plan` / `deploy --dry-run` too, so a `state.set`\n // would mutate persistent state during a read-only preview.\n // The adopted state rides onto the plan node via `oldState`\n // (→ `node.state`) and is persisted at APPLY time by the\n // update lifecycle's `updating` / `updated` commits. See\n // https://github.com/alchemy-run/alchemy/issues/793.\n oldState = adoptedState;\n forceUpdateAfterAdoption = true;\n }\n }\n // Sid-sorted like `newBindings` (see the resolveResource note).\n const oldBindings = dedupeBindings(oldState?.bindings ?? []);\n // Actions come from the materialized comparison (`newBindings`);\n // the payloads the node carries into Apply come from the\n // apply-faithful rows, joined by sid — both are views of the same\n // deduped `stack.bindings[fqn]` rows, so action and payload can\n // never drift. `delete` rows keep the persisted old data.\n const applyBindingData = new Map(applyBindings.map((b) => [b.sid, b.data]));\n const bindingDiffs = diffBindings(oldBindings, newBindings).map((b) => b.action === \"delete\" || !applyBindingData.has(b.sid)\n ? b\n : { ...b, data: applyBindingData.get(b.sid) });\n // Local ⇄ live switch: the persisted row was reconciled by a\n // different provider mode than the one resolved for this run.\n // The two runtimes host distinct physical instances, so this is\n // always a replacement — the new instance is created with the\n // new mode's provider, and Apply deletes the old generation\n // with the provider of the mode that created it (see\n // `deleteOldGenerations` / `collectGarbage`).\n const modeSwitched = hasModeSwitched(mode, oldState);\n const Node = (node) => ({\n ...node,\n provider,\n resource,\n bindings: bindingDiffs,\n downstream,\n mode,\n renamedFrom,\n });\n // Plan against the persisted state we have, not the ideal final state we\n // hoped to reach last time. Recovery is expressed by mapping each\n // intermediate state back onto a fresh CRUD action.\n if (oldState === undefined) {\n return Node({\n action: \"create\",\n props: applyProps,\n state: oldState,\n });\n }\n else if (!modeSwitched &&\n oldState.status === \"creating\" &&\n oldState.attr === undefined) {\n // A create may have succeeded before state persistence failed. If the\n // provider can recover an attribute snapshot, keep driving the same\n // create instead of starting over blindly.\n //\n // `creating` state persists the RAW plan-time props, which may\n // still contain unresolved Output expressions (e.g. a name\n // referencing an upstream created in the same failed deploy).\n // `read` implementations derive identity from `olds` when\n // `output` is undefined (as it is here), so handing them\n // unresolved exprs crashes. Skip the probe — same behavior as\n // a read that found nothing — and re-drive the create.\n if (provider.read && isResolved(oldState.props)) {\n const attr = yield* provider\n .read({\n id,\n fqn,\n instanceId: oldState.instanceId,\n olds: oldState.props,\n output: oldState.attr,\n })\n .pipe(providePlanScope(fqn, oldState.instanceId), \n // `creating` props pass `isResolved` yet can still carry\n // holes where unresolved Outputs were stripped at commit\n // time (see stripUnresolved) — e.g. a parent reference\n // persisted as `{}`. A provider that dereferences one\n // crashes deep inside its SDK client (a SchemaError\n // defect), which would brick every subsequent plan on\n // the stage. Recovery is best-effort: degrade the defect\n // to \"nothing recovered\" and re-drive the create (#995).\n Effect.catchDefect((defect) => Effect.logWarning(`Recovery read for '${fqn}' crashed; treating the ` +\n \"interrupted create as not recoverable and \" +\n \"re-driving it.\", defect).pipe(Effect.as(undefined))));\n if (attr !== undefined) {\n // The recovered resource may be foreign: our interrupted\n // create could have lost a name race, or died before\n // stamping ownership. Route `Unowned` through the same\n // adoption table as the cold-start probe above — never\n // silently take over (and later mutate/delete) a resource\n // we cannot prove we created.\n if (Unowned.is(attr)) {\n const adoptThis = resource.Adopt ?? (yield* shouldAdopt);\n if (!adoptThis) {\n return yield* new OwnedBySomeoneElse({\n message: `Cannot resume creating resource '${fqn}' ` +\n `(${resource.Type}): a resource with its physical ` +\n \"identity exists in the cloud but is not owned by \" +\n \"this stack/stage/logical-id. Re-run with `--adopt` \" +\n \"(or wrap the effect in `adopt(true)`) to take it \" +\n \"over.\",\n resourceType: resource.Type,\n logicalId: id,\n });\n }\n }\n // Continue through the normal diff below with the recovered\n // live snapshot. Desired props may have changed while the\n // previous create was interrupted; bypassing diff here can\n // drive an immutable change through reconcile and falsely\n // persist the old physical resource as converged.\n oldState = { ...oldState, attr: stripUnowned(attr) };\n }\n }\n }\n // Diff against whatever props represent the best-known current attempt.\n // For replacement recovery that means the top-level replacement props,\n // not the older generations stored under `old`.\n const oldProps = oldState.props;\n // On a mode switch the provider diff is skipped entirely:\n // comparing props across runtimes is meaningless (and the new\n // mode's provider has never seen the old mode's state). The\n // action is a replacement by definition.\n const diff = modeSwitched\n ? {\n action: \"replace\",\n deleteFirst: false,\n }\n : yield* asEffect(provider\n ?.diff?.({\n id,\n fqn,\n olds: oldProps,\n instanceId: oldState.instanceId,\n output: oldState.attr,\n news,\n oldBindings,\n newBindings,\n })\n .pipe(providePlanScope(fqn, oldState.instanceId))).pipe(Effect.map((diff) => diff ??\n {\n action: havePropsChanged(oldProps, news) ||\n bindingDiffs.some((b) => b.action !== \"noop\")\n ? \"update\"\n : \"noop\",\n }), Effect.map((diff) => options.force && diff.action === \"noop\"\n ? {\n action: \"update\",\n }\n : diff), \n // After a cold-start adoption (silent or takeover), force at\n // least an update so the provider re-syncs ownership tags /\n // config against the desired props (otherwise the engine\n // would noop and any drift between the existing cloud\n // resource and `news` — including foreign-owned tags after a\n // takeover — would persist).\n //\n // A row that just migrated from a former FQN (`renameMoved`)\n // gets the same treatment: its cloud resource is still\n // branded with the OLD logical id's tags, and if the old id\n // is being reused by a new resource, leaving them stale\n // would let the reuser's future adoption probes match the\n // wrong physical resource.\n Effect.map((diff) => (forceUpdateAfterAdoption || renameMoved) &&\n diff.action === \"noop\"\n ? { action: \"update\" }\n : diff));\n if (oldState.status === \"creating\") {\n if (diff.action === \"noop\") {\n // we're in the creating state and props are un-changed\n // let's just continue where we left off\n return Node({\n action: \"create\",\n props: applyProps,\n state: oldState,\n });\n }\n else if (diff.action === \"update\") {\n // props have changed in a way that is updatable\n // again, just continue with the create\n // TODO(sam): should we maybe try an update instead?\n return Node({\n action: \"create\",\n props: applyProps,\n state: oldState,\n });\n }\n else {\n // props have changed in an incompatible way\n // because it's possible that an un-updatable resource has already been created\n // we must use a replace step to create a new one and delete the potential old one\n return Node({\n action: \"replace\",\n props: applyProps,\n deleteFirst: diff.deleteFirst ?? false,\n state: oldState,\n });\n }\n }\n else if (oldState.status === \"updating\") {\n // Updating already targets the live resource, so noop/update both mean\n // \"finish the interrupted update\". Only a replace diff escalates it\n // into a fresh replacement.\n if (diff.action === \"update\" || diff.action === \"noop\") {\n // we can continue where we left off\n return Node({\n action: \"update\",\n props: applyProps,\n state: oldState,\n });\n }\n else {\n // we started to update a resource but now believe we should replace it\n return Node({\n action: \"replace\",\n deleteFirst: diff.deleteFirst ?? false,\n props: applyProps,\n // TODO(sam): can Apply handle replacements when the oldState is UpdatingResourceState?\n // -> or should we do a provider.read to try and reconcile back to UpdatedResourceState?\n state: oldState,\n });\n }\n }\n else if (oldState.status === \"replacing\") {\n // The replacement candidate is still being created. Noop/update keep\n // driving the same generation; replace means that candidate itself is\n // now obsolete and must be wrapped in a new outer generation.\n if (diff.action === \"noop\") {\n // this is the stable case - noop means just continue with the replacement\n return Node({\n action: \"replace\",\n deleteFirst: oldState.deleteFirst,\n props: applyProps,\n state: oldState,\n });\n }\n else if (diff.action === \"update\") {\n // potential problem here - the props have changed since we tried to replace,\n // but not enough to trigger another replacement. the resource provider should\n // be designed as idempotent to converge to the right state when creating the new resource\n // the newly generated instanceId is intended to assist with this\n return Node({\n action: \"replace\",\n deleteFirst: oldState.deleteFirst,\n props: applyProps,\n state: oldState,\n });\n }\n else {\n // The in-flight replacement candidate itself now needs replacement.\n // Mark this as a restart so Apply creates a fresh generation instead\n // of resuming the old replacement instance.\n return Node({\n restart: true,\n action: \"replace\",\n deleteFirst: diff.deleteFirst ?? oldState.deleteFirst,\n props: applyProps,\n state: oldState,\n });\n }\n }\n else if (oldState.status === \"replaced\") {\n // The new resource already exists. Noop means \"just let GC finish\",\n // update means \"mutate the current replacement before GC finishes\",\n // and replace means \"the current replacement also became obsolete\".\n if (diff.action === \"noop\") {\n // this is the stable case - noop means just continue cleaning up the replacement\n return Node({\n action: \"replace\",\n deleteFirst: oldState.deleteFirst,\n props: applyProps,\n state: oldState,\n });\n }\n else if (diff.action === \"update\") {\n // the replacement has been created but now also needs to be updated\n // the resource provider should:\n // 1. Update the newly created replacement resource\n // 2. Then proceed as normal to delete the replaced resources (after all downstream references are updated)\n return Node({\n action: \"update\",\n props: applyProps,\n state: oldState,\n });\n }\n else {\n // Cleanup is still pending, but the current \"new\" resource has already\n // become obsolete. Start another replacement generation and preserve\n // the existing replaced node as part of the recursive old chain.\n return Node({\n restart: true,\n action: \"replace\",\n deleteFirst: diff.deleteFirst ?? oldState.deleteFirst,\n props: applyProps,\n state: oldState,\n });\n }\n }\n else if (oldState.status === \"deleting\") {\n // we're in a partially deleted state, it is unclear whether it was or was not deleted\n // so continue by re-creating it with the same instanceId and desired props\n return Node({\n action: \"create\",\n props: applyProps,\n state: {\n ...oldState,\n status: \"creating\",\n props: news,\n },\n });\n }\n else if (diff.action === \"update\") {\n // Stable created/updated resources follow the normal CRUD mapping.\n return Node({\n action: \"update\",\n adopting: forceUpdateAfterAdoption,\n props: applyProps,\n state: oldState,\n });\n }\n else if (diff.action === \"replace\") {\n return Node({\n action: \"replace\",\n props: applyProps,\n state: oldState,\n deleteFirst: diff?.deleteFirst ?? false,\n });\n }\n else {\n return Node({\n action: \"noop\",\n state: oldState,\n });\n }\n })), { concurrency: \"unbounded\" })).map((update) => [update.resource.FQN, update]));\n // ── Action plan nodes ────────────────────────────────────────────────\n const actionGraph = Object.fromEntries((yield* Effect.all(actions.map(Effect.fn(\"plan.diff.action\")(function* (action) {\n const fqn = action.FQN;\n const downstream = newDownstreamDependencies[fqn] ?? [];\n // The node carries the RAW input expression (evaluated at apply);\n // the drift hash uses the diff-facing view so stable upstream\n // attributes hash as their known values.\n const resolvedInput = materializeStableRefs(yield* resolveInput(action.Input));\n const inputHash = yield* hashInput(resolvedInput);\n const oldState = yield* state.get({\n stack: stackName,\n stage,\n fqn,\n });\n if (oldState && !isActionState(oldState)) {\n // FQN collision with a resource — surface as a fatal error so\n // the user resolves it before we touch anything.\n return [\n fqn,\n {\n kind: \"action\",\n action: \"run\",\n def: action,\n input: action.Input,\n state: undefined,\n downstream,\n forced: false,\n },\n ];\n }\n const prior = oldState;\n const sameInput = prior?.status === \"ran\" && prior.inputHash === inputHash;\n if (sameInput && !options.force) {\n return [\n fqn,\n {\n kind: \"action\",\n action: \"noop\",\n def: action,\n state: prior,\n downstream,\n },\n ];\n }\n return [\n fqn,\n {\n kind: \"action\",\n action: \"run\",\n def: action,\n input: action.Input,\n state: prior,\n downstream,\n forced: !!options.force,\n },\n ];\n })), { concurrency: \"unbounded\" })));\n // SCC membership of the combined upstream graph. Apply uses it to\n // decide whether an update node must publish its prior attr early to\n // break a cycle, or can simply wait for upstreams like a DAG node\n // (the common case). Computed once, above, for the downstream graph.\n const cycleMembers = combinedCycleMembers;\n // Detect unsatisfiable dependency cycles among create/replace nodes.\n // Update/noop nodes signal their Deferred before waitForDeps when in a\n // cycle so they cannot deadlock. Create/replace nodes only signal\n // early when they have a precreate handler. Simulate the concurrent\n // execution: precreate nodes are immediately \"resolved\", then\n // iteratively resolve any node whose deps are all resolved. Remaining\n // nodes would deadlock.\n {\n const createReplaceNodes = new Set(Object.entries(resourceGraph)\n .filter(([_, node]) => node.action === \"create\" || node.action === \"replace\")\n .map(([fqn]) => fqn));\n if (createReplaceNodes.size > 0) {\n const hasPrecreate = new Set([...createReplaceNodes].filter((fqn) => !!resourceGraph[fqn]?.provider?.precreate));\n const resolved = new Set(hasPrecreate);\n let changed = true;\n while (changed) {\n changed = false;\n for (const fqn of createReplaceNodes) {\n if (resolved.has(fqn))\n continue;\n const deps = (allUpstreamDependencies[fqn] ?? []).filter((dep) => createReplaceNodes.has(dep));\n if (deps.every((dep) => resolved.has(dep))) {\n resolved.add(fqn);\n changed = true;\n }\n }\n }\n const deadlocked = [...createReplaceNodes].filter((fqn) => !resolved.has(fqn));\n if (deadlocked.length > 0) {\n const missingPrecreate = deadlocked.filter((fqn) => !hasPrecreate.has(fqn));\n return yield* Effect.die(new UnsatisfiedResourceCycle({\n message: `Circular dependency detected that cannot be resolved: [${deadlocked.join(\", \")}]. ` +\n `Resources lacking a precreate handler: [${missingPrecreate.join(\", \")}]. ` +\n `All resources in a dependency cycle must implement precreate to allow early signaling.`,\n cycle: deadlocked,\n missingPrecreate,\n }));\n }\n }\n }\n // Task deletions: state rows previously written by tasks that no\n // longer appear in the stack. The body is NOT invoked — we just drop\n // the row.\n const actionDeletions = Object.fromEntries((yield* Effect.all((yield* state.list({ stack: stackName, stage })).map(Effect.fn(\"plan.diff.actionDeletion\")(function* (fqn) {\n if (newActionFqns.has(fqn) || newResourceFqns.has(fqn))\n return;\n const persisted = yield* state.get({\n stack: stackName,\n stage,\n fqn,\n });\n if (!isActionState(persisted))\n return;\n const { logicalId } = parseFqn(fqn);\n return [\n fqn,\n {\n kind: \"action\",\n action: \"delete\",\n state: persisted,\n downstream: persisted.downstream ?? [],\n def: {\n Kind: \"action\",\n Namespace: persisted.namespace,\n FQN: fqn,\n LogicalId: logicalId,\n Type: persisted.actionType,\n Input: persisted.input,\n Captures: {},\n Run: () => undefined,\n Output: undefined,\n },\n },\n ];\n })), { concurrency: \"unbounded\" })).filter((v) => !!v));\n const deletions = Object.fromEntries((yield* Effect.all((yield* state.list({ stack: stackName, stage: stage })).map(Effect.fn(\"plan.diff.deletion\")(function* (fqn) {\n if (newResourceFqns.has(fqn) || newActionFqns.has(fqn)) {\n return;\n }\n const persisted = yield* state.get({\n stack: stackName,\n stage: stage,\n fqn,\n });\n // Tasks are routed through `actionDeletions` above.\n if (isActionState(persisted))\n return;\n const oldState = persisted;\n if (oldState) {\n // A row being migrated by a rename (`renameMigrations`) is\n // moving, not orphaned — apply drops it state-only after\n // committing the migrated row at its new FQN. Rows at former\n // FQNs that did NOT migrate (foreign type, different\n // instanceId, unclaimed) are absent from this set and fall\n // through to normal orphan deletion.\n if (migratedRowFqns.has(fqn)) {\n return;\n }\n const { logicalId } = parseFqn(fqn);\n const resourceType = oldState.resourceType;\n // A \"zombie\" row references a type with no registered provider\n // (removed from the program, or renamed without an alias).\n // That is fatal: the program and state disagree, and without\n // the provider the row's physical resource cannot be deleted\n // anyway. Die at plan time with a typed error naming the row\n // and the remediation instead of limping into a partial apply.\n //\n // Orphan deletes resolve the provider variant for the mode\n // that created the row (`providerMode`, or the `dev:` marker\n // inference for legacy unstamped rows), so e.g. a local dev\n // worker's row is deleted by the local provider even during a\n // live deploy — and vice versa. Unstamped rows are physically\n // live unless their attrs carry the marker (see stampedMode),\n // never the run default.\n const rowMode = stampedMode(oldState);\n const providerOption = yield* tryFindProviderByType(resourceType, rowMode);\n if (Option.isNone(providerOption)) {\n return yield* Effect.die(missingProviderError(resourceType, fqn));\n }\n const provider = providerOption.value;\n // NOTE: an attr-less row (interrupted create) is NOT recovered\n // here. Apply's `deleteResource` performs the authoritative\n // read-then-delete recovery — it also covers replaced-chain\n // old generations that never pass through plan, and routes\n // `Unowned` results away from `provider.delete`.\n return [\n fqn,\n {\n action: \"delete\",\n state: oldState,\n provider: provider,\n mode: oldState.providerMode,\n resource: {\n Namespace: oldState.namespace,\n FQN: fqn,\n LogicalId: logicalId,\n Type: oldState.resourceType,\n Attributes: oldState.attr,\n Props: oldState.props,\n Binding: undefined,\n Provider: Provider(resourceType),\n RemovalPolicy: oldState.removalPolicy,\n Adopt: undefined,\n RequiresImplementation: undefined,\n Mode: oldState.providerMode,\n FormerFqns: undefined,\n RuntimeContext: undefined,\n Providers: undefined,\n },\n downstream: oldDownstreamDependencies[fqn] ?? [],\n bindings: oldState.bindings.map((binding) => ({\n sid: binding.sid,\n action: \"delete\",\n data: binding.data,\n })),\n },\n ];\n }\n })), { concurrency: \"unbounded\" })).filter((v) => !!v));\n for (const resourceFqn of Object.keys(deletions)) {\n const dependencies = Object.entries(rawUpstreamDependencies)\n .filter(([survivorFqn, upstream]) => survivorFqn in resourceGraph && upstream.includes(resourceFqn))\n .map(([survivorFqn]) => survivorFqn);\n if (dependencies.length > 0) {\n return yield* new DeleteResourceHasDownstreamDependencies({\n message: `Resource ${resourceFqn} has downstream dependencies`,\n resourceId: resourceFqn,\n dependencies,\n });\n }\n }\n return {\n resources: resourceGraph,\n actions: actionGraph,\n deletions,\n actionDeletions,\n output: stack.output,\n cycleMembers,\n defaultMode: runDefaultMode,\n };\n}).pipe(ensureArtifactStore, Effect.withSpan(\"plan.make\", {\n attributes: {\n \"alchemy.stack\": stack.name,\n \"alchemy.stage\": stack.stage,\n \"alchemy.resources.count\": Object.keys(stack.resources).length,\n \"alchemy.force\": !!options.force,\n },\n}));\n/**\n * Build the plan that destroys every resource of `(stack.name, stack.stage)`.\n *\n * The spec is emptied out so every persisted resource becomes an orphan\n * deletion, and `output` is left undefined so `apply` does not overwrite the\n * last deploy's persisted stack output with an empty husk. `apply` recognizes\n * the `destroy` marker and deletes the stage's remaining persisted state (the\n * stack output record) once the destroy has converged, so `state.getOutput`\n * and `state.listStages` agree the stage is gone.\n *\n * @see https://github.com/alchemy-run/alchemy/issues/961\n */\nexport const destroy = (stack) => make({\n name: stack.name,\n stage: stack.stage,\n resources: {},\n bindings: {},\n actions: {},\n output: undefined,\n}).pipe(Effect.map((plan) => ({ ...plan, destroy: true })));\nconst providePlanScope = (fqn, instanceId) => (effect) => Effect.serviceOption(ArtifactStore).pipe(Effect.map(Option.getOrElse(createArtifactStore)), Effect.flatMap((store) => effect.pipe(Effect.provideService(Artifacts, makeScopedArtifacts(store, fqn)), Effect.provideService(InstanceId, instanceId))));\nexport class DeleteResourceHasDownstreamDependencies extends Data.TaggedError(\"DeleteResourceHasDownstreamDependencies\") {\n}\nexport class UnsatisfiedResourceCycle extends Data.TaggedError(\"UnsatisfiedResourceCycle\") {\n}\n// TODO(sam): compare props\n// oldBinding.props !== newBinding.props;\n/**\n * Print a plan in a human-readable format that shows the graph topology.\n */\nexport const printPlan = (plan) => {\n const lines = [];\n const allNodes = { ...plan.resources, ...plan.deletions };\n // Build reverse mapping: upstream -> downstream\n const upstreamMap = {};\n for (const [id] of Object.entries(allNodes)) {\n upstreamMap[id] = [];\n }\n for (const [id, node] of Object.entries(allNodes)) {\n if (!node)\n continue;\n for (const downstreamId of node.state?.downstream ?? []) {\n if (upstreamMap[downstreamId]) {\n upstreamMap[downstreamId].push(id);\n }\n }\n }\n // Action symbols\n const actionSymbol = (action) => {\n switch (action) {\n case \"create\":\n return \"+\";\n case \"update\":\n return \"~\";\n case \"delete\":\n return \"-\";\n case \"replace\":\n return \"±\";\n case \"noop\":\n return \"=\";\n default:\n return \"?\";\n }\n };\n // Print header\n lines.push(\"╔════════════════════════════════════════════════════════════════╗\");\n lines.push(\"║ PLAN ║\");\n lines.push(\"╠════════════════════════════════════════════════════════════════╣\");\n lines.push(\"║ Legend: + create, ~ update, - delete, ± replace, = noop, ║\");\n lines.push(\"║ λ run task, · skip task ║\");\n lines.push(\"╚════════════════════════════════════════════════════════════════╝\");\n lines.push(\"\");\n // Print resources section\n lines.push(\"┌─ Resources ────────────────────────────────────────────────────┐\");\n const resourceIds = Object.keys(plan.resources).sort();\n for (const id of resourceIds) {\n const node = plan.resources[id];\n const symbol = actionSymbol(node.action);\n const type = node.resource?.type ?? \"unknown\";\n const downstream = node.state?.downstream?.length\n ? ` → [${node.state?.downstream.join(\", \")}]`\n : \"\";\n const renamed = node.renamedFrom?.length\n ? ` (renamed from ${node.renamedFrom.join(\", \")})`\n : \"\";\n lines.push(`│ [${symbol}] ${id} (${type})${downstream}${renamed}`);\n }\n if (resourceIds.length === 0) {\n lines.push(\"│ (none)\");\n }\n lines.push(\"└────────────────────────────────────────────────────────────────┘\");\n lines.push(\"\");\n // Print tasks section\n lines.push(\"┌─ Tasks ────────────────────────────────────────────────────────┐\");\n const taskIds = Object.keys(plan.actions ?? {}).sort();\n for (const id of taskIds) {\n const node = plan.actions[id];\n const symbol = node.action === \"run\" ? \"λ\" : \"·\";\n const type = node.def.Type;\n const downstream = node.downstream.length\n ? ` → [${node.downstream.join(\", \")}]`\n : \"\";\n lines.push(`│ [${symbol}] ${id} (${type})${downstream}`);\n }\n if (taskIds.length === 0) {\n lines.push(\"│ (none)\");\n }\n lines.push(\"└────────────────────────────────────────────────────────────────┘\");\n lines.push(\"\");\n // Print deletions section\n lines.push(\"┌─ Deletions ────────────────────────────────────────────────────┐\");\n const deletionIds = Object.keys(plan.deletions).sort();\n for (const id of deletionIds) {\n const node = plan.deletions[id];\n const type = node.resource?.Type ?? \"unknown\";\n const downstream = node.state.downstream?.length\n ? ` → [${node.state.downstream.join(\", \")}]`\n : \"\";\n lines.push(`│ [-] ${id} (${type})${downstream}`);\n }\n const taskDeletionIds = Object.keys(plan.actionDeletions ?? {}).sort();\n for (const id of taskDeletionIds) {\n const node = plan.actionDeletions[id];\n lines.push(`│ [-] ${id} (${node.def.Type}) [action]`);\n }\n if (deletionIds.length === 0 && taskDeletionIds.length === 0) {\n lines.push(\"│ (none)\");\n }\n lines.push(\"└────────────────────────────────────────────────────────────────┘\");\n lines.push(\"\");\n return lines.join(\"\\n\");\n};\n//# sourceMappingURL=Plan.js.map","import * as Cause from \"effect/Cause\";\nimport * as Data from \"effect/Data\";\nimport * as Deferred from \"effect/Deferred\";\nimport * as Effect from \"effect/Effect\";\nimport * as Option from \"effect/Option\";\nimport { makeResolveContext } from \"./ActionRuntimeContext.js\";\nimport { stripUnowned, Unowned } from \"./AdoptPolicy.js\";\nimport { AlchemyContext } from \"./AlchemyContext.js\";\nimport { demandPlanCredentials, } from \"./Auth/Demand.js\";\nimport { RuntimeContext } from \"./RuntimeContext.js\";\nimport { Artifacts, ArtifactStore, createArtifactStore, ensureArtifactStore, makeScopedArtifacts, } from \"./Artifacts.js\";\nimport { Cli, } from \"./Cli/Cli.js\";\nimport { havePropsChanged, stripUnresolved } from \"./Diff.js\";\nimport { generateInstanceId, InstanceId } from \"./InstanceId.js\";\nimport * as Output from \"./Output.js\";\nimport {} from \"./Plan.js\";\nimport { findProviderByType, missingProviderError, tryFindProviderByType, } from \"./Provider.js\";\nimport { stampedMode } from \"./ProviderMode.js\";\nimport { Stack } from \"./Stack.js\";\nimport { Stage } from \"./Stage.js\";\nimport { State, StateStoreError, } from \"./State/index.js\";\nimport { recordResourceOp } from \"./Telemetry/Metrics.js\";\nimport { hashInput } from \"./Util/sha256.js\";\nconst provideLifecycleScope = (fqn, instanceId) => (effect) => Effect.serviceOption(ArtifactStore).pipe(Effect.map(Option.getOrElse(createArtifactStore)), Effect.flatMap((store) => effect.pipe(Effect.provideService(Artifacts, makeScopedArtifacts(store, fqn)), Effect.provideService(InstanceId, instanceId))));\n/**\n * Instruments a single provider lifecycle call with an OTel span\n * (`provider.<op>`), the resource counter / duration histogram, and the\n * scoped artifacts/instance services normally supplied by\n * {@link provideLifecycleScope}.\n *\n * This is the only call site through which provider lifecycle methods\n * are dispatched, so wrapping it here gives us a fully-instrumented\n * toolchain without touching any individual provider implementation.\n */\nconst instrumentLifecycle = (op, fqn, resourceType, logicalId, instanceId) => (effect) => effect.pipe(provideLifecycleScope(fqn, instanceId), recordResourceOp(resourceType, op), Effect.withSpan(`provider.${op}`, {\n attributes: {\n \"alchemy.resource.fqn\": fqn,\n \"alchemy.resource.type\": resourceType,\n \"alchemy.resource.logical_id\": logicalId,\n \"alchemy.resource.instance_id\": instanceId,\n \"alchemy.resource.op\": op,\n },\n}));\nexport const apply = (plan) => Effect.gen(function* () {\n // Credential-free dev: a dev-mode plan that needs the real cloud\n // (`Alchemy.remote()` rows, remote-proxied bindings, deletions of rows\n // stamped `providerMode: \"live\"`) demands cloud credentials exactly\n // once, up front, BEFORE any lifecycle operation runs — a fully-local\n // dev plan demands nothing. Non-dev runs never enter the seam: live\n // providers keep the pre-existing lazy credential flow. Wired here (not\n // in Deploy/Destroy) because `apply` is the single choke point every\n // path shares — CLI deploy/destroy, `Test.make` deploys, and\n // `test.provider` scratch stacks. See `Auth/Demand.ts`.\n const alchemy = yield* Effect.serviceOption(AlchemyContext);\n if (Option.isSome(alchemy) && alchemy.value.dev) {\n yield* demandPlanCredentials(plan);\n }\n const cli = yield* Cli;\n const session = yield* cli.startApplySession(plan);\n const state = yield* yield* State;\n const stack = yield* Stack;\n const stage = yield* Stage;\n const stackName = stack.name;\n const tracker = {};\n const terminalStatuses = new Map();\n // ── FQN migrations (renamedFrom) ──\n // Persist renames before any lifecycle operation runs: a node whose row\n // was found under a former FQN carries that row pre-remapped in\n // `node.state` (see Plan's rename resolution). Commit it at the current\n // FQN FIRST, then drop the former row — in that order, so an\n // interruption leaves rows at both FQNs with the same instanceId, which\n // the next plan recognizes as an in-flight migration (and never as an\n // orphan to delete).\n //\n // In a same-deploy shift (A→B while B→C), C's former FQN `B` is\n // simultaneously B's migration TARGET. C must NOT delete it: B's own\n // `state.set` supersedes the stale copy, and the migrations run\n // concurrently — the delete could land after B's write and destroy the\n // freshly migrated row.\n const migrationTargets = new Set(Object.values(plan.resources)\n .filter((node) => node.renamedFrom?.length && node.state !== undefined)\n .map((node) => node.resource.FQN));\n yield* Effect.forEach(Object.values(plan.resources), (node) => {\n const { renamedFrom, state: row } = node;\n return renamedFrom === undefined ||\n renamedFrom.length === 0 ||\n row === undefined\n ? Effect.void\n : Effect.gen(function* () {\n yield* state.set({\n stack: stackName,\n stage,\n fqn: node.resource.FQN,\n value: row,\n });\n yield* Effect.forEach(renamedFrom.filter((formerFqn) => !migrationTargets.has(formerFqn)), (formerFqn) => state.delete({ stack: stackName, stage, fqn: formerFqn }), { concurrency: \"unbounded\" });\n });\n }, { concurrency: \"unbounded\" });\n yield* executePlan(plan, tracker, terminalStatuses, session, state, stackName, stage);\n // TODO(sam): support roll back to previous state if errors occur during expansion\n // -> RISK: some UPDATEs may not be reversible (i.e. trigger replacements)\n // TODO(sam): should pivot be done separately? E.g shift traffic?\n yield* collectGarbage(plan, session);\n yield* converge(plan, tracker, terminalStatuses, session, state, stackName, stage);\n yield* Effect.forEach(Array.from(terminalStatuses.values()), ({ id, type, status, providerMode }) => session.emit({ kind: \"status-change\", id, type, status, providerMode }), { concurrency: \"unbounded\" });\n yield* session.done();\n if (plan.destroy) {\n // The destroy converged: every resource row was deleted above. Drop\n // the rest of the stage's persisted state — notably the stack output\n // record written by the last deploy — so `getOutput` returns\n // undefined and `listStages` no longer reports the stage.\n // https://github.com/alchemy-run/alchemy/issues/961\n yield* state.deleteStack({ stack: stackName, stage });\n // Invariant: a successful destroy leaves the stage EMPTY. If rows\n // survive, this destroy session could not actually see (or delete)\n // the stack's state — e.g. its plan listed an empty store while\n // committed rows existed — and reporting success here would silently\n // leak every cloud resource those rows track. Fail loudly instead so\n // the leak surfaces in the run that caused it.\n const remaining = yield* state.list({ stack: stackName, stage });\n if (remaining.length > 0) {\n return yield* Effect.fail(new StateStoreError({\n message: `destroy of ${stackName}/${stage} reported success but ${remaining.length} ` +\n `state row(s) remain (${remaining.join(\", \")}) — the destroy session could ` +\n `not see the stack's persisted state, so its cloud resources were NOT deleted`,\n }));\n }\n return undefined;\n }\n if (!plan.output) {\n return undefined;\n }\n const outputs = Object.fromEntries(Object.entries(tracker).map(([fqn, t]) => [fqn, t.output]));\n const resolved = yield* Output.evaluate(plan.output, outputs);\n // Persist the stack's evaluated outputs so cross-stack references\n // (`yield* OtherStack` / `OtherStack.stage.<name>` / `Output.stackRef`)\n // can read them back out of the state store.\n yield* state.setOutput({ stack: stackName, stage, value: resolved });\n return resolved;\n}).pipe(ensureArtifactStore, Effect.withSpan(\"apply\", {\n attributes: {\n \"alchemy.resources.count\": Object.keys(plan.resources).length,\n \"alchemy.deletions.count\": Object.keys(plan.deletions).length,\n },\n}));\n// ── Phase 1: concurrent initial execution ──────────────────────────────────\n//\n// Each resource gets a Deferred<void> that signals \"I have some output\n// available in `tracker`.\" Resources with `precreate` signal early so that\n// downstream resources can resolve stable identifiers without deadlocking.\n// The actual output lives in the mutable `tracker` map, not in the Deferred.\nconst executePlan = Effect.fn(function* (plan, tracker, terminalStatuses, session, state, stackName, stage) {\n // Resources and tasks share the same FQN namespace and DAG, so the\n // scheduler tracks them together. Each entry gets a single Deferred that\n // signals \"my output is available in `tracker`.\"\n const allNodes = {\n ...plan.resources,\n ...plan.actions,\n };\n const ready = Object.fromEntries(yield* Effect.all(Object.keys(allNodes).map((fqn) => Effect.map(Deferred.make(), (d) => [fqn, d]))));\n // `readyStable` fires only when a node has reached its TERMINAL output —\n // resources after `reconcile`, tasks after the body completes. Resource\n // precreate stubs do NOT signal `readyStable`, so any consumer that\n // requires stable inputs (e.g. Tasks) waits past the precreate phase.\n const readyStable = Object.fromEntries(yield* Effect.all(Object.keys(allNodes).map((fqn) => Effect.map(Deferred.make(), (d) => [fqn, d]))));\n const getOutputs = () => Object.fromEntries(Object.entries(tracker).map(([fqn, t]) => [fqn, t.output]));\n const waitForDeps = (fqns) => Effect.all(fqns\n .filter((fqn) => fqn in ready)\n .map((fqn) => \n // Non-cycle upstreams must be observed at their TERMINAL output\n // (`readyStable`), not their early precreate signal (`ready`). This\n // is what makes a failed upstream actually interrupt its downstream:\n // a resource with `precreate` resolves `ready` before its real\n // `reconcile` runs, so a downstream waiting on `ready` would proceed\n // (and even finish) even though the upstream's reconcile later\n // failed. Waiting on `readyStable` means the downstream's\n // `waitForDeps` short-circuits with the upstream's failure cause.\n //\n // Cycle members are the exception: peers in an SCC depend on each\n // other, so they must rendezvous on the early `ready`/precreate\n // signal to break the deadlock. Phase 3 (`converge`) re-runs them\n // against final outputs once the cycle settles.\n plan.cycleMembers.has(fqn)\n ? Deferred.await(ready[fqn])\n : Deferred.await(readyStable[fqn])), { concurrency: \"unbounded\" });\n const waitForStableDeps = (fqns) => Effect.all(fqns\n .filter((fqn) => fqn in readyStable)\n .map((fqn) => Deferred.await(readyStable[fqn])), { concurrency: \"unbounded\" });\n const failures = [];\n yield* Effect.all(Object.entries(allNodes).map(([fqn, node]) => node.kind === \"action\"\n ? executeActionNode(fqn, node, tracker, ready, readyStable, terminalStatuses, session, state, stackName, stage, getOutputs, waitForStableDeps, failures)\n : executeNode(fqn, node, tracker, ready, readyStable, terminalStatuses, session, state, stackName, stage, getOutputs, waitForDeps, failures, plan.cycleMembers.has(fqn))), { concurrency: \"unbounded\" });\n if (failures.length > 0) {\n // Aggregate every collected lifecycle failure into a single parallel Cause\n // so the apply ends with one combined error containing every distinct\n // failure / defect that occurred across the concurrent fibers.\n return yield* Effect.failCause(failures.map((f) => f.cause).reduce(Cause.combine));\n }\n});\nconst executeNode = (fqn, node, tracker, ready, readyStable, terminalStatuses, session, state, stackName, stage, getOutputs, waitForDeps, failures, inCycle) => Effect.gen(function* () {\n const logicalId = node.resource.LogicalId;\n const namespace = node.resource.Namespace;\n const commit = (value) => state.set({\n stack: stackName,\n stage,\n fqn,\n // Early commits (`creating`/`replacing`) persist plan props that may\n // still hold unresolved Output exprs; strip them so state stores only\n // plain data (see stripUnresolved in Diff.ts).\n //\n // Binding rows follow the same rule. Even the RESOLVED binding\n // payload can carry Effect leaves — a tagged Worker/Function class in\n // `env` (the circular-bindings pattern) is a function-typed Effect\n // that `Output.evaluate` passes through untouched. A JSON state store\n // would persist it via its `toJSON` as an `{\"_id\":\"Effect\",...}`\n // relic, which the next plan's `diffBindings` compares against the\n // live class stripped to `undefined` — a phantom binding \"update\" on\n // every deploy, forever. Stripping at the commit boundary keeps both\n // store kinds consistent with the comparison in `havePropsChanged`.\n value: {\n ...value,\n props: stripUnresolved(value.props),\n bindings: stripUnresolved(value.bindings),\n namespace,\n },\n });\n const scopedSession = {\n ...session,\n note: (note) => session.emit({ id: logicalId, kind: \"annotate\", message: note }),\n };\n // On a mode-switch replacement (local ⇄ live) surface the transition:\n // the old generation's stamped mode → the mode resolved for this run.\n const fromProviderMode = node.action === \"replace\" &&\n node.mode !== undefined &&\n node.state.providerMode !== undefined &&\n node.state.providerMode !== node.mode\n ? node.state.providerMode\n : undefined;\n const report = (status) => session.emit({\n kind: \"status-change\",\n id: logicalId,\n type: node.resource.Type,\n status,\n providerMode: node.mode,\n fromProviderMode,\n });\n const markTerminal = (status) => Effect.gen(function* () {\n terminalStatuses.set(fqn, {\n id: logicalId,\n type: node.resource.Type,\n status,\n providerMode: node.mode,\n });\n // A local dev instance announces where it's serving: any\n // local-mode row whose fresh Attributes carry a string `url`\n // (Workers expose their dev-proxy URL this way) gets a\n // `[id] ready at http://localhost:1337` line.\n if (node.mode === \"local\") {\n const url = tracker[fqn]?.output?.url;\n if (typeof url === \"string\" && url.length > 0) {\n yield* scopedSession.note(`ready at ${url}`);\n }\n }\n // Emit immediately so the CLI surfaces the terminal status as soon\n // as the resource is actually done — instead of batching every\n // resource's \"created\"/\"updated\" event to the end of apply(), which\n // makes long-running siblings appear stuck in \"creating\" until the\n // entire deploy finishes.\n //\n // Cycle members are exempt: their initial pass produces an\n // intermediate result that Phase 3 (`converge`) will overwrite once\n // the SCC reaches a fixed point. Emitting \"created\"/\"updated\" here\n // would surface that intermediate state to the CLI before the real\n // terminal status is known. Their final status is flushed from\n // `terminalStatuses` after `converge` completes.\n if (inCycle)\n return;\n yield* session.emit({\n kind: \"status-change\",\n id: logicalId,\n type: node.resource.Type,\n status,\n providerMode: node.mode,\n });\n });\n const signalReady = Deferred.succeed(ready[fqn], void 0);\n // Signal only after reconcile completes — never during precreate. Tasks\n // (and any other consumer that calls `waitForStableDeps`) block on this\n // so they observe the resource's final attrs rather than a stub.\n const signalReadyStable = Deferred.succeed(readyStable[fqn], void 0);\n const storeAndSignal = (t) => Effect.gen(function* () {\n tracker[fqn] = t;\n yield* signalReady;\n });\n // ── noop ──\n if (node.action === \"noop\") {\n // No work to do on the cloud resource — the persisted attr is already\n // stable. Two pieces of row METADATA can still have drifted from the\n // declaration, and this is the only pass that will ever see them:\n //\n // 1. `resourceType` — the row was persisted under a legacy type name\n // (the type was since renamed and carries the old name as an\n // alias); migrate it so the state stops depending on the alias.\n // 2. `removalPolicy` — `RemovalPolicy.retain()` / `.destroy()` is a\n // decoration on the declaration, not a prop, so changing it never\n // produces a diff. Without this commit the new policy would never\n // reach state, and the orphan delete (which reads the policy from\n // the persisted row, see `Plan.ts`'s delete node) would act on the\n // stale one — destroying a resource the user had marked `retain`.\n // See https://github.com/alchemy-run/alchemy/issues/1248.\n const policyChanged = node.state.removalPolicy !== node.resource.RemovalPolicy;\n if (node.state.resourceType !== node.resource.Type || policyChanged) {\n yield* commit({\n ...node.state,\n resourceType: node.resource.Type,\n removalPolicy: node.resource.RemovalPolicy,\n });\n }\n // A policy flip is otherwise invisible (the row is a noop), and it is\n // exactly the change a user wants confirmation of. Legacy rows with no\n // persisted policy normalize silently — there is nothing to report.\n if (policyChanged && node.state.removalPolicy !== undefined) {\n yield* scopedSession.note(`removal policy ${node.state.removalPolicy} → ${node.resource.RemovalPolicy}`);\n }\n yield* signalReadyStable;\n yield* storeAndSignal({\n output: node.state.attr,\n props: node.state.props,\n bindings: node.state.bindings ?? [],\n instanceId: node.state.instanceId,\n });\n return;\n }\n const allUpstreamFqns = () => {\n const propDeps = Object.keys(Output.resolveUpstream(node.props));\n const bindingDeps = Object.keys(Output.resolveUpstream(node.bindings));\n return [...new Set([...propDeps, ...bindingDeps])];\n };\n // ── instance ID ──\n const instanceId = yield* Effect.gen(function* () {\n if (node.action === \"create\" && !node.state?.instanceId) {\n const id = yield* generateInstanceId();\n yield* commit({\n status: \"creating\",\n fqn,\n logicalId,\n instanceId: id,\n downstream: node.downstream,\n props: node.props,\n providerVersion: node.provider.version ?? 0,\n resourceType: node.resource.Type,\n bindings: excludeDeletedBindings(node.bindings),\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n return id;\n }\n else if (node.action === \"replace\") {\n if ((node.state.status === \"replaced\" ||\n node.state.status === \"replacing\") &&\n !node.restart) {\n // Ordinary replacement recovery keeps using the same replacement\n // generation. Only `restart` is allowed to mint a new instance id.\n return node.state.instanceId;\n }\n const id = yield* generateInstanceId();\n yield* commit({\n status: \"replacing\",\n fqn,\n logicalId,\n instanceId: id,\n downstream: node.downstream,\n props: node.props,\n providerVersion: node.provider.version ?? 0,\n resourceType: node.resource.Type,\n bindings: excludeDeletedBindings(node.bindings),\n old: node.state,\n deleteFirst: node.deleteFirst,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n return id;\n }\n else if (node.state?.instanceId) {\n return node.state.instanceId;\n }\n return yield* Effect.die(`Instance ID not found for resource '${logicalId}' and action is '${node.action}'`);\n });\n // ── lifecycle ──\n yield* Effect.gen(function* () {\n // ── create ──\n if (node.action === \"create\") {\n if (!node.state) {\n // First persistence point for a brand new logical resource. Once this is\n // written, retries know they should resume creation instead of planning\n // another fresh create from scratch.\n yield* commit({\n status: \"creating\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: node.props,\n attr: undefined,\n providerVersion: node.provider.version ?? 0,\n bindings: excludeDeletedBindings(node.bindings),\n downstream: node.downstream,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n }\n let attr = node.state?.attr;\n if (attr !== undefined) {\n // Precreate/read may already have produced a usable output snapshot. Publish\n // it early so downstream resources can start resolving against it.\n yield* storeAndSignal({\n output: attr,\n props: {},\n bindings: [],\n instanceId,\n });\n }\n if (node.provider.precreate && attr === undefined) {\n // Some resources need a placeholder physical resource before their real\n // create can finish. Persist that stub so downstream evaluation can proceed.\n yield* report(\"pre-creating\");\n attr = yield* node.provider\n .precreate({\n id: logicalId,\n fqn,\n news: node.props,\n session: scopedSession,\n instanceId,\n bindings: excludeDeletedBindings(node.bindings),\n })\n .pipe(instrumentLifecycle(\"precreate\", fqn, node.resource.Type, logicalId, instanceId));\n yield* commit({\n status: \"creating\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: node.props,\n attr,\n providerVersion: node.provider.version ?? 0,\n bindings: excludeDeletedBindings(node.bindings),\n downstream: node.downstream,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n yield* storeAndSignal({\n output: attr,\n props: {},\n bindings: [],\n instanceId,\n });\n }\n // While we're waiting on upstream outputs the resource isn't actually\n // creating anything yet — surface that as \"pending\" so the CLI doesn't\n // look stuck in \"creating\" for slow-upstream deploys.\n yield* report(\"pending\");\n // Create runs against fully resolved upstream outputs and bindings, not the\n // raw Output expressions stored in the plan.\n yield* waitForDeps(allUpstreamFqns());\n yield* report(\"creating\");\n const outputs = getOutputs();\n const news = (yield* Output.evaluate(node.props, outputs));\n const bindingOutputs = excludeDeletedBindings(yield* Output.evaluate(node.bindings, outputs));\n attr = yield* node.provider\n .reconcile({\n id: logicalId,\n fqn,\n news,\n instanceId,\n bindings: bindingOutputs,\n session: scopedSession,\n olds: undefined,\n output: attr,\n })\n .pipe(instrumentLifecycle(\"create\", fqn, node.resource.Type, logicalId, instanceId));\n yield* commit({\n status: \"created\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: news,\n attr,\n // Terminal commits persist the RESOLVED binding payload the\n // provider actually reconciled with, not the raw plan-time\n // expressions. Raw `node.bindings` may hold unresolved Outputs\n // (silently dropped by JSON state stores), so persisting them\n // makes the next plan's `diffBindings` compare a lossy stored\n // shape against fully-resolved data — a phantom binding update\n // on every plan (#874).\n bindings: bindingOutputs,\n providerVersion: node.provider.version ?? 0,\n downstream: node.downstream,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n tracker[fqn] = {\n output: attr,\n props: news,\n bindings: bindingOutputs,\n instanceId,\n };\n yield* signalReady;\n yield* signalReadyStable;\n yield* markTerminal(\"created\");\n return;\n }\n // ── update ──\n if (node.action === \"update\") {\n // Cycle members publish their previous live attr *before* waiting on\n // upstreams so the SCC can converge — peers in the cycle would\n // otherwise deadlock waiting on each other. Phase 3 (`converge`)\n // re-runs each peer's update against fresh outputs once everyone\n // has settled.\n //\n // Linear (DAG) update nodes skip this entirely and simply wait for\n // fresh upstream outputs, mirroring the create flow. This is the\n // important property: a downstream of a non-cycle update never\n // observes the upstream's stale attr, which prevents wasted/\n // destructive intermediate updates (e.g. a Worker deploying with\n // stale Build assets).\n if (inCycle) {\n yield* storeAndSignal({\n output: node.state.attr,\n props: node.state.props,\n bindings: node.state.bindings ?? [],\n instanceId,\n });\n }\n // See create-flow note: while we're waiting on upstream outputs\n // this resource isn't actually updating yet.\n yield* report(\"pending\");\n yield* waitForDeps(allUpstreamFqns());\n const outputs = getOutputs();\n const news = (yield* Output.evaluate(node.props, outputs));\n const adopting = node.adopting === true ||\n (node.state.status === \"updating\" && node.state.adopting === true);\n yield* node.state.status === \"replaced\"\n ? commit({\n // Keep the replacement wrapper intact while changing the live\n // replacement props; GC still has older generations to delete.\n ...node.state,\n attr: node.state.attr,\n props: news,\n providerMode: node.mode,\n })\n : commit({\n // For ordinary updates we snapshot the previously stable props/attrs\n // once, so retries can continue from the same baseline.\n status: \"updating\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: news,\n attr: node.state.attr,\n providerVersion: node.provider.version ?? 0,\n bindings: excludeDeletedBindings(node.bindings),\n downstream: node.downstream,\n old: node.state.status === \"updating\" ? node.state.old : node.state,\n adopting: adopting ? true : undefined,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n yield* report(\"updating\");\n const previousProps = adopting\n ? undefined\n : node.state.status === \"created\" ||\n node.state.status === \"updated\" ||\n node.state.status === \"replaced\"\n ? node.state.props\n : node.state.old.props;\n // Providers receive the resolved binding payload for this exact pass, while\n // `previousProps` tells them what state the live resource is being updated from.\n const bindingOutputs = excludeDeletedBindings(yield* Output.evaluate(node.bindings, outputs));\n const attr = yield* node.provider\n .reconcile({\n id: logicalId,\n fqn,\n news,\n instanceId,\n bindings: bindingOutputs,\n session: scopedSession,\n olds: previousProps,\n output: node.state.attr,\n })\n .pipe(instrumentLifecycle(\"update\", fqn, node.resource.Type, logicalId, instanceId));\n if (node.state.status === \"replaced\") {\n yield* commit({\n // The live replacement changed, but cleanup of older generations still\n // has to continue afterwards.\n ...node.state,\n attr,\n props: news,\n // Resolved payload, not raw `node.bindings` — see create commit.\n bindings: bindingOutputs,\n providerMode: node.mode,\n });\n }\n else {\n yield* commit({\n status: \"updated\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: news,\n attr,\n // Resolved payload, not raw `node.bindings` — see create commit.\n bindings: bindingOutputs,\n providerVersion: node.provider.version ?? 0,\n downstream: node.downstream,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n }\n tracker[fqn] = {\n output: attr,\n props: news,\n bindings: bindingOutputs,\n instanceId,\n };\n // Signal here for the linear (non-cycle) path. For in-cycle updates\n // the deferred has already been resolved by the early `storeAndSignal`\n // above and `signalReady` is a no-op the second time.\n yield* signalReady;\n yield* signalReadyStable;\n yield* markTerminal(\"updated\");\n return;\n }\n // ── replace ──\n if (node.action === \"replace\") {\n if (node.state.status === \"replaced\" && !node.restart) {\n // The replacement already exists; this pass only needs GC to clean up\n // older generations, so expose the current replacement and stop here.\n tracker[fqn] = {\n output: node.state.attr,\n props: node.state.props,\n bindings: node.state.bindings ?? [],\n instanceId,\n };\n yield* signalReady;\n yield* signalReadyStable;\n yield* markTerminal(\"created\");\n return;\n }\n let replState;\n if (node.state.status !== \"replacing\" || node.restart) {\n // `restart` deliberately nests the previous top-level replacement state\n // into `old`, creating a new outer generation to replace it.\n replState = yield* commit({\n status: \"replacing\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: node.props,\n bindings: excludeDeletedBindings(node.bindings),\n attr: undefined,\n providerVersion: node.provider.version ?? 0,\n deleteFirst: node.deleteFirst,\n old: node.state,\n downstream: node.downstream,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n }\n else {\n // Resume the same replacement generation after an interrupted apply.\n replState = node.state;\n }\n // ── delete-first replacements ──\n //\n // By default a replacement is create-first: the new generation is\n // created here and the old generation(s) are reclaimed afterwards by\n // `collectGarbage` (Phase 2). That ordering keeps the old resource\n // alive if the create fails, but it is wrong for resources whose\n // replacement cannot coexist with the original — a fixed physical\n // name, a singleton, etc. Those providers return\n // `{ action: \"replace\", deleteFirst: true }`.\n //\n // When `deleteFirst` is set we tear the previous generation(s) down\n // BEFORE creating the new one, and commit the result as a terminal\n // `created` state (rather than `replaced`) so Phase 2 has no old chain\n // left to drain. `delete` is required to be idempotent, so a re-run\n // after an interrupted apply simply re-converges.\n const deleteOldGenerations = (old) => Effect.gen(function* () {\n const retain = node.resource.RemovalPolicy === \"retain\";\n if (old.attr !== undefined && !retain) {\n // Delete each old generation with the provider variant of the\n // mode that created it — after a local ⇄ live switch,\n // `node.provider` (the new mode) cannot tear down the other\n // runtime's instance. Unstamped rows (legacy or written by a\n // mode-agnostic provider) are physically live, unless their\n // attrs carry the `dev:` identity marker — see stampedMode.\n const oldProvider = yield* findProviderByType(node.resource.Type, stampedMode(old));\n yield* oldProvider\n .delete({\n id: logicalId,\n fqn,\n instanceId: old.instanceId,\n olds: old.props,\n output: old.attr,\n session: scopedSession,\n bindings: [],\n })\n .pipe(instrumentLifecycle(\"delete\", fqn, node.resource.Type, logicalId, old.instanceId));\n }\n if (old.status === \"replacing\" || old.status === \"replaced\") {\n yield* deleteOldGenerations(old.old);\n }\n });\n if (node.deleteFirst) {\n yield* scopedSession.note(\"Deleting previous resource before creating its replacement (deleteFirst)...\");\n yield* deleteOldGenerations(replState.old);\n }\n let attr = replState.attr;\n if (attr !== undefined) {\n // If precreate already ran, expose that intermediate output immediately so\n // downstream resources can resolve against the same in-flight replacement.\n yield* storeAndSignal({\n output: attr,\n props: {},\n bindings: [],\n instanceId,\n });\n }\n if (node.provider.precreate && attr === undefined) {\n yield* report(\"pre-creating\");\n attr = yield* node.provider\n .precreate({\n id: logicalId,\n fqn,\n news: node.props,\n session: scopedSession,\n instanceId,\n bindings: excludeDeletedBindings(node.bindings),\n })\n .pipe(instrumentLifecycle(\"precreate\", fqn, node.resource.Type, logicalId, instanceId));\n yield* commit({\n status: \"replacing\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: node.props,\n attr,\n providerVersion: node.provider.version ?? 0,\n bindings: excludeDeletedBindings(node.bindings),\n downstream: node.downstream,\n old: replState.old,\n deleteFirst: node.deleteFirst,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n yield* storeAndSignal({\n output: attr,\n props: {},\n bindings: [],\n instanceId,\n });\n }\n // See create-flow note: while we're waiting on upstream outputs\n // the replacement isn't actually being created yet.\n yield* report(\"pending\");\n // Replacement create is evaluated exactly like create, but against the new\n // generation's instance id and with the previous generations preserved in `old`.\n yield* waitForDeps(allUpstreamFqns());\n yield* report(\"creating replacement\");\n const outputs = getOutputs();\n const news = (yield* Output.evaluate(node.props, outputs));\n const bindingOutputs = excludeDeletedBindings(yield* Output.evaluate(node.bindings, outputs));\n attr = yield* node.provider\n .reconcile({\n id: logicalId,\n fqn,\n news,\n instanceId,\n bindings: bindingOutputs,\n session: scopedSession,\n olds: undefined,\n output: attr,\n })\n .pipe(instrumentLifecycle(\"create\", fqn, node.resource.Type, logicalId, instanceId));\n if (node.deleteFirst) {\n // The old generation(s) were already torn down above, so there is\n // nothing left for `collectGarbage` to drain — collapse straight to\n // the terminal `created` state.\n yield* commit({\n status: \"created\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: news,\n attr,\n providerVersion: node.provider.version ?? 0,\n // Resolved payload, not raw `node.bindings` — see create commit.\n bindings: bindingOutputs,\n downstream: node.downstream,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n }\n else {\n yield* commit({\n // Creation of the new generation succeeded; from here on the only remaining\n // work is draining the old chain via garbage collection.\n status: \"replaced\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: news,\n attr,\n providerVersion: node.provider.version ?? 0,\n // Resolved payload, not raw `node.bindings` — see create commit.\n bindings: bindingOutputs,\n downstream: node.downstream,\n // Preserve the remaining backlog exactly as-is. GC is responsible for\n // popping one generation at a time until the chain is exhausted.\n old: replState.old,\n deleteFirst: node.deleteFirst,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n }\n tracker[fqn] = {\n output: attr,\n props: news,\n bindings: bindingOutputs,\n instanceId,\n };\n yield* signalReady;\n yield* signalReadyStable;\n // Keep progress anchored to the live replacement while GC drains the\n // previous generation(s) in the background.\n yield* markTerminal(\"created\");\n return;\n }\n // @ts-expect-error - node is never, this should be unreachable\n return yield* Effect.die(`Unknown action: ${node.action}`);\n });\n}).pipe(Effect.catchCause((cause) => \n// Record the failure, propagate it to any downstream resources waiting on\n// our Deferred (so their waitForDeps short-circuits instead of deadlocking),\n// emit a \"fail\" status to the session, and resolve to void so Effect.all\n// does not interrupt sibling fibers. The aggregated cause is raised at\n// the end of executePlan.\nEffect.gen(function* () {\n failures.push({\n fqn,\n logicalId: node.resource.LogicalId,\n type: node.resource.Type,\n cause,\n });\n yield* Deferred.failCause(ready[fqn], cause);\n yield* Deferred.failCause(readyStable[fqn], cause);\n yield* session.emit({\n kind: \"status-change\",\n id: node.resource.LogicalId,\n type: node.resource.Type,\n status: \"fail\",\n providerMode: node.mode,\n });\n})), Effect.withSpan(\"apply.resource\", {\n attributes: {\n \"alchemy.resource.fqn\": fqn,\n \"alchemy.resource.type\": node.resource.Type,\n \"alchemy.resource.logical_id\": node.resource.LogicalId,\n \"alchemy.resource.action\": node.action,\n },\n}));\n// ── Task execution ─────────────────────────────────────────────────────────\n//\n// Tasks slot into the same scheduler as resources. They have no provider\n// lifecycle — just a single Effect that runs when inputs change (or when\n// `--force` is set). The output value is written to `tracker[fqn].output`\n// so downstream Output evaluation works identically to resource attrs.\n/**\n * Run an Action body, resolving any Outputs it captured via `yield* output`\n * during init against the current tracker and exposing them to the body through\n * the resolve {@link RuntimeContext}. See {@link makeCaptureContext}.\n */\nconst runAction = Effect.fn(\"apply.runAction\")(function* (task, input, outputs) {\n const resolved = {};\n for (const [key, output] of Object.entries(task.Captures)) {\n resolved[key] = yield* Output.evaluate(output, outputs);\n }\n return yield* task\n .Run(input)\n .pipe(Effect.provideService(RuntimeContext, makeResolveContext(resolved)));\n});\nconst executeActionNode = (fqn, node, tracker, ready, readyStable, terminalStatuses, session, state, stackName, stage, getOutputs, waitForDeps, failures) => Effect.gen(function* () {\n const task = node.def;\n const logicalId = task.LogicalId;\n const namespace = task.Namespace;\n const commit = (value) => state.set({\n stack: stackName,\n stage,\n fqn,\n value: { ...value, namespace },\n });\n const report = (status) => session.emit({\n kind: \"status-change\",\n id: logicalId,\n type: task.Type,\n status,\n });\n const signalReady = Deferred.succeed(ready[fqn], void 0);\n const signalReadyStable = Deferred.succeed(readyStable[fqn], void 0);\n if (node.action === \"noop\") {\n tracker[fqn] = {\n output: node.state.output,\n props: { __input: node.state.input },\n bindings: [],\n instanceId: fqn,\n };\n yield* signalReady;\n yield* signalReadyStable;\n terminalStatuses.set(fqn, {\n id: logicalId,\n type: task.Type,\n status: \"skipped\",\n });\n yield* report(\"skipped\");\n return;\n }\n // ── run ──\n // Tasks wait on `waitForStableDeps` (post-reconcile attrs) for their\n // upstreams, which is often the slowest dep chain in the deploy.\n // Surface that as \"pending\" instead of having the task show no status\n // until its run actually starts.\n yield* report(\"pending\");\n yield* waitForDeps([\n ...new Set([\n ...Object.keys(Output.resolveUpstream(node.input)),\n ...Object.keys(Output.upstreamAny(task.Captures)),\n ]),\n ].filter((f) => f in readyStable));\n const outputs = getOutputs();\n const resolvedInput = (yield* Output.evaluate(node.input, outputs));\n const inputHashValue = yield* hashInput(resolvedInput);\n yield* commit({\n kind: \"action\",\n status: \"running\",\n fqn,\n logicalId,\n actionType: task.Type,\n inputHash: inputHashValue,\n input: resolvedInput,\n downstream: node.downstream,\n });\n yield* report(\"running\");\n const result = yield* runAction(task, resolvedInput, outputs);\n yield* commit({\n kind: \"action\",\n status: \"ran\",\n fqn,\n logicalId,\n actionType: task.Type,\n inputHash: inputHashValue,\n input: resolvedInput,\n output: result,\n downstream: node.downstream,\n });\n tracker[fqn] = {\n output: result,\n props: { __input: resolvedInput },\n bindings: [],\n instanceId: fqn,\n };\n yield* signalReady;\n yield* signalReadyStable;\n terminalStatuses.set(fqn, {\n id: logicalId,\n type: task.Type,\n status: \"ran\",\n });\n yield* report(\"ran\");\n}).pipe(Effect.catchCause((cause) => Effect.gen(function* () {\n failures.push({\n fqn,\n logicalId: node.def.LogicalId,\n type: node.def.Type,\n cause,\n });\n yield* Deferred.failCause(ready[fqn], cause);\n yield* Deferred.failCause(readyStable[fqn], cause);\n yield* session.emit({\n kind: \"status-change\",\n id: node.def.LogicalId,\n type: node.def.Type,\n status: \"fail\",\n });\n})), Effect.withSpan(\"apply.action\", {\n attributes: {\n \"alchemy.action.fqn\": fqn,\n \"alchemy.action.type\": node.def.Type,\n \"alchemy.action.logical_id\": node.def.LogicalId,\n \"alchemy.action.verb\": node.action,\n },\n}));\n// ── Phase 3: imperative convergence loop ───────────────────────────────────\n//\n// After the initial concurrent pass, some resources may have been created\n// with stale upstream values (e.g. a precreate stub instead of the final\n// output). Walk the plan and re-evaluate each resource's props/bindings\n// against the current tracker outputs. Call provider.reconcile for any\n// resource whose resolved inputs differ from what it was last applied with.\n// Repeat until no resource needs updating.\nconst converge = Effect.fn(function* (plan, tracker, terminalStatuses, session, state, stackName, stage) {\n for (;;) {\n let anyUpdated = false;\n for (const [fqn, node] of Object.entries(plan.resources)) {\n if (node.action === \"noop\")\n continue;\n if (!tracker[fqn])\n continue;\n const outputs = Object.fromEntries(Object.entries(tracker).map(([k, t]) => [k, t.output]));\n const newProps = (yield* Output.evaluate(node.props, outputs));\n const newBindings = excludeDeletedBindings(yield* Output.evaluate(node.bindings, outputs));\n const oldProps = tracker[fqn].props;\n const oldBindings = tracker[fqn].bindings;\n const propsChanged = havePropsChanged(oldProps, newProps);\n const bindingsChanged = JSON.stringify(oldBindings) !== JSON.stringify(newBindings);\n if (!propsChanged && !bindingsChanged)\n continue;\n anyUpdated = true;\n const logicalId = node.resource.LogicalId;\n const namespace = node.resource.Namespace;\n const instanceId = tracker[fqn].instanceId;\n const scopedSession = {\n ...session,\n note: (note) => session.emit({ id: logicalId, kind: \"annotate\", message: note }),\n };\n const attr = yield* node.provider\n .reconcile({\n id: logicalId,\n fqn,\n news: newProps,\n instanceId,\n bindings: newBindings,\n session: scopedSession,\n olds: oldProps,\n output: tracker[fqn].output,\n })\n .pipe(instrumentLifecycle(\"update\", fqn, node.resource.Type, logicalId, instanceId));\n tracker[fqn] = {\n output: attr,\n props: newProps,\n bindings: newBindings,\n instanceId,\n };\n yield* state.set({\n stack: stackName,\n stage,\n fqn,\n value: {\n status: \"updated\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n // This site bypasses the `commit` helper, so strip unresolved\n // leaves (Effect-valued env entries survive `Output.evaluate`)\n // the same way `commit` does — state only ever holds plain data.\n props: stripUnresolved(newProps),\n attr,\n providerVersion: node.provider.version ?? 0,\n // Resolved payload, not raw `node.bindings` — see the create\n // commit in applyResource. Stripped like the commit helper so\n // Effect leaves (e.g. tagged Worker classes in `env`) never reach\n // the state store.\n bindings: stripUnresolved(newBindings),\n downstream: node.downstream,\n namespace,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n },\n });\n terminalStatuses.set(fqn, {\n id: logicalId,\n type: node.resource.Type,\n status: \"updated\",\n providerMode: node.mode,\n });\n }\n // Tasks: re-run when their resolved input drifts vs. the value they\n // last applied with (e.g. an upstream resource produced new attrs in\n // this pass). Skipped (noop) tasks are not re-checked here — their\n // recorded inputHash is authoritative until the next plan.\n for (const [fqn, node] of Object.entries(plan.actions)) {\n if (node.action !== \"run\")\n continue;\n if (!tracker[fqn])\n continue;\n const outputs = Object.fromEntries(Object.entries(tracker).map(([k, t]) => [k, t.output]));\n const newInput = (yield* Output.evaluate(node.input, outputs));\n const newHash = yield* hashInput(newInput);\n const oldInput = tracker[fqn].props?.__input;\n const oldHash = yield* hashInput(oldInput);\n if (newHash === oldHash)\n continue;\n anyUpdated = true;\n yield* state.set({\n stack: stackName,\n stage,\n fqn,\n value: {\n kind: \"action\",\n status: \"running\",\n fqn,\n logicalId: node.def.LogicalId,\n namespace: node.def.Namespace,\n actionType: node.def.Type,\n inputHash: newHash,\n input: newInput,\n downstream: node.downstream,\n },\n });\n const result = yield* runAction(node.def, newInput, outputs);\n yield* state.set({\n stack: stackName,\n stage,\n fqn,\n value: {\n kind: \"action\",\n status: \"ran\",\n fqn,\n logicalId: node.def.LogicalId,\n namespace: node.def.Namespace,\n actionType: node.def.Type,\n inputHash: newHash,\n input: newInput,\n output: result,\n downstream: node.downstream,\n },\n });\n tracker[fqn] = {\n output: result,\n props: { __input: newInput },\n bindings: [],\n instanceId: fqn,\n };\n terminalStatuses.set(fqn, {\n id: node.def.LogicalId,\n type: node.def.Type,\n status: \"ran\",\n });\n }\n if (!anyUpdated)\n break;\n }\n});\n/**\n * Aggregate raised at the end of the deletion phase when one or more\n * resource deletes failed. Every resource whose delete did not depend on a\n * failed one was still attempted — a single failure no longer strands\n * unrelated siblings.\n */\nexport class DestroyError extends Data.TaggedError(\"DestroyError\") {\n get message() {\n return [\n `Failed to delete ${this.failures.length} resource(s)` +\n (this.blocked.length > 0\n ? ` (${this.blocked.length} more skipped because a dependent's delete failed)`\n : \"\") +\n \":\",\n ...this.failures.map((f) => ` ✗ ${f.fqn} (${f.resourceType}): ${Cause.pretty(f.cause)}`),\n ...this.blocked.map((b) => ` ⊘ ${b.fqn} (${b.resourceType}): skipped — blocked by failed delete of ${b.blockedBy.join(\", \")}`),\n ].join(\"\\n\");\n }\n}\nconst collectGarbage = Effect.fn(function* (plan, session) {\n const state = yield* yield* State;\n const stack = yield* Stack;\n const stackName = stack.name;\n const stage = yield* Stage;\n // Task deletions are pure state drops — no body is invoked. Run them in\n // parallel before resource GC; tasks never have provider-side dependencies\n // to wait on.\n yield* Effect.all(Object.entries(plan.actionDeletions ?? {}).map(([fqn, node]) => node === undefined\n ? Effect.void\n : Effect.gen(function* () {\n yield* session.emit({\n kind: \"status-change\",\n id: node.def.LogicalId,\n type: node.def.Type,\n status: \"deleting\",\n });\n yield* state.delete({ stack: stackName, stage, fqn });\n yield* session.emit({\n kind: \"status-change\",\n id: node.def.LogicalId,\n type: node.def.Type,\n status: \"deleted\",\n });\n })), { concurrency: \"unbounded\" });\n // Failures are collected — not propagated — so one bad delete never\n // strands unrelated siblings. `unresolved` tracks every FQN whose delete\n // failed or was blocked this run: later passes must not retry them (a\n // still-`replaced` row would otherwise spin the drain loop forever) and\n // dependencies scheduled in later passes must observe them as blocking.\n const failures = [];\n const blockedDeletes = [];\n const unresolved = new Set();\n const deleteGraph = Effect.fn(function* (deletionGraph) {\n const deletions = {};\n const deleteResource = (node, ancestors = new Set()) => Effect.gen(function* () {\n const isDeleteNode = (node) => \"action\" in node;\n const { fqn, logicalId, namespace, resourceType, instanceId, downstream, props, attr: persistedAttr, provider, providerMode, } = isDeleteNode(node)\n ? {\n // Use the persisted FQN verbatim — never recompute it from\n // `toFqn(namespace, logicalId)`. A logical ID may legitimately\n // contain the FQN separator (`/`), in which case `parseFqn`\n // truncated it and a recomputed key would miss the real state\n // row (the row would then resurface as an orphan on every\n // subsequent destroy, never getting deleted).\n fqn: node.resource.FQN,\n logicalId: node.resource.LogicalId,\n namespace: node.resource.Namespace,\n resourceType: node.resource.Type,\n instanceId: node.state.instanceId,\n downstream: node.downstream,\n props: node.state.props,\n attr: node.state.attr,\n // Plan resolved this provider for the row's persisted (or\n // marker-inferred) `providerMode` (see the deletions builder\n // in Plan.ts).\n provider: node.provider,\n providerMode: node.state.providerMode,\n }\n : {\n fqn: node.fqn,\n logicalId: node.logicalId,\n namespace: node.namespace,\n resourceType: node.old.resourceType,\n instanceId: node.old.instanceId,\n downstream: node.old.downstream,\n props: node.old.props,\n attr: node.old.attr,\n // A missing provider is fatal — plan already dies on zombie\n // rows (see the deletions builder in Plan.ts); this guards\n // the replaced-chain generations that bypass plan. The old\n // generation is torn down with the provider variant of the\n // mode that created it (local ⇄ live replacements);\n // unstamped rows are physically live unless their attrs\n // carry the `dev:` identity marker (see stampedMode).\n provider: yield* tryFindProviderByType(node.old.resourceType, stampedMode(node.old)).pipe(Effect.flatMap(Option.match({\n onNone: () => Effect.die(missingProviderError(node.old.resourceType, node.fqn)),\n onSome: Effect.succeed,\n }))),\n providerMode: node.old.providerMode,\n };\n // Mutable: an attr-less row (interrupted create) may recover its\n // attributes from `provider.read` below, right before deletion.\n let attr = persistedAttr;\n const nextAncestors = new Set(ancestors).add(fqn);\n const commit = (value) => state.set({\n stack: stackName,\n stage,\n fqn,\n // Same rule as the lifecycle commit above: state only stores\n // plain data, never unresolved Output exprs or Effect leaves.\n value: {\n ...value,\n props: stripUnresolved(value.props),\n bindings: stripUnresolved(value.bindings),\n namespace,\n },\n });\n const report = (status) => session.emit({\n kind: \"status-change\",\n id: logicalId,\n type: resourceType,\n status,\n providerMode,\n });\n const scopedSession = {\n ...session,\n note: (note) => session.emit({\n id: logicalId,\n kind: \"annotate\",\n message: note,\n }),\n };\n return yield* (deletions[fqn] ??= yield* Effect.cached(Effect.gen(function* () {\n // Dependents (`downstream`) are deleted before this resource. A\n // dependent whose delete failed (or was itself blocked) may make\n // this resource legitimately undeletable (dependency violation),\n // so it is skipped with a \"blocked by\" note instead of surfacing\n // a spurious second error.\n const dependents = yield* Effect.all(downstream.map((dep) => dep !== fqn && !ancestors.has(dep)\n ? dep in deletionGraph\n ? deleteResource(deletionGraph[dep], nextAncestors).pipe(Effect.map((outcome) => ({ dep, outcome })))\n : // Not in this pass's graph — but it may have failed in\n // an earlier drain pass of the same destroy.\n Effect.sync(() => ({\n dep,\n outcome: unresolved.has(dep)\n ? \"failed\"\n : \"deleted\",\n }))\n : Effect.succeed({ dep, outcome: \"deleted\" })), { concurrency: \"unbounded\" });\n const blockedBy = dependents\n .filter(({ outcome }) => outcome !== \"deleted\")\n .map(({ dep }) => dep);\n if (blockedBy.length > 0) {\n unresolved.add(fqn);\n blockedDeletes.push({\n fqn,\n logicalId,\n resourceType,\n blockedBy,\n });\n yield* scopedSession.note(`Skipping delete — blocked by failed delete of ${blockedBy.join(\", \")}.`);\n yield* report(\"skipped\");\n return \"blocked\";\n }\n return yield* deleteResourceBody().pipe(Effect.catchCause((cause) => Effect.gen(function* () {\n unresolved.add(fqn);\n failures.push({ fqn, logicalId, resourceType, cause });\n yield* report(\"fail\");\n return \"failed\";\n })));\n })));\n function deleteResourceBody() {\n return Effect.gen(function* () {\n if (isDeleteNode(node)) {\n yield* report(\"deleting\");\n if (node.resource.RemovalPolicy === \"retain\") {\n yield* state.delete({\n stack: stackName,\n stage,\n fqn,\n });\n yield* report(\"retained\");\n // Retention is intentional — it never blocks dependencies.\n return \"deleted\";\n }\n }\n // Honor `retain` for the old generation of a replacement, mirroring\n // the orphan-delete path above. Delete-node retain is already\n // handled with an early return; this guards the replaced\n // old-generation physical delete.\n const retainOldGeneration = !isDeleteNode(node) && node.removalPolicy === \"retain\";\n if (retainOldGeneration) {\n yield* scopedSession.note(\"Retaining replaced resource (removal policy: retain)...\");\n }\n // A row can reach deletion with `attr === undefined` when a create\n // was interrupted after the cloud-side call succeeded but before\n // `reconcile` returned Attributes (a `creating` row — or the old\n // generation of a replacement chain in the same predicament).\n // Skipping the provider's delete outright would silently orphan\n // the physical resource, so ask `read` to look it up from the\n // persisted props (providers derive the deterministic physical\n // name from id/props):\n // - plain attrs → exists and is ours; proceed to delete\n // - Unowned(attrs) → exists but is NOT ours (e.g. our create\n // actually lost a name race, or died before\n // stamping ownership) — never delete a\n // foreign resource; drop our state and say so\n // - undefined → nothing exists; dropping state is safe\n if (attr === undefined && !retainOldGeneration) {\n if (provider.read) {\n const recovered = yield* provider\n .read({\n id: logicalId,\n fqn,\n instanceId,\n olds: props,\n output: undefined,\n })\n .pipe(instrumentLifecycle(\"read\", fqn, resourceType, logicalId, instanceId), \n // The persisted props of an interrupted create can carry\n // holes where unresolved Outputs were stripped at commit\n // time (see stripUnresolved) — e.g. a parent reference\n // persisted as `{}`. A provider that dereferences one\n // crashes deep inside its SDK client (a SchemaError\n // defect), which would make the stage impossible to\n // destroy. Recovery is best-effort: degrade the defect\n // to \"nothing recovered\", surface a note, and let the\n // row be dropped (#995).\n Effect.catchDefect((defect) => scopedSession\n .note(\"Recovery read crashed while looking up this \" +\n \"resource's interrupted create \" +\n `(${String(defect)}) — if a physical resource ` +\n \"was created, it must be cleaned up manually.\")\n .pipe(Effect.as(undefined))));\n if (recovered !== undefined) {\n if (Unowned.is(recovered)) {\n yield* scopedSession.note(\"Resource exists in the cloud but is not owned by this \" +\n \"stack — leaving it in place (re-deploy with --adopt \" +\n \"to take ownership, then destroy).\");\n }\n else {\n attr = stripUnowned(recovered);\n }\n }\n }\n else {\n yield* scopedSession.note(\"No attributes were recorded for this resource (its create \" +\n \"was interrupted) and the provider does not implement \" +\n \"`read` — if a physical resource was created, it must be \" +\n \"cleaned up manually.\");\n }\n }\n if (isDeleteNode(node)) {\n yield* commit({\n status: \"deleting\",\n fqn,\n logicalId,\n instanceId,\n resourceType,\n props,\n attr,\n downstream,\n providerVersion: provider.version ?? 0,\n bindings: excludeDeletedBindings(node.bindings),\n removalPolicy: node.resource.RemovalPolicy,\n providerMode,\n });\n }\n if (attr !== undefined && !retainOldGeneration) {\n yield* provider\n .delete({\n id: logicalId,\n fqn,\n instanceId,\n olds: props,\n output: attr,\n session: scopedSession,\n bindings: [],\n })\n .pipe(instrumentLifecycle(\"delete\", fqn, resourceType, logicalId, instanceId));\n }\n if (isDeleteNode(node)) {\n yield* state.delete({\n stack: stackName,\n stage,\n fqn,\n });\n yield* report(\"deleted\");\n }\n else {\n if (!retainOldGeneration) {\n yield* scopedSession.note(\"Cleaning up replaced resource...\");\n }\n if (node.old.status === \"replacing\" ||\n node.old.status === \"replaced\") {\n // We only deleted the outermost old generation. A nested replacement\n // chain still exists, so stay in `replaced` and pop the chain forward\n // one level. The outer loop will pick this resource up again.\n yield* commit({\n status: \"replaced\",\n fqn,\n logicalId: node.logicalId,\n instanceId: node.instanceId,\n resourceType: node.resourceType,\n props: node.props,\n attr: node.attr,\n providerVersion: node.providerVersion,\n downstream: node.downstream,\n bindings: excludeDeletedBindings(node.bindings),\n old: node.old.old,\n deleteFirst: node.deleteFirst,\n removalPolicy: node.removalPolicy,\n providerMode: node.providerMode,\n });\n }\n else {\n // The old chain is fully drained, so the current replacement is now\n // the stable resource and we can collapse back to a terminal state.\n yield* commit({\n status: \"created\",\n fqn,\n logicalId: node.logicalId,\n instanceId: node.instanceId,\n resourceType: node.resourceType,\n props: node.props,\n attr: node.attr,\n providerVersion: node.providerVersion,\n downstream: node.downstream,\n bindings: excludeDeletedBindings(node.bindings),\n removalPolicy: node.removalPolicy,\n providerMode: node.providerMode,\n });\n }\n yield* scopedSession.note(retainOldGeneration\n ? \"Replaced resource retained.\"\n : \"Replaced resource cleanup complete.\");\n }\n return \"deleted\";\n });\n }\n });\n // Attempt every root. Per-node failures were recorded (and their state\n // retained) inside each node's delete effect — the effects resolve to\n // outcomes and never fail, so one bad resource never interrupts sibling\n // deletions mid-flight.\n yield* Effect.all(Object.values(deletionGraph)\n .filter((node) => node !== undefined)\n .map((node) => deleteResource(node)), { concurrency: \"unbounded\" });\n });\n // The first pass handles both planned deletions and any top-level replaced\n // resources already present in state. Later passes only drain replacement\n // chains that were re-committed as `replaced` while deleting older generations.\n let first = true;\n while (true) {\n const remainingReplacedResources = (yield* state.getReplacedResources({\n stack: stackName,\n stage,\n }))\n // A row whose drain already failed (or was blocked) this run stays\n // `replaced` in state — retrying it in a later pass would loop forever.\n // It stays behind for the next destroy; the aggregate error below\n // reports it.\n .filter((replaced) => !unresolved.has(replaced.fqn));\n if (!first && remainingReplacedResources.length === 0) {\n break;\n }\n yield* deleteGraph({\n // Orphan/resource deletions from the current plan should only run once.\n ...(first ? plan.deletions : {}),\n ...Object.fromEntries(remainingReplacedResources.map((replaced) => [\n // Key by the persisted FQN (not a recomputed one) so logical IDs\n // containing the FQN separator round-trip correctly.\n replaced.fqn,\n replaced,\n ])),\n });\n first = false;\n }\n if (failures.length > 0) {\n // Every independent delete was still attempted; now surface everything\n // that went wrong (and everything skipped as a consequence) as one\n // typed aggregate. The destroy as a whole still fails.\n return yield* Effect.fail(new DestroyError({ failures, blocked: blockedDeletes }));\n }\n});\nconst excludeDeletedBindings = (bindings) => bindings.flatMap(({ action, sid, data }) => action === \"delete\" ? [] : [{ sid, data }]);\n//# sourceMappingURL=Apply.js.map","","import { exec } from \"node:child_process\";\nimport * as crypto from \"node:crypto\";\nimport * as fs from \"node:fs/promises\";\nimport * as os from \"node:os\";\nimport * as nodePath from \"node:path\";\nimport * as Effect from \"effect/Effect\";\nimport packageJson from \"../../package.json\" with { type: \"json\" };\nconst ALCHEMY_DIR = nodePath.join(os.homedir(), \".alchemy\");\nconst ID_PATH = nodePath.join(ALCHEMY_DIR, \"id\");\nconst DISABLED_PATH = nodePath.join(ALCHEMY_DIR, \"telemetry-disabled\");\nconst tryRead = (path) => Effect.tryPromise(() => fs.readFile(path, \"utf-8\").then((s) => s.trim())).pipe(Effect.orElseSucceed(() => null));\nconst sha256Hex = (input) => crypto.createHash(\"sha256\").update(input).digest(\"hex\");\nconst hashStringOrEmpty = (input) => input == null || input === \"\" ? \"\" : sha256Hex(input);\nconst execCapture = (cmd) => Effect.callback((resume) => {\n exec(cmd, { timeout: 1500 }, (err, stdout) => {\n if (err) {\n resume(Effect.succeed(null));\n return;\n }\n resume(Effect.succeed(stdout.toString().trim()));\n });\n});\nconst getOrCreateUserId = Effect.gen(function* () {\n const existing = yield* tryRead(ID_PATH);\n if (existing)\n return existing;\n const id = crypto.randomUUID();\n yield* Effect.tryPromise({\n try: async () => {\n await fs.mkdir(ALCHEMY_DIR, { recursive: true });\n await fs.writeFile(ID_PATH, id);\n },\n catch: () => null,\n }).pipe(Effect.catch(() => Effect.void));\n return id;\n});\nconst getRootCommitHash = execCapture(process.platform === \"win32\"\n ? `git rev-list --max-parents=0 HEAD | ForEach-Object { if (-not (git cat-file -p $_ | Select-String \"^parent \")) { $_ } }`\n : `git rev-list --max-parents=0 HEAD | xargs -r -I{} sh -c 'git cat-file -p {} | grep -q \"^parent \" || echo {}'`);\nconst getGitOriginUrl = execCapture(\"git config --get remote.origin.url\");\nconst getBranchName = execCapture(\"git rev-parse --abbrev-ref HEAD\");\nconst getRuntime = () => {\n const g = globalThis;\n if (typeof g.Bun !== \"undefined\") {\n return { name: \"bun\", version: g.Bun.version };\n }\n if (typeof g.Deno !== \"undefined\") {\n return { name: \"deno\", version: g.Deno.version?.deno ?? \"\" };\n }\n if (globalThis.process?.versions?.node) {\n return { name: \"node\", version: process.versions.node };\n }\n return { name: \"\", version: \"\" };\n};\nconst CI_PROVIDERS = [\n { env: \"GITHUB_ACTIONS\", provider: \"GitHub Actions\", isCI: true },\n { env: \"GITLAB_CI\", provider: \"GitLab CI\", isCI: true },\n { env: \"CIRCLECI\", provider: \"CircleCI\", isCI: true },\n { env: \"JENKINS_URL\", provider: \"Jenkins\", isCI: true },\n { env: \"TRAVIS\", provider: \"Travis CI\", isCI: true },\n { env: \"BUILDKITE\", provider: \"Buildkite\", isCI: true },\n { env: \"NOW_BUILDER\", provider: \"Vercel\", isCI: true },\n { env: \"VERCEL\", provider: \"Vercel\", isCI: false },\n];\nconst getCIEnvironment = () => {\n for (const p of CI_PROVIDERS) {\n if (process.env[p.env]) {\n return { provider: p.provider, isCI: p.isCI };\n }\n }\n return { provider: \"\", isCI: !!process.env.CI };\n};\nconst TELEMETRY_DISABLED_ENV = () => !!process.env.ALCHEMY_TELEMETRY_DISABLED ||\n !!process.env.DO_NOT_TRACK ||\n !!process.env.NO_TRACK;\n/**\n * `true` if telemetry is disabled via environment variable\n * (`DO_NOT_TRACK`, `NO_TRACK`, `ALCHEMY_TELEMETRY_DISABLED`) or via a\n * persisted opt-out file at `~/.alchemy/telemetry-disabled`.\n */\nexport const isTelemetryDisabled = Effect.gen(function* () {\n if (TELEMETRY_DISABLED_ENV())\n return true;\n const persisted = yield* tryRead(DISABLED_PATH);\n return persisted === \"true\";\n});\n/**\n * Persists an opt-out so future invocations skip telemetry without needing\n * an env var.\n */\nexport const setTelemetryDisabled = Effect.tryPromise(async () => {\n await fs.mkdir(ALCHEMY_DIR, { recursive: true });\n await fs.writeFile(DISABLED_PATH, \"true\");\n}).pipe(Effect.ignore);\nexport const setTelemetryEnabled = Effect.tryPromise(() => fs.rm(DISABLED_PATH, { force: true })).pipe(Effect.ignore);\nconst collectAttributesUncached = Effect.gen(function* () {\n const [userId, rootCommit, originUrl, branch] = yield* Effect.all([\n getOrCreateUserId,\n getRootCommitHash,\n getGitOriginUrl,\n getBranchName,\n ], { concurrency: \"unbounded\" });\n const runtime = getRuntime();\n const ci = getCIEnvironment();\n return {\n \"alchemy.user.id\": userId,\n \"alchemy.session.id\": process.env.ALCHEMY_TELEMETRY_SESSION_ID ?? crypto.randomUUID(),\n \"alchemy.version\": packageJson.version,\n \"alchemy.git.root_commit\": rootCommit ?? \"\",\n \"alchemy.git.origin_hash\": hashStringOrEmpty(originUrl),\n \"alchemy.git.branch_hash\": hashStringOrEmpty(branch),\n \"alchemy.runtime.name\": runtime.name,\n \"alchemy.runtime.version\": runtime.version,\n \"alchemy.ci.provider\": ci.provider,\n \"alchemy.ci\": ci.isCI,\n \"host.arch\": os.arch(),\n \"os.type\": os.platform(),\n \"os.version\": os.release(),\n \"host.cpus\": os.cpus().length,\n \"host.memory_mb\": Math.round(os.totalmem() / 1024 / 1024),\n };\n});\nlet cachedAttrs;\n/**\n * Resolves the {@link TelemetryAttributes} for the current process. Cached\n * so file I/O and `git` invocations only run once per CLI invocation; every\n * subsequent caller gets the same record (and therefore the same session\n * id).\n */\nexport const collectAttributes = Effect.suspend(() => cachedAttrs !== undefined\n ? Effect.succeed(cachedAttrs)\n : collectAttributesUncached.pipe(Effect.tap((a) => Effect.sync(() => {\n cachedAttrs = a;\n }))));\n//# sourceMappingURL=Attributes.js.map","import * as p from \"@clack/prompts\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport { ChildProcess } from \"effect/unstable/process\";\nexport class PromptCancelled extends Data.TaggedError(\"PromptCancelled\") {\n}\nexport const retryIfCancelled = Effect.retry({\n while: (e) => e instanceof PromptCancelled,\n});\n/**\n * Wraps a clack prompt (which returns a `Promise<T | symbol>` where the\n * symbol indicates user cancellation) in an Effect.\n *\n * Returns `undefined` if the user cancels (Ctrl+C / Escape).\n *\n * Uses `Effect.callback` so fiber interruption propagates to the clack\n * prompt through its abort signal, releasing stdin and restoring the cursor.\n */\nexport const prompt = (fn) => Effect.callback((resume, signal) => {\n let settled = false;\n fn(signal).then((result) => {\n if (settled || signal.aborted)\n return;\n settled = true;\n if (p.isCancel(result)) {\n resume(Effect.fail(new PromptCancelled()));\n }\n else {\n resume(Effect.succeed(result));\n }\n }, (err) => {\n if (settled || signal.aborted)\n return;\n settled = true;\n resume(Effect.die(err));\n });\n});\nexport const success = (str) => Effect.sync(() => p.log.success(str));\nexport const warn = (str) => Effect.sync(() => p.log.warn(str));\nexport const error = (str) => Effect.sync(() => p.log.error(str));\nexport const info = (str) => Effect.sync(() => p.log.info(str));\nexport const text = (opts) => {\n const validate = opts.validate;\n return prompt((signal) => p.text({\n ...opts,\n signal,\n validate: validate === undefined ? undefined : (value) => validate(value ?? \"\"),\n }));\n};\nexport const password = (opts) => {\n const validate = opts.validate;\n return prompt((signal) => p.password({\n ...opts,\n signal,\n validate: validate === undefined ? undefined : (value) => validate(value ?? \"\"),\n }));\n};\nexport const select = (opts) => prompt((signal) => p.select({ ...opts, signal }));\nexport const confirm = (opts) => prompt((signal) => p.confirm({ ...opts, signal }));\nexport const multiselect = (opts) => prompt((signal) => p.multiselect({ ...opts, signal }));\n/**\n * Open a URL in the user's default browser.\n *\n * On Windows, uses rundll32's FileProtocolHandler — a built-in shim that\n * opens URLs in the default browser. It accepts the URL as a direct\n * argument (no shell, no quoting of `&`). cmd.exe `start` would treat\n * `&` in OAuth URLs as a command separator, and `explorer.exe` treats\n * its arg as a path.\n */\nexport const openUrl = (url) => Effect.gen(function* () {\n const [cmd, args] = process.platform === \"win32\"\n ? [\"rundll32.exe\", [\"url.dll,FileProtocolHandler\", url]]\n : process.platform === \"darwin\"\n ? [\"open\", [url]]\n : [\"xdg-open\", [url]];\n const handle = yield* ChildProcess.make(cmd, [...args], { shell: false });\n yield* handle.exitCode;\n}).pipe(Effect.scoped);\n//# sourceMappingURL=Clank.js.map","import * as Config from \"effect/Config\";\nimport * as Effect from \"effect/Effect\";\nimport * as Clank from \"../Util/Clank.js\";\nimport { AuthError } from \"./AuthProvider.js\";\nexport const getEnv = (key) => Config.string(key).pipe(Effect.orElseSucceed(() => undefined));\nexport const getEnvRequired = (key) => Config.string(key).pipe(Effect.catch(() => Effect.fail(new AuthError({ message: `Missing required env: ${key}` }))));\nexport const getEnvRedacted = (key) => Config.redacted(key).pipe(Effect.orElseSucceed(() => undefined));\nexport const getEnvRedactedRequired = (key) => Config.redacted(key).pipe(Effect.catch(() => Effect.fail(new AuthError({ message: `Missing required env: ${key}` }))));\nexport const retryOnce = (self) => self.pipe(Effect.retry({\n times: 1,\n while: (e) => e instanceof Clank.PromptCancelled,\n}), Effect.mapError((e) => new AuthError({ message: \"User cancelled prompt\", cause: e })));\n//# sourceMappingURL=Env.js.map","import * as Config from \"effect/Config\";\nimport * as Context from \"effect/Context\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport * as Result from \"effect/Result\";\nimport { AlchemyContext } from \"../AlchemyContext.js\";\nimport { getAuthProvider } from \"../Auth/AuthProvider.js\";\nimport { ALCHEMY_PROFILE, AlchemyProfile } from \"../Auth/Profile.js\";\nimport { AWS_AUTH_PROVIDER_NAME, LOCAL_ACCOUNT_ID, } from \"./AuthProvider.js\";\nexport const AWS_PROFILE = Config.string(\"AWS_PROFILE\").pipe(Config.withDefault(\"default\"));\nexport const AWS_REGION = Config.string(\"AWS_REGION\");\nexport const AWS_ACCOUNT_ID = Config.string(\"AWS_ACCOUNT_ID\");\nexport const AWS_ACCESS_KEY_ID = Config.string(\"AWS_ACCESS_KEY_ID\");\nexport const AWS_SECRET_ACCESS_KEY = Config.redacted(\"AWS_SECRET_ACCESS_KEY\");\nexport const AWS_SESSION_TOKEN = Config.redacted(\"AWS_SESSION_TOKEN\");\nexport class FailedToGetAccount extends Data.TaggedError(\"AWS::Environment::FailedToGetAccount\") {\n}\nexport class AWSEnvironment extends Context.Service()(\"AWS::Environment\") {\n static current = AWSEnvironment.use((env) => env);\n /**\n * Whether this environment is the floci / `{ method: \"local\" }` emulator\n * (dummy account {@link LOCAL_ACCOUNT_ID}). A set `endpoint` is not\n * enough: `AWS_ENDPOINT_URL` and explicit endpoint overrides also\n * populate it on real-account credentials.\n */\n static isLocalEmulator = Effect.map(AWSEnvironment.current, (env) => env.accountId === LOCAL_ACCOUNT_ID);\n kind = \"Environment\";\n}\n/** @see {@link AWSEnvironment.isLocalEmulator} */\nexport const isLocalEmulator = AWSEnvironment.isLocalEmulator;\nexport const Default = Layer.effect(AWSEnvironment, Effect.gen(function* () {\n const profile = yield* AlchemyProfile;\n const auth = yield* getAuthProvider(AWS_AUTH_PROVIDER_NAME);\n const profileName = yield* ALCHEMY_PROFILE;\n const ci = yield* Config.boolean(\"CI\").pipe(Config.withDefault(false));\n const dev = Option.match(yield* Effect.serviceOption(AlchemyContext), {\n onNone: () => false,\n onSome: (ctx) => ctx.dev,\n });\n // The pre-existing resolution path: stored profile config (or, when\n // nothing is stored, the interactive configure flow / non-interactive\n // AuthError) → resolved credentials. Deploy-mode behavior is unchanged.\n const resolveConfigured = profile\n .loadOrConfigure(auth, profileName, { ci })\n .pipe(Effect.flatMap((config) => auth.read(profileName, config)));\n // Credential-free dev: an `alchemy dev` run must work with zero AWS\n // credentials. When nothing is configured for the active profile, try\n // ambient env-var credentials first (a developer who exported AWS_*\n // wants the real cloud), then fall back to the local emulator — the\n // same environment `{ method: \"local\" }` produces (dummy creds,\n // account 000000000000, endpoint localhost:4566, ensureFloci).\n // A profile that IS configured keeps its normal resolution (and its\n // normal failures) even in dev.\n const resolveDev = Effect.gen(function* () {\n const stored = yield* profile.getProfile(profileName);\n if (stored?.[AWS_AUTH_PROVIDER_NAME] != null) {\n return yield* resolveConfigured;\n }\n const fromEnv = yield* Effect.result(auth.read(profileName, { method: \"env\" }));\n if (Result.isSuccess(fromEnv)) {\n return fromEnv.success;\n }\n yield* Effect.logInfo(\"no AWS credentials — using the local emulator\");\n return yield* auth.read(profileName, { method: \"local\" });\n });\n return yield* (dev ? resolveDev : resolveConfigured).pipe(Effect.orDie, Effect.cached);\n})).pipe(Layer.orDie);\n//# sourceMappingURL=Environment.js.map","import { Endpoint } from \"@distilled.cloud/aws\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport { AWSEnvironment } from \"./Environment.js\";\nexport const of = (endpoint) => Layer.succeed(Endpoint.Endpoint, Effect.succeed(endpoint));\n/**\n * Derive a custom endpoint (if any) from the surrounding\n * {@link AWSEnvironment}. If the environment has no `endpoint` set, this\n * Layer is empty (the SDK uses its default endpoint resolver).\n */\nexport const fromEnvironment = Layer.effect(Endpoint.Endpoint, Effect.gen(function* () {\n return Effect.map(yield* AWSEnvironment, (env) => env.endpoint ?? undefined);\n}));\n/**\n * Explicitly \"no custom endpoint\" — the SDK falls back to its default\n * endpoint resolver.\n *\n * Use this (never `Layer.empty`) when an AWS call is made from *inside*\n * the construction of {@link AWSEnvironment}: leaving `Endpoint`\n * unprovided lets the call fall through to {@link fromEnvironment},\n * whose service Effect re-enters the in-flight `AWSEnvironment` cache and\n * deadlocks the fiber with no I/O and no timer pending.\n */\nexport const none = Layer.succeed(Endpoint.Endpoint, Effect.succeed(undefined));\n//# sourceMappingURL=Endpoint.js.map","import * as Region from \"@distilled.cloud/aws/Region\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport { AWSEnvironment } from \"./Environment.js\";\nexport { AWS_REGION } from \"./Environment.js\";\nexport { Region } from \"@distilled.cloud/aws/Region\";\nexport const of = (region) => Layer.succeed(Region.Region, Effect.succeed(region));\nexport const fromEnvOrElse = (region) => Layer.succeed(Region.Region, Effect.succeed(process.env.AWS_REGION ?? region));\n// Deferred with `Effect.suspend` so it does not dereference `AWSEnvironment`\n// during module evaluation. `Region.ts` and `Environment.ts` are part of an\n// import cycle (AuthProvider → Region → Environment → AuthProvider); touching\n// `AWSEnvironment` eagerly at top level hits a temporal-dead-zone error when\n// this module is evaluated mid-cycle.\nexport const CurrentRegion = Effect.suspend(() => AWSEnvironment.use((env) => Effect.flatMap(env, ({ region }) => Effect.succeed(region))));\n/**\n * Derive the AWS region from the surrounding {@link AWSEnvironment}.\n */\nexport const fromEnvironment = Layer.effect(Region.Region, Effect.gen(function* () {\n const env = yield* AWSEnvironment;\n return Effect.map(env, (env) => env.region);\n}));\n//# sourceMappingURL=Region.js.map","import * as Floci from \"@alchemy.run/floci\";\nimport * as DistilledAuth from \"@distilled.cloud/aws/Auth\";\nimport { Credentials } from \"@distilled.cloud/aws/Credentials\";\nimport * as STS from \"@distilled.cloud/aws/sts\";\nimport * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Match from \"effect/Match\";\nimport * as Path from \"effect/Path\";\nimport * as Redacted from \"effect/Redacted\";\nimport { ChildProcess } from \"effect/unstable/process\";\nimport * as NodeCrypto from \"node:crypto\";\nimport * as NodeOs from \"node:os\";\nimport { AuthError, AuthProviderLayer, } from \"../Auth/AuthProvider.js\";\nimport { CredentialsStore, displayRedacted } from \"../Auth/Credentials.js\";\nimport { getEnv, getEnvRedacted, getEnvRedactedRequired, getEnvRequired, retryOnce, } from \"../Auth/Env.js\";\nimport * as Clank from \"../Util/Clank.js\";\nimport * as Endpoint from \"./Endpoint.js\";\nimport * as Region from \"./Region.js\";\nexport const AWS_AUTH_PROVIDER_NAME = \"AWS\";\n/** Default endpoint of a local AWS emulator (floci / LocalStack). */\nexport const DEFAULT_LOCAL_ENDPOINT = `http://localhost:${Floci.DEFAULT_FLOCI_PORT}`;\n/**\n * Dummy account stamped on every floci / `{ method: \"local\" }` environment.\n * A custom `AWS_ENDPOINT_URL` on env/sso credentials does NOT use this —\n * those keep the real account from STS / `AWS_ACCOUNT_ID`.\n */\nexport const LOCAL_ACCOUNT_ID = \"000000000000\";\nconst options = [\n {\n value: \"sso\",\n label: \"SSO\",\n hint: \"aws sso login — credentials loaded from AWS SSO cache\",\n },\n {\n value: \"env\",\n label: \"Environment Variables\",\n hint: \"AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY\",\n },\n {\n value: \"stored\",\n label: \"Stored\",\n hint: \"stored in ~/.alchemy/credentials\",\n },\n {\n value: \"local\",\n label: \"Local emulator\",\n hint: \"floci / LocalStack on localhost:4566 — no AWS account\",\n },\n];\n/**\n * An explicitly-set `AWS_REGION` env var wins over the region recorded in an\n * SSO profile (`~/.aws/config`) or in stored credentials. `AWS_DEFAULT_REGION`\n * deliberately does NOT override — it is a *default* for when no region is\n * configured anywhere, and the profile's region is explicit configuration.\n */\nexport const applyEnvRegionOverride = (creds) => getEnv(\"AWS_REGION\").pipe(Effect.map((envRegion) => envRegion ? { ...creds, region: envRegion } : creds));\n/**\n * Layer that registers the AWS {@link AuthProvider} into the\n * {@link AuthProviders} registry when built. Include this in the AWS\n * `providers()` layer so `alchemy login` can discover it.\n */\nexport const AwsAuth = AuthProviderLayer()(AWS_AUTH_PROVIDER_NAME, Effect.gen(function* () {\n const store = yield* CredentialsStore;\n const getAccountId = ({ accessKeyId, secretAccessKey, sessionToken, region, endpoint, }) => STS.getCallerIdentity({}).pipe(Effect.provide(Layer.mergeAll(Layer.succeed(Credentials, Effect.succeed({\n accessKeyId,\n secretAccessKey,\n sessionToken,\n region,\n })), \n // Provide Region directly from the resolved inputs. Relying on the\n // ambient Region provider (Region.fromEnvironment) here would\n // deadlock: it derives the region from AWSEnvironment, which is the\n // very service still being constructed by this STS call.\n Region.of(region), \n // A custom endpoint (local emulator) must apply to this STS call\n // too — the default resolver would call real AWS. When there is\n // no custom endpoint we must still provide `Endpoint.none`\n // rather than leaving it unset: falling through to the ambient\n // `Endpoint.fromEnvironment` reads it off AWSEnvironment — the\n // very service this STS call is constructing — and deadlocks\n // the fiber on its own in-flight cache (no I/O, no timer, no\n // output). Same reason as `Region.of` above.\n endpoint ? Endpoint.of(endpoint) : Endpoint.none)), Effect.flatMap((self) => self.Account\n ? Effect.succeed(self.Account)\n : Effect.die(new Error(\"No account ID found\"))));\n const loginStored = Effect.fn(function* (profileName) {\n const accessKeyId = yield* Clank.text({\n message: \"AWS Access Key ID\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n }).pipe(retryOnce);\n const secretAccessKey = yield* Clank.password({\n message: \"AWS Secret Access Key\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n }).pipe(retryOnce);\n const sessionToken = yield* Clank.text({\n message: \"AWS Session Token (optional — press Enter or Esc to skip)\",\n placeholder: \"(none)\",\n }).pipe(Effect.catch(() => Effect.succeed(\"\")));\n const region = yield* Clank.text({\n message: \"AWS Region\",\n placeholder: \"us-east-1\",\n defaultValue: \"us-east-1\",\n }).pipe(retryOnce);\n const accountId = yield* getAccountId({\n accessKeyId: Redacted.make(accessKeyId),\n secretAccessKey: Redacted.make(secretAccessKey),\n sessionToken: sessionToken ? Redacted.make(sessionToken) : undefined,\n region,\n });\n yield* store.write(profileName, \"aws\", {\n accountId,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n region,\n });\n yield* Clank.success(\"AWS credentials saved.\");\n return { method: \"stored\" };\n });\n const configureInteractive = (profileName) => Clank.select({\n message: \"AWS authentication method\",\n options,\n }).pipe(Effect.flatMap((method) => Match.value(method).pipe(Match.when(\"env\", () => Effect.succeed({ method: \"env\" })), Match.when(\"sso\", () => Effect.gen(function* () {\n const ssoProfile = yield* Clank.text({\n message: \"AWS profile name (from ~/.aws/config)\",\n placeholder: \"default\",\n defaultValue: \"default\",\n });\n const config = {\n method: \"sso\",\n ssoProfile: ssoProfile ?? \"default\",\n };\n yield* loginSSO(config);\n return config;\n })), Match.when(\"stored\", () => loginStored(profileName)), Match.when(\"local\", () => Effect.gen(function* () {\n const endpoint = yield* Clank.text({\n message: \"Emulator endpoint\",\n placeholder: DEFAULT_LOCAL_ENDPOINT,\n defaultValue: DEFAULT_LOCAL_ENDPOINT,\n });\n const region = yield* Clank.text({\n message: \"Region\",\n placeholder: \"us-east-1\",\n defaultValue: \"us-east-1\",\n });\n return {\n method: \"local\",\n endpoint: endpoint || DEFAULT_LOCAL_ENDPOINT,\n region: region || \"us-east-1\",\n };\n })), Match.exhaustive)));\n const configureCredentials = (profileName, ctx) => Effect.gen(function* () {\n if (ctx.ci) {\n return { method: \"env\" };\n }\n if (ctx.reason) {\n // e.g. the credential-demand seam (`Auth/Demand.ts`) explaining\n // which dev-plan resources require real AWS credentials.\n yield* Clank.info(ctx.reason);\n }\n return yield* configureInteractive(profileName);\n }).pipe(Effect.mapError((e) => new AuthError({\n message: \"failed to configure credentials\",\n cause: e,\n })));\n const resolveCredentials = (profileName, config) => Match.value(config)\n .pipe(Match.when({ method: \"env\" }, Effect.fn(function* () {\n const accessKeyId = yield* getEnvRedactedRequired(\"AWS_ACCESS_KEY_ID\");\n const secretAccessKey = yield* getEnvRedactedRequired(\"AWS_SECRET_ACCESS_KEY\");\n const sessionToken = yield* getEnvRedacted(\"AWS_SESSION_TOKEN\");\n const region = yield* getEnv(\"AWS_REGION\").pipe(Effect.flatMap((region) => region\n ? Effect.succeed(region)\n : getEnv(\"AWS_DEFAULT_REGION\")));\n if (!region) {\n return yield* Effect.fail(new AuthError({\n message: \"AWS region not found. Set AWS_REGION or AWS_DEFAULT_REGION.\",\n }));\n }\n // LocalStack-standard endpoint override: with\n // AWS_ENDPOINT_URL set, every AWS call (including the STS\n // account lookup below) targets the emulator.\n const endpoint = yield* getEnv(\"AWS_ENDPOINT_URL\");\n const accountId = yield* getEnvRequired(\"AWS_ACCOUNT_ID\").pipe(Effect.catch(() => getAccountId({\n accessKeyId,\n secretAccessKey,\n sessionToken,\n region,\n endpoint,\n })));\n return {\n accountId,\n credentials: Effect.succeed({\n accessKeyId,\n secretAccessKey,\n sessionToken,\n region,\n }),\n region,\n endpoint,\n source: { type: \"env\" },\n };\n })), Match.when({ method: \"local\" }, Effect.fn(function* (config) {\n const endpoint = config.endpoint ?? DEFAULT_LOCAL_ENDPOINT;\n const autoStart = config.autoStart ?? endpoint === DEFAULT_LOCAL_ENDPOINT;\n if (autoStart) {\n const port = yield* Effect.try({\n try: () => Number.parseInt(new URL(endpoint).port, 10) ||\n Floci.DEFAULT_FLOCI_PORT,\n catch: () => new AuthError({\n message: `invalid local emulator endpoint: ${endpoint}`,\n }),\n });\n // Reuses anything already serving on the endpoint (dev-mode\n // JVM, hand-run container, previous session's container);\n // otherwise starts the managed floci container and waits for\n // health.\n yield* Floci.ensureFloci({ port }).pipe(Effect.mapError((e) => new AuthError({ message: e.message, cause: e })));\n }\n else {\n const serving = yield* Floci.isServing(endpoint);\n if (!serving) {\n return yield* Effect.fail(new AuthError({\n message: `no local AWS emulator is listening at ${endpoint} — start one, or omit \\`endpoint\\` to auto-start floci on ${DEFAULT_LOCAL_ENDPOINT}`,\n }));\n }\n }\n const region = config.region ?? \"us-east-1\";\n return {\n // Fixed dummy account — emulators accept any non-empty\n // credentials, and calling STS here would be pure overhead.\n accountId: config.accountId ?? LOCAL_ACCOUNT_ID,\n credentials: Effect.succeed({\n accessKeyId: Redacted.make(\"test\"),\n secretAccessKey: Redacted.make(\"test\"),\n sessionToken: undefined,\n region,\n }),\n region,\n endpoint,\n source: { type: \"local\", details: endpoint },\n };\n })), Match.when({ method: \"stored\" }, () => store.read(profileName, \"aws\").pipe(Effect.flatMap((creds) => creds == null\n ? Effect.fail(new AuthError({\n message: \"AWS stored credentials not found. Run: alchemy login --configure\",\n }))\n : Effect.succeed({\n accountId: creds.accountId,\n credentials: Effect.succeed({\n accessKeyId: Redacted.make(creds.accessKeyId),\n secretAccessKey: Redacted.make(creds.secretAccessKey),\n sessionToken: creds.sessionToken\n ? Redacted.make(creds.sessionToken)\n : undefined,\n region: creds.region,\n }),\n region: creds.region,\n source: { type: \"stored\" },\n })), \n // an older verson of the stored credentials didn't include the account ID, so we patch it hre\n Effect.flatMap((creds) => creds.accountId\n ? Effect.succeed(creds)\n : creds.credentials.pipe(Effect.flatMap((resolved) => getAccountId({\n accessKeyId: resolved.accessKeyId,\n secretAccessKey: resolved.secretAccessKey,\n sessionToken: resolved.sessionToken,\n region: creds.region,\n })), Effect.map((accountId) => ({\n ...creds,\n accountId,\n })), \n // re-write the stored credentials\n Effect.tap((creds) => creds.credentials.pipe(Effect.tap(({ accessKeyId, secretAccessKey, sessionToken }) => store.write(profileName, \"aws\", {\n accessKeyId: Redacted.value(accessKeyId),\n secretAccessKey: Redacted.value(secretAccessKey),\n sessionToken: sessionToken\n ? Redacted.value(sessionToken)\n : undefined,\n region: creds.region,\n accountId: creds.accountId,\n })))))))), Match.when({ method: \"sso\" }, (config) => Effect.gen(function* () {\n const auth = yield* DistilledAuth.Default;\n const profile = yield* auth\n .loadProfile(config.ssoProfile)\n .pipe(Effect.catch(() => Effect.succeed(undefined)));\n return {\n accountId: profile?.sso_account_id,\n credentials: auth\n .loadProfileCredentials(config.ssoProfile)\n .pipe(Effect.mapError((e) => new AuthError({\n message: \"failed to load credentials\",\n cause: e,\n })), Effect.orDie),\n region: profile?.region,\n source: { type: \"sso\", details: config.ssoProfile },\n };\n })), Match.exhaustive)\n .pipe(Effect.mapError((e) => new AuthError({ message: \"login failed\", cause: e })), Effect.flatMap(applyEnvRegionOverride));\n const prettyPrint = (profileName, config) => resolveCredentials(profileName, config).pipe(Effect.tap(Effect.fn(function* (creds) {\n const { accessKeyId, secretAccessKey, sessionToken } = yield* creds.credentials;\n yield* Console.log(` accessKeyId: ${displayRedacted(accessKeyId)}`);\n yield* Console.log(` secretAccessKey: ${displayRedacted(secretAccessKey)}`);\n if (sessionToken) {\n yield* Console.log(` sessionToken: ${displayRedacted(sessionToken)}`);\n }\n if (creds.region) {\n yield* Console.log(` region: ${creds.region}`);\n }\n yield* Console.log(\n //@ts-expect-error\n ` source: ${creds.source.details ? `${creds.source.type} - ${creds.source.details}` : creds.source.type}`);\n })));\n const logout = (profileName, config) => Match.value(config).pipe(Match.when({ method: \"env\" }, () => Effect.void), Match.when({ method: \"local\" }, () => Effect.void), Match.when({ method: \"sso\" }, (config) => Clank.info(`AWS: running 'aws sso logout --profile ${config.ssoProfile}'...`).pipe(Effect.zip(runSsoCommand(\"logout\", config.ssoProfile)), Effect.zip(clearDistilledSsoCache(config.ssoProfile)), Effect.match({\n onSuccess: () => Clank.success(\"AWS: SSO logout complete\"),\n onFailure: (e) => Clank.warn(`AWS: SSO logout failed: \\`${e.message}\\``),\n }))), Match.when({ method: \"stored\" }, () => store\n .delete(profileName, \"aws\")\n .pipe(Effect.andThen(Clank.success(\"AWS: stored credentials removed\")))), Match.exhaustive);\n const login = (profileName, config) => Match.value(config)\n .pipe(Match.when({ method: \"env\" }, () => Effect.void), Match.when({ method: \"local\" }, () => Effect.void), Match.when({ method: \"sso\" }, loginSSO), Match.when({ method: \"stored\" }, () => store\n .read(profileName, \"aws\")\n .pipe(Effect.flatMap((creds) => creds == null ? loginStored(profileName) : Effect.void))), Match.exhaustive)\n .pipe(Effect.mapError((e) => new AuthError({ message: \"login failed\", cause: e })));\n return {\n configure: configureCredentials,\n login,\n logout,\n prettyPrint,\n read: resolveCredentials,\n };\n}));\nconst runSsoCommand = (command, ssoProfile) => Effect.gen(function* () {\n const handle = yield* ChildProcess.make(\"aws\", [\"sso\", command, \"--profile\", ssoProfile], {\n shell: false,\n stdin: \"inherit\",\n stdout: \"inherit\",\n stderr: \"inherit\",\n });\n const exit = yield* handle.exitCode;\n if (exit !== 0) {\n return yield* new AuthError({\n message: `aws sso ${command} exited with code ${exit}`,\n });\n }\n}).pipe(Effect.scoped);\nconst loginSSO = (config) => Clank.info(`AWS SSO: running 'aws sso login --profile ${config.ssoProfile}'...`).pipe(Effect.andThen(runSsoCommand(\"login\", config.ssoProfile)), Effect.matchEffect({\n onSuccess: () => Clank.success(\"AWS SSO: login complete\"),\n onFailure: (e) => Clank.warn(`AWS SSO: login faield: \\`${e.message}\\``),\n}));\n/**\n * `aws sso logout` only clears AWS CLI's own caches — it does not know about the\n * `<sha1(sso_session)>.credentials.json` file that `@distilled.cloud/aws`\n * writes alongside the SSO token. Without this cleanup, `loadProfileCredentials`\n * short-circuits on the stale distilled cache file after logout and appears to\n * stay logged in until the role creds hit their TTL.\n */\nconst clearDistilledSsoCache = (ssoProfile) => Effect.gen(function* () {\n const auth = yield* DistilledAuth.Default;\n const profile = yield* auth.loadProfile(ssoProfile);\n const ssoSession = profile.sso_session;\n if (!ssoSession)\n return;\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const hash = NodeCrypto.createHash(\"sha1\").update(ssoSession).digest(\"hex\");\n const cacheFile = path.join(NodeOs.homedir(), \".aws\", \"sso\", \"cache\", `${hash}.credentials.json`);\n yield* fs.remove(cacheFile).pipe(Effect.catch(() => Effect.void));\n}).pipe(Effect.catch(() => Effect.void));\n//# sourceMappingURL=AuthProvider.js.map","import { DEFAULT_API_BASE_URL } from \"@distilled.cloud/axiom/Credentials\";\nimport * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as Match from \"effect/Match\";\nimport * as Redacted from \"effect/Redacted\";\nimport { AuthError, AuthProviderLayer, } from \"../Auth/AuthProvider.js\";\nimport { CredentialsStore, displayRedacted } from \"../Auth/Credentials.js\";\nimport { getEnv, getEnvRedacted, retryOnce } from \"../Auth/Env.js\";\nimport * as Clank from \"../Util/Clank.js\";\nconst STORAGE_KEY = \"axiom-stored\";\nconst options = [\n {\n value: \"env\",\n label: \"Environment Variables\",\n hint: \"AXIOM_TOKEN (or AXIOM_API_KEY) + optional AXIOM_ORG_ID, AXIOM_URL\",\n },\n {\n value: \"stored\",\n label: \"API Token or Personal Access Token\",\n hint: \"enter credentials interactively, stored in ~/.alchemy/credentials\",\n },\n];\nexport const AXIOM_AUTH_PROVIDER_NAME = \"Axiom\";\nconst promptOrgId = (required) => getEnv(\"AXIOM_ORG_ID\").pipe(Effect.flatMap((envOrgId) => Clank.text({\n message: required\n ? \"Axiom Org ID (required for PAT)\"\n : \"Axiom Org ID (Enter to skip)\",\n placeholder: envOrgId ?? \"\",\n defaultValue: envOrgId ?? \"\",\n validate: required\n ? (v) => (v.length === 0 ? \"Required\" : undefined)\n : undefined,\n}).pipe(retryOnce)));\n/**\n * Layer that registers the Axiom {@link AuthProvider} into the\n * {@link AuthProviders} registry when built. Include this in the Axiom\n * `providers()` layer so `alchemy login` can discover it.\n */\nexport const AxiomAuth = AuthProviderLayer()(AXIOM_AUTH_PROVIDER_NAME, Effect.gen(function* () {\n const store = yield* CredentialsStore;\n const loginStored = Effect.fn(function* (profileName) {\n const credentialType = yield* Clank.select({\n message: \"Axiom credential type\",\n options: [\n {\n value: \"apiToken\",\n label: \"API Token\",\n hint: \"recommended — scoped to specific datasets/actions\",\n },\n {\n value: \"pat\",\n label: \"Personal Access Token\",\n hint: \"full account control, requires Org ID\",\n },\n ],\n }).pipe(retryOnce);\n const apiBaseUrlPrompt = yield* Clank.text({\n message: \"Axiom API Base URL (Enter for default)\",\n placeholder: DEFAULT_API_BASE_URL,\n defaultValue: DEFAULT_API_BASE_URL,\n }).pipe(retryOnce);\n const apiBaseUrl = apiBaseUrlPrompt && apiBaseUrlPrompt.length > 0\n ? apiBaseUrlPrompt\n : undefined;\n return yield* Match.value(credentialType).pipe(Match.when(\"apiToken\", () => Effect.gen(function* () {\n const apiToken = yield* Clank.password({\n message: \"Axiom API Token\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n }).pipe(retryOnce);\n const orgId = yield* promptOrgId(false);\n yield* store.write(profileName, STORAGE_KEY, {\n type: \"apiToken\",\n apiToken,\n apiBaseUrl,\n orgId: orgId && orgId.length > 0 ? orgId : undefined,\n });\n yield* Clank.success(\"Axiom: credentials saved.\");\n return {\n method: \"stored\",\n credentialType: \"apiToken\",\n };\n })), Match.when(\"pat\", () => Effect.gen(function* () {\n const apiToken = yield* Clank.password({\n message: \"Axiom Personal Access Token\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n }).pipe(retryOnce);\n const orgId = yield* promptOrgId(true);\n yield* store.write(profileName, STORAGE_KEY, { type: \"pat\", apiToken, apiBaseUrl, orgId });\n yield* Clank.success(\"Axiom: credentials saved.\");\n return {\n method: \"stored\",\n credentialType: \"pat\",\n };\n })), Match.exhaustive);\n });\n const configureInteractive = (profileName) => Clank.select({\n message: \"Axiom authentication method\",\n options,\n }).pipe(Effect.flatMap((method) => Match.value(method).pipe(Match.when(\"env\", () => Effect.succeed({ method: \"env\" })), Match.when(\"stored\", () => loginStored(profileName)), Match.exhaustive)));\n const configureCredentials = (profileName, ctx) => Effect.gen(function* () {\n if (ctx.ci) {\n return { method: \"env\" };\n }\n return yield* configureInteractive(profileName);\n }).pipe(Effect.mapError((e) => new AuthError({\n message: \"failed to configure credentials\",\n cause: e,\n })));\n const resolveCredentials = (profileName, config) => Match.value(config).pipe(Match.when({ method: \"env\" }, Effect.fn(function* () {\n const apiToken = (yield* getEnvRedacted(\"AXIOM_TOKEN\")) ??\n (yield* getEnvRedacted(\"AXIOM_API_KEY\"));\n if (!apiToken) {\n return yield* new AuthError({\n message: \"Axiom env credentials not found. Set AXIOM_TOKEN (or AXIOM_API_KEY).\",\n });\n }\n const apiBaseUrl = (yield* getEnv(\"AXIOM_URL\")) ?? DEFAULT_API_BASE_URL;\n const orgId = yield* getEnv(\"AXIOM_ORG_ID\");\n if (orgId) {\n return {\n type: \"pat\",\n apiToken,\n apiBaseUrl,\n orgId,\n source: { type: \"env\" },\n };\n }\n return {\n type: \"apiToken\",\n apiToken,\n apiBaseUrl,\n source: { type: \"env\" },\n };\n })), Match.when({ method: \"stored\" }, () => store.read(profileName, STORAGE_KEY).pipe(Effect.flatMap((creds) => creds == null\n ? Effect.fail(new AuthError({\n message: \"Axiom stored credentials not found. Run: alchemy login --configure\",\n }))\n : Effect.succeed(Match.value(creds).pipe(Match.when({ type: \"apiToken\" }, (c) => ({\n type: \"apiToken\",\n apiToken: Redacted.make(c.apiToken),\n apiBaseUrl: c.apiBaseUrl ?? DEFAULT_API_BASE_URL,\n orgId: c.orgId,\n source: { type: \"stored\" },\n })), Match.when({ type: \"pat\" }, (c) => ({\n type: \"pat\",\n apiToken: Redacted.make(c.apiToken),\n apiBaseUrl: c.apiBaseUrl ?? DEFAULT_API_BASE_URL,\n orgId: c.orgId,\n source: { type: \"stored\" },\n })), Match.exhaustive))))), Match.exhaustive);\n const logout = (profileName, config) => Match.value(config).pipe(Match.when({ method: \"env\" }, () => Effect.void), Match.when({ method: \"stored\" }, () => store\n .delete(profileName, STORAGE_KEY)\n .pipe(Effect.andThen(Clank.success(\"Axiom: stored credentials removed\")))), Match.exhaustive);\n const login = (profileName, config) => Match.value(config)\n .pipe(Match.when({ method: \"env\" }, () => Effect.void), Match.when({ method: \"stored\" }, () => store\n .read(profileName, STORAGE_KEY)\n .pipe(Effect.flatMap((creds) => creds == null ? loginStored(profileName) : Effect.void))), Match.exhaustive)\n .pipe(Effect.mapError((e) => new AuthError({ message: \"login failed\", cause: e })));\n const prettyPrint = (profileName, config) => resolveCredentials(profileName, config).pipe(Effect.tap((creds) => {\n const sourceStr = creds.source.details\n ? `${creds.source.type} - ${creds.source.details}`\n : creds.source.type;\n return Match.value(creds).pipe(Match.when({ type: \"apiToken\" }, (c) => Effect.all([\n Console.log(` apiToken: ${displayRedacted(c.apiToken, 9)}`),\n Console.log(` apiBaseUrl: ${c.apiBaseUrl}`),\n Console.log(` orgId: ${c.orgId ?? \"(none)\"}`),\n Console.log(` source: ${sourceStr}`),\n ])), Match.when({ type: \"pat\" }, (c) => Effect.all([\n Console.log(` apiToken: ${displayRedacted(c.apiToken, 9)}`),\n Console.log(` apiBaseUrl: ${c.apiBaseUrl}`),\n Console.log(` orgId: ${c.orgId}`),\n Console.log(` source: ${sourceStr}`),\n ])), Match.exhaustive);\n }));\n return {\n configure: configureCredentials,\n logout,\n login,\n prettyPrint,\n read: resolveCredentials,\n };\n}));\n//# sourceMappingURL=AuthProvider.js.map","/**\n * Filename (under `~/.alchemy/credentials/{profile}/`) used to cache the\n * Cloudflare-deployed HTTP state store's endpoint + bearer token.\n *\n * Kept in this leaf module (rather than `StateStore/State.ts`) so the\n * Cloudflare auth provider can invalidate the cache on\n * `login --configure` / `logout` without importing the heavy state-store\n * module and creating an import cycle\n * (`StateStore/State.ts` -> `Providers.ts` -> `Auth/AuthProvider.ts`).\n */\nexport const CREDENTIALS_FILE = \"cloudflare-state-store\";\n/**\n * `true` when cached state-store credentials must not be trusted for the\n * current account:\n *\n * - the file predates the `accountId` field (legacy cache — exactly the\n * artifact that caused deploys to silently target the wrong account), or\n * - it was minted against a different account than the one now in use.\n *\n * A stale cache is discarded and re-derived from the current account.\n */\nexport const isStateStoreCredentialsStale = (credentials, currentAccountId) => credentials.accountId == null || credentials.accountId !== currentAccountId;\n//# sourceMappingURL=CredentialsFile.js.map","import * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport crypto from \"node:crypto\";\nimport http from \"node:http\";\nimport { AUTH_ERROR_URL, AUTH_SUCCESS_URL } from \"../../Auth/AuthProvider.js\";\nimport { OAUTH_CLIENT_ID, OAUTH_ENDPOINTS, OAUTH_LOCAL_CALLBACK_URI, OAUTH_REDIRECT_URI, } from \"./AuthProvider.js\";\nexport class OAuthError extends Data.TaggedError(\"OAuthError\") {\n}\nfunction generateState(length = 32) {\n return Buffer.from(crypto.randomBytes(length)).toString(\"base64url\");\n}\nfunction generatePKCE(length = 96) {\n const verifier = Buffer.from(crypto.randomBytes(length)).toString(\"base64url\");\n const challenge = crypto\n .createHash(\"sha256\")\n .update(verifier)\n .digest(\"base64url\");\n return { verifier, challenge };\n}\nfunction extractCredentials(json) {\n return {\n type: \"oauth\",\n access: json.access_token,\n refresh: json.refresh_token,\n expires: Date.now() + json.expires_in * 1000,\n scopes: json.scope.split(\" \"),\n };\n}\nconst tokenRequest = (body) => Effect.gen(function* () {\n const res = yield* Effect.tryPromise({\n try: () => fetch(OAUTH_ENDPOINTS.token, {\n method: \"POST\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n body: new URLSearchParams(body).toString(),\n }),\n catch: (err) => new OAuthError({\n error: \"network_error\",\n errorDescription: `Token request failed: ${err}`,\n }),\n });\n if (!res.ok) {\n const json = yield* Effect.tryPromise({\n try: () => res.json(),\n catch: () => new OAuthError({\n error: \"parse_error\",\n errorDescription: `Token endpoint returned ${res.status}`,\n }),\n });\n return yield* new OAuthError({\n error: json.error,\n errorDescription: json.error_description,\n });\n }\n const json = yield* Effect.tryPromise({\n try: () => res.json(),\n catch: () => new OAuthError({\n error: \"parse_error\",\n errorDescription: \"Failed to parse token response\",\n }),\n });\n return extractCredentials(json);\n});\n/**\n * Generate an authorization URL with PKCE for the given scopes.\n */\nexport function authorize(scopes) {\n const state = generateState();\n const pkce = generatePKCE();\n const url = new URL(OAUTH_ENDPOINTS.authorize);\n url.searchParams.set(\"client_id\", OAUTH_CLIENT_ID);\n url.searchParams.set(\"redirect_uri\", OAUTH_REDIRECT_URI);\n url.searchParams.set(\"response_type\", \"code\");\n url.searchParams.set(\"scope\", scopes.join(\" \"));\n url.searchParams.set(\"state\", state);\n url.searchParams.set(\"code_challenge\", pkce.challenge);\n url.searchParams.set(\"code_challenge_method\", \"S256\");\n return { url: url.toString(), state, verifier: pkce.verifier };\n}\n/**\n * Exchange an authorization code for OAuth credentials.\n */\nexport const exchange = (code, verifier) => tokenRequest({\n grant_type: \"authorization_code\",\n code,\n code_verifier: verifier,\n client_id: OAUTH_CLIENT_ID,\n redirect_uri: OAUTH_REDIRECT_URI,\n});\n/**\n * Refresh expired OAuth credentials.\n */\nexport const refresh = (credentials) => tokenRequest({\n grant_type: \"refresh_token\",\n refresh_token: credentials.refresh,\n client_id: OAUTH_CLIENT_ID,\n redirect_uri: OAUTH_REDIRECT_URI,\n});\n/**\n * Revoke OAuth credentials.\n */\nexport const revoke = (credentials) => Effect.gen(function* () {\n yield* Effect.tryPromise({\n try: () => fetch(OAUTH_ENDPOINTS.revoke, {\n method: \"POST\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n body: new URLSearchParams({\n refresh_token: credentials.refresh,\n client_id: OAUTH_CLIENT_ID,\n redirect_uri: OAUTH_REDIRECT_URI,\n }).toString(),\n }),\n catch: (err) => new OAuthError({\n error: \"network_error\",\n errorDescription: `Revoke request failed: ${err}`,\n }),\n });\n});\n/**\n * Exchange a code copied from the hosted relay page, or extract the code from\n * either the hosted or loopback callback URL.\n */\nexport const exchangeCallbackInput = (input, authorization) => Effect.gen(function* () {\n const value = input.trim();\n let code = value;\n let state = null;\n try {\n const url = new URL(value);\n code = url.searchParams.get(\"code\") ?? \"\";\n state = url.searchParams.get(\"state\");\n }\n catch {\n const separator = value.lastIndexOf(\"#\");\n if (separator >= 0) {\n code = value.slice(0, separator);\n state = value.slice(separator + 1);\n }\n }\n if (!code) {\n return yield* new OAuthError({\n error: \"invalid_request\",\n errorDescription: \"The authorization code is missing.\",\n });\n }\n if (state !== null && state !== authorization.state) {\n return yield* new OAuthError({\n error: \"invalid_request\",\n errorDescription: \"The authorization state does not match.\",\n });\n }\n return yield* exchange(code, authorization.verifier);\n});\n/**\n * Start a local HTTP server to listen for the OAuth callback, exchange\n * the authorization code, and return the credentials.\n *\n * Times out after 5 minutes.\n */\nexport const callback = (authorization) => Effect.tryPromise({\n try: (signal) => callbackPromise(authorization, signal),\n catch: (err) => {\n if (err instanceof OAuthError)\n return err;\n return new OAuthError({\n error: \"callback_error\",\n errorDescription: `OAuth callback failed: ${err}`,\n });\n },\n});\nfunction callbackPromise(authorization, signal) {\n const { pathname, port } = new URL(OAUTH_LOCAL_CALLBACK_URI);\n return new Promise((resolve, reject) => {\n const server = http.createServer(async (req, res) => {\n const url = new URL(req.url ?? \"/\", `http://${req.headers.host}`);\n if (url.pathname === \"/auth/ping\") {\n res.writeHead(req.method === \"OPTIONS\" ? 204 : 200, {\n \"Access-Control-Allow-Origin\": new URL(OAUTH_REDIRECT_URI).origin,\n \"Access-Control-Allow-Methods\": \"GET, OPTIONS\",\n \"Access-Control-Allow-Private-Network\": \"true\",\n \"Cache-Control\": \"no-store\",\n });\n res.end();\n return;\n }\n if (url.pathname !== pathname) {\n res.statusCode = 404;\n res.end(\"Not Found\");\n return;\n }\n const error = url.searchParams.get(\"error\");\n const errorDescription = url.searchParams.get(\"error_description\");\n if (error) {\n res.writeHead(302, { Location: AUTH_ERROR_URL });\n res.end();\n cleanup();\n reject(new OAuthError({\n error,\n errorDescription: errorDescription ?? \"An unknown error occurred.\",\n }));\n return;\n }\n const code = url.searchParams.get(\"code\");\n const state = url.searchParams.get(\"state\");\n if (!code || !state) {\n res.writeHead(302, { Location: AUTH_ERROR_URL });\n res.end();\n cleanup();\n reject(new OAuthError({\n error: \"invalid_request\",\n errorDescription: \"Missing code or state\",\n }));\n return;\n }\n if (state !== authorization.state) {\n res.writeHead(302, { Location: AUTH_ERROR_URL });\n res.end();\n cleanup();\n reject(new OAuthError({\n error: \"invalid_request\",\n errorDescription: \"Invalid state\",\n }));\n return;\n }\n try {\n const credentials = await Effect.runPromise(exchange(code, authorization.verifier));\n res.writeHead(302, { Location: AUTH_SUCCESS_URL });\n res.end();\n cleanup();\n resolve(credentials);\n }\n catch (err) {\n res.writeHead(302, { Location: AUTH_ERROR_URL });\n res.end();\n cleanup();\n reject(err);\n }\n });\n const timeout = setTimeout(() => {\n cleanup();\n reject(new OAuthError({\n error: \"timeout\",\n errorDescription: \"The authorization process timed out.\",\n }));\n }, 5 * 60 * 1000);\n function cleanup() {\n clearTimeout(timeout);\n signal.removeEventListener(\"abort\", cleanup);\n server.close();\n }\n signal.addEventListener(\"abort\", cleanup, { once: true });\n server.on(\"error\", (err) => {\n cleanup();\n reject(new OAuthError({\n error: \"server_error\",\n errorDescription: `Failed to start callback server: ${err.message}`,\n }));\n });\n server.listen(Number(port));\n });\n}\n//# sourceMappingURL=OAuthClient.js.map","import * as cfAccounts from \"@distilled.cloud/cloudflare/accounts\";\nimport * as CfCredentialsModule from \"@distilled.cloud/cloudflare/Credentials\";\nimport * as Console from \"effect/Console\";\nimport * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Match from \"effect/Match\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\";\nimport * as HttpClient from \"effect/unstable/http/HttpClient\";\nimport { AuthError, AuthProviderLayer, } from \"../../Auth/AuthProvider.js\";\nimport { CredentialsStore, displayRedacted } from \"../../Auth/Credentials.js\";\nimport { getEnv, getEnvRedacted, getEnvRequired, retryOnce, } from \"../../Auth/Env.js\";\nimport * as Clank from \"../../Util/Clank.js\";\nimport { CREDENTIALS_FILE as STATE_STORE_CREDENTIALS_FILE } from \"../StateStore/CredentialsFile.js\";\nimport * as OAuthClient from \"./OAuthClient.js\";\nconst options = [\n {\n value: \"oauth\",\n label: \"OAuth\",\n hint: \"recommended — browser-based login with automatic token refresh\",\n },\n {\n value: \"env\",\n label: \"Environment Variables\",\n hint: \"CLOUDFLARE_API_TOKEN or CLOUDFLARE_API_KEY + CLOUDFLARE_EMAIL\",\n },\n {\n value: \"stored\",\n label: \"API Token or API Key\",\n hint: \"enter credentials interactively, stored in ~/.alchemy/credentials\",\n },\n];\nexport const CLOUDFLARE_AUTH_PROVIDER_NAME = \"Cloudflare\";\nconst withOAuthCredentials = (accessToken, effect) => Effect.provide(effect, Layer.mergeAll(CfCredentialsModule.fromOAuth({\n load: Effect.succeed({ accessToken }),\n refresh: () => Effect.die(\"refresh not expected during account selection\"),\n}), FetchHttpClient.layer));\nconst selectAccount = (accessToken) => Effect.gen(function* () {\n const list = yield* cfAccounts.listAccounts;\n const response = yield* list({});\n const accounts = response.result;\n if (accounts.length === 0) {\n return yield* new AuthError({\n message: \"Cloudflare: no accounts found for this credential.\",\n });\n }\n if (accounts.length === 1) {\n const account = accounts[0];\n yield* Clank.info(`Cloudflare: using account: ${account.name} (${account.id})`);\n return account.id;\n }\n return yield* Clank.select({\n message: \"Select a Cloudflare account\",\n options: accounts.map((a) => ({\n value: a.id,\n label: a.name,\n hint: a.id,\n })),\n }).pipe(retryOnce);\n}).pipe((e) => withOAuthCredentials(accessToken, e));\n/**\n * Cloudflare account IDs are 32 lowercase hex characters. Placeholder\n * values (\"\", \"-\", \"dummy\", …) end up interpolated into API paths and\n * surface as baffling `InvalidRoute: Could not route to\n * /accounts/<value>/...` errors, so reject them up front with an\n * actionable message instead.\n */\nconst ACCOUNT_ID_PATTERN = /^[0-9a-f]{32}$/i;\nexport const validateAccountId = (accountId, source) => {\n const trimmed = accountId?.trim() ?? \"\";\n if (trimmed.length === 0) {\n return Effect.fail(new AuthError({\n message: `Cloudflare account ID is missing (${source}). ` +\n \"Set CLOUDFLARE_ACCOUNT_ID or re-run 'alchemy login' and provide your account ID \" +\n \"(found in the Cloudflare dashboard under Workers & Pages → Account details).\",\n }));\n }\n if (!ACCOUNT_ID_PATTERN.test(trimmed)) {\n return Effect.fail(new AuthError({\n message: `'${trimmed}' is not a valid Cloudflare account ID (${source}) — expected 32 hex characters. ` +\n \"Copy the account ID from the Cloudflare dashboard (Workers & Pages → Account details) \" +\n \"into CLOUDFLARE_ACCOUNT_ID or re-run 'alchemy login'.\",\n }));\n }\n return Effect.succeed(trimmed.toLowerCase());\n};\nconst promptAccountId = () => getEnv(\"CLOUDFLARE_ACCOUNT_ID\").pipe(Effect.flatMap((envAccountId) => Clank.text({\n message: \"Cloudflare Account ID (Enter to skip)\",\n placeholder: envAccountId ?? \"\",\n defaultValue: envAccountId ?? \"\",\n validate: (v) => v.trim().length === 0 || ACCOUNT_ID_PATTERN.test(v.trim())\n ? undefined\n : \"Expected a 32-character hex account ID (Workers & Pages → Account details)\",\n}).pipe(retryOnce)));\nconst promptOAuthScopes = () => Clank.confirm({\n message: \"Customize OAuth scopes? (default covers typical use cases)\",\n initialValue: false,\n}).pipe(retryOnce, Effect.flatMap((customize) => {\n if (!customize)\n return Effect.succeed([...DEFAULT_SCOPES]);\n return Clank.multiselect({\n message: \"Select OAuth scopes\",\n initialValues: DEFAULT_SCOPES,\n options: Object.entries(ALL_SCOPES).map(([value, hint]) => ({\n value: value,\n label: value,\n hint,\n })),\n required: true,\n }).pipe(Effect.map((s) => s), retryOnce);\n}));\n/**\n * Layer that registers the Cloudflare {@link AuthProvider} into the\n * {@link AuthProviders} registry when built. Include this in the Cloudflare\n * `providers()` layer so `alchemy login` can discover it.\n */\nexport const CloudflareAuth = AuthProviderLayer()(CLOUDFLARE_AUTH_PROVIDER_NAME, Effect.gen(function* () {\n const store = yield* CredentialsStore;\n const oauthLogin = (profileName, scopes) => Effect.gen(function* () {\n const authorization = OAuthClient.authorize([\n ...scopes,\n \"offline_access\",\n ]);\n yield* Clank.info(\"Cloudflare: opening browser for OAuth login...\");\n yield* Clank.info(authorization.url);\n yield* Clank.openUrl(authorization.url).pipe(Effect.catch(() => Clank.warn(\"Cloudflare: could not open browser automatically. Please open the URL above manually.\")));\n yield* Clank.info(\"Cloudflare: waiting for authorization (up to 5 minutes).\");\n const credentials = yield* Effect.raceFirst(OAuthClient.callback(authorization), Clank.text({\n message: \"Paste the authorization code or callback URL\",\n placeholder: \"The browser will complete this automatically when local\",\n validate: (value) => value.trim().length > 0 ? undefined : \"Paste a code or URL\",\n }).pipe(Effect.flatMap((input) => OAuthClient.exchangeCallbackInput(input, authorization))));\n yield* store.write(profileName, \"cf-oauth\", credentials);\n yield* Clank.success(\"Cloudflare: OAuth credentials saved.\");\n return credentials;\n });\n const loginStored = Effect.fn(function* (profileName) {\n const credentialType = yield* Clank.select({\n message: \"Cloudflare credential type\",\n options: [\n {\n value: \"apiToken\",\n label: \"API Token\",\n hint: \"recommended\",\n },\n { value: \"apiKey\", label: \"API Key + Email\" },\n ],\n }).pipe(retryOnce);\n return yield* Match.value(credentialType).pipe(Match.when(\"apiToken\", () => Effect.gen(function* () {\n const apiToken = yield* Clank.password({\n message: \"Cloudflare API Token\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n }).pipe(retryOnce);\n const accountId = yield* promptAccountId();\n yield* store.write(profileName, \"cf-stored\", { type: \"apiToken\", apiToken, accountId });\n yield* Clank.success(\"Cloudflare: credentials saved.\");\n return {\n method: \"stored\",\n credentialType: \"apiToken\",\n };\n })), Match.when(\"apiKey\", () => Effect.gen(function* () {\n const apiKey = yield* Clank.text({\n message: \"Cloudflare API Key\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n }).pipe(retryOnce);\n const email = yield* Clank.text({\n message: \"Cloudflare Email\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n }).pipe(retryOnce);\n const accountId = yield* promptAccountId();\n yield* store.write(profileName, \"cf-stored\", { type: \"apiKey\", apiKey, email, accountId });\n yield* Clank.success(\"Cloudflare: credentials saved.\");\n return {\n method: \"stored\",\n credentialType: \"apiKey\",\n };\n })), Match.exhaustive);\n });\n const configureOAuth = Effect.fn(function* (profileName) {\n const scopes = yield* promptOAuthScopes();\n const oauthCreds = yield* oauthLogin(profileName, scopes);\n const accountId = yield* selectAccount(oauthCreds.access).pipe(Effect.mapError((e) => new AuthError({\n message: \"Cloudflare: could not list accounts\",\n cause: e,\n })));\n return {\n method: \"oauth\",\n scopes,\n accountId,\n };\n });\n const configureInteractive = (profileName) => Clank.select({\n message: \"Cloudflare authentication method\",\n options,\n }).pipe(Effect.flatMap((method) => Match.value(method).pipe(Match.when(\"env\", () => Effect.succeed({ method: \"env\" })), Match.when(\"oauth\", () => configureOAuth(profileName)), Match.when(\"stored\", () => loginStored(profileName)), Match.exhaustive)));\n const configureCredentials = (profileName, ctx) => Effect.gen(function* () {\n const config = ctx.ci\n ? { method: \"env\" }\n : yield* configureInteractive(profileName);\n // Re-configuring auth may point this profile at a different\n // Cloudflare account. The cached state-store credentials\n // (`~/.alchemy/credentials/{profile}/cloudflare-state-store.json`)\n // are minted per-account, so drop them here; the next deploy\n // re-derives them against the freshly-configured account.\n yield* store\n .delete(profileName, STATE_STORE_CREDENTIALS_FILE)\n .pipe(Effect.ignore);\n return config;\n }).pipe(Effect.mapError((e) => new AuthError({\n message: \"failed to configure credentials\",\n cause: e,\n })));\n const resolveCredentials = (profileName, config) => Match.value(config).pipe(Match.when({ method: \"env\" }, Effect.fn(function* () {\n const accountId = yield* getEnvRequired(\"CLOUDFLARE_ACCOUNT_ID\").pipe(Effect.flatMap((id) => validateAccountId(id, \"from the CLOUDFLARE_ACCOUNT_ID env var\")));\n const apiToken = yield* getEnvRedacted(\"CLOUDFLARE_API_TOKEN\");\n if (apiToken) {\n return {\n type: \"apiToken\",\n apiToken,\n accountId,\n source: { type: \"env\" },\n };\n }\n const apiKey = yield* getEnvRedacted(\"CLOUDFLARE_API_KEY\");\n const email = yield* getEnvRedacted(\"CLOUDFLARE_EMAIL\");\n if (apiKey && email) {\n return {\n type: \"apiKey\",\n apiKey,\n email,\n accountId,\n source: { type: \"env\" },\n };\n }\n return yield* new AuthError({\n message: \"Cloudflare env credentials not found. Set CLOUDFLARE_API_TOKEN or CLOUDFLARE_API_KEY + CLOUDFLARE_EMAIL.\",\n });\n })), Match.when({ method: \"stored\" }, () => store\n .read(profileName, \"cf-stored\")\n .pipe(Effect.flatMap((creds) => creds == null\n ? Effect.fail(new AuthError({\n message: \"Cloudflare stored credentials not found. Run: alchemy login --configure\",\n }))\n : Effect.gen(function* () {\n // The account ID prompt is skippable, so stored\n // credentials may carry an empty accountId; fall\n // back to the env var before validating.\n const envAccountId = yield* getEnv(\"CLOUDFLARE_ACCOUNT_ID\");\n const accountId = yield* validateAccountId(creds.accountId?.trim() || envAccountId, `stored for profile '${profileName}'`);\n return Match.value(creds).pipe(Match.when({ type: \"apiToken\" }, (c) => ({\n type: \"apiToken\",\n apiToken: Redacted.make(c.apiToken),\n accountId,\n source: { type: \"stored\" },\n })), Match.when({ type: \"apiKey\" }, (c) => ({\n type: \"apiKey\",\n apiKey: Redacted.make(c.apiKey),\n email: Redacted.make(c.email),\n accountId,\n source: { type: \"stored\" },\n })), Match.exhaustive);\n })))), Match.when({ method: \"oauth\" }, (cfg) => Effect.gen(function* () {\n const accountId = yield* validateAccountId(cfg.accountId, `configured for profile '${profileName}'`);\n const creds = yield* store.read(profileName, \"cf-oauth\");\n if (creds == null || creds.type !== \"oauth\") {\n return yield* Effect.fail(new AuthError({\n message: \"Cloudflare OAuth credentials not found. Run: alchemy login\",\n }));\n }\n // Refresh proactively if the token has expired (or is within\n // 10s of expiring). Persist the refreshed creds so subsequent\n // resolves don't repeat the round-trip.\n const fresh = creds.expires > Date.now() + 10_000\n ? creds\n : yield* OAuthClient.refresh(creds).pipe(Effect.tap((refreshed) => store.write(profileName, \"cf-oauth\", refreshed)), Effect.mapError((e) => new AuthError({\n message: \"Cloudflare OAuth refresh failed. Run: alchemy login\",\n cause: e,\n })));\n return {\n type: \"oauth\",\n accessToken: Redacted.make(fresh.access),\n expires: fresh.expires,\n accountId,\n source: { type: \"oauth\" },\n };\n })), Match.exhaustive);\n const logout = (profileName, config) => Match.value(config)\n .pipe(Match.when({ method: \"env\" }, () => Effect.void), Match.when({ method: \"stored\" }, () => store\n .delete(profileName, \"cf-stored\")\n .pipe(Effect.andThen(Clank.success(\"Cloudflare: stored credentials removed\")))), Match.when({ method: \"oauth\" }, () => store\n .read(profileName, \"cf-oauth\")\n .pipe(Effect.tap((creds) => creds?.type === \"oauth\"\n ? OAuthClient.revoke(creds).pipe(Effect.catchTag(\"OAuthError\", (err) => Clank.warn(`Cloudflare: could not revoke OAuth token: ${err.errorDescription}`)))\n : Effect.void), Effect.andThen(store.delete(profileName, \"cf-oauth\")), Effect.andThen(Clank.success(\"Cloudflare: OAuth credentials removed.\")))), Match.exhaustive)\n // The cached state-store credentials are derived from the account we\n // just logged out of, so drop them regardless of auth method.\n .pipe(Effect.andThen(store\n .delete(profileName, STATE_STORE_CREDENTIALS_FILE)\n .pipe(Effect.ignore)));\n const login = (profileName, config) => Match.value(config)\n .pipe(Match.when({ method: \"env\" }, () => Effect.void), Match.when({ method: \"stored\" }, () => store\n .read(profileName, \"cf-stored\")\n .pipe(Effect.flatMap((creds) => creds == null ? loginStored(profileName) : Effect.void))), Match.when({ method: \"oauth\" }, (c) => Effect.gen(function* () {\n const creds = yield* store.read(profileName, \"cf-oauth\");\n if (creds?.type === \"oauth\") {\n yield* Clank.info(\"Cloudflare: refreshing OAuth credentials...\");\n yield* OAuthClient.refresh(creds).pipe(Effect.flatMap((refreshed) => store\n .write(profileName, \"cf-oauth\", refreshed)\n .pipe(Effect.andThen(Clank.success(\"Cloudflare: OAuth credentials refreshed.\")))), Effect.catchTag(\"OAuthError\", () => oauthLogin(profileName, c.scopes).pipe(Effect.asVoid)));\n return;\n }\n yield* oauthLogin(profileName, c.scopes);\n })), Match.exhaustive)\n .pipe(Effect.mapError((e) => new AuthError({ message: \"login failed\", cause: e })));\n const prettyPrint = (profileName, config) => resolveCredentials(profileName, config).pipe(Effect.tap((creds) => {\n const sourceStr = creds.source.details\n ? `${creds.source.type} - ${creds.source.details}`\n : creds.source.type;\n return Match.value(creds).pipe(Match.when({ type: \"apiToken\" }, (c) => Effect.all([\n Console.log(` apiToken: ${displayRedacted(c.apiToken, 9)}`),\n Console.log(` accountId: ${c.accountId}`),\n Console.log(` source: ${sourceStr}`),\n ])), Match.when({ type: \"apiKey\" }, (c) => Effect.all([\n Console.log(` apiKey: ${displayRedacted(c.apiKey)}`),\n Console.log(` email: ${displayRedacted(c.email)}`),\n Console.log(` accountId: ${c.accountId}`),\n Console.log(` source: ${sourceStr}`),\n ])), Match.when({ type: \"oauth\" }, (c) => {\n const remainingMs = c.expires - Date.now();\n const expiresAt = new Date(c.expires).toISOString();\n const expiresStr = remainingMs <= 0\n ? `expired (${expiresAt})`\n : `in ${Duration.format(Duration.millis(remainingMs))} (${expiresAt})`;\n return Effect.all([\n Console.log(` accessToken: ${displayRedacted(c.accessToken)}`),\n Console.log(` expires: ${expiresStr}`),\n Console.log(` accountId: ${c.accountId}`),\n Console.log(` source: ${sourceStr}`),\n ]);\n }), Match.exhaustive);\n }));\n return {\n configure: configureCredentials,\n logout,\n login,\n prettyPrint,\n read: resolveCredentials,\n };\n}));\nexport const ALL_SCOPES = {\n \"access:read\": \"See Cloudflare Access data such as zones, applications, certificates, device postures, groups, identity providers, login counts, organizations, policies, service tokens, and users\",\n \"access:write\": \"See and change Cloudflare Access data such as zones, applications, certificates, device postures, groups, identity providers, login counts, organizations, policies, service tokens, and users\",\n \"account:read\": \"See your account info such as account details, analytics, and memberships\",\n \"agw:read\": \"Grants read level access to Agents Gateway\",\n \"agw:run\": \"Grants run level access to Agents Gateway\",\n \"agw:write\": \"Grants read and write level access to Agents Gateway\",\n \"ai:read\": \"Grants read level access to Workers AI\",\n \"ai:write\": \"Grants write level access to Workers AI\",\n \"aiaudit:read\": \"Grants read level access to AI Audit\",\n \"aiaudit:write\": \"Grants write level access to AI Audit\",\n \"aig:read\": \"Grants read level access to AI Gateway\",\n \"aig:write\": \"Grants write level access to AI Gateway\",\n \"auditlogs:read\": \"View Cloudflare Account Audit Logs\",\n \"browser:read\": \"Grants read level access to Browser Rendering\",\n \"browser:write\": \"Grants write level access to Browser Rendering\",\n \"cfone:read\": \"Grants read level access to Cloudforce One data\",\n \"cfone:write\": \"Grants write level access to Cloudforce One data\",\n \"cloudchamber:write\": \"See and make changes to Cloudchamber\",\n \"connectivity:admin\": \"See, change, and bind to Connectivity Directory services, including creating services targeting Cloudflare Tunnel\",\n \"connectivity:bind\": \"read, list, and bind to Connectivity Directory services, as well as read and list Cloudflare Tunnels\",\n \"connectivity:read\": \"See Connectivity Directory services and Cloudflare Tunnels\",\n \"constellation:write\": \"Grants write access to Constellation configuration and models\",\n \"containers:write\": \"See and make changes to Workers Containers\",\n \"d1:write\": \"See and make changes to D1\",\n \"dex:read\": \"Grants read level access to Cloudflare DEX\",\n \"dex:write\": \"Grants write level access to Cloudflare DEX\",\n \"dns_analytics:read\": \"Grants read level access to Cloudflare DNS Analytics\",\n \"dns_records:edit\": \"Grants edit level access to dns records\",\n \"dns_records:read\": \"Grants read level access to dns records\",\n \"dns_settings:read\": \"Grants read level access to Cloudflare DNS Settings\",\n \"firstpartytags:write\": \"Can see, edit and publish Google tag gateway configuration.\",\n \"lb:edit\": \"Grants edit level access to lb and lb pools\",\n \"lb:read\": \"Grants read level access to lb and lb pools\",\n \"logpush:read\": \"See Cloudflare Logpush data\",\n \"logpush:write\": \"See and change Cloudflare Logpush data\",\n \"notification:read\": \"View Cloudflare Notifications\",\n \"notification:write\": \"View and Modify Cloudflare Notifications\",\n \"pages:read\": \"See Cloudflare Pages projects, settings and deployments\",\n \"pages:write\": \"See and change Cloudflare Pages projects, settings and deployments\",\n \"pipelines:read\": \"Grants read level access to Cloudflare Pipelines\",\n \"pipelines:setup\": \"Grants permission to generate R2 tokens for Workers Pipelines\",\n \"pipelines:write\": \"Grants write level access to Cloudflare Pipelines\",\n \"query_cache:write\": \"See and make changes to Hyperdrive\",\n \"queues:write\": \"See and change Cloudflare Queues settings and data\",\n \"r2_catalog:write\": \"Grants write level access to R2 Data Catalog\",\n \"radar:read\": \"Grants access to read Cloudflare Radar data\",\n \"ai-search:read\": \"Grants read level access to AI Search\",\n \"ai-search:write\": \"Grants write level access to AI Search\",\n \"ai-search:run\": \"Grants run level access to AI Search\",\n \"secrets_store:read\": \"Grants read level access to Secrets Store\",\n \"secrets_store:write\": \"Grants write level access to Secrets Store\",\n \"ssl_certs:write\": \"Grants read and write access to SSL MTLS certificates or Certificate Store\",\n \"sso-connector:read\": \"See Cloudflare SSO connectors\",\n \"sso-connector:write\": \"See Cloudflare SSO connectors to toggle activation and deactivation of SSO\",\n \"teams:pii\": \"See personally identifiable Cloudflare Teams data\",\n \"teams:read\": \"See Cloudflare Teams data such as zones, gateway, and argo tunnel details\",\n \"teams:secure_location\": \"See all DNS Location data but can only change secure DNS Locations\",\n \"teams:write\": \"See and change Cloudflare Teams data such as zones, gateway, and argo tunnel details\",\n \"url_scanner:read\": \"Grants read level access to URL Scanner\",\n \"url_scanner:write\": \"Grants write level access to URL Scanner\",\n \"user:read\": \"See your user info such as name, email address, and account memberships\",\n \"vectorize:write\": \"See and make changes to Vectorize\",\n \"workers:read\": \"See Cloudflare Workers data such as zones, KV storage, R2 storage, scripts, and routes\",\n \"workers:write\": \"See and change Cloudflare Workers data such as zones, KV storage, R2 storage, scripts, and routes\",\n \"workers_builds:read\": \"See Cloudflare Workers Builds data such as builds, build configuration, and build logs\",\n \"workers_builds:write\": \"See and change Cloudflare Workers Builds data such as builds, build configuration, and build logs\",\n \"workers_kv:write\": \"See and change Cloudflare Workers KV Storage data such as keys and namespaces\",\n \"workers_observability:read\": \"Grants read access to Cloudflare Workers Observability\",\n \"workers_observability:write\": \"Grants read and write access to Cloudflare Workers Observability\",\n \"workers_observability_telemetry:write\": \"Grants write access to Cloudflare Workers Observability Telemetry API\",\n \"workers_routes:write\": \"See and change Cloudflare Workers data such as filters and routes\",\n \"workers_scripts:write\": \"See and change Cloudflare Workers scripts, durable objects, subdomains, triggers, and tail data\",\n \"workers_tail:read\": \"See Cloudflare Workers tail and script data\",\n \"zone:read\": \"Grants read level access to account zone\",\n};\nexport const DEFAULT_SCOPES = [\n \"account:read\",\n \"ai-search:write\",\n \"ai-search:run\",\n \"ai:write\",\n \"aig:read\",\n \"aig:write\",\n \"cloudchamber:write\",\n \"connectivity:admin\",\n \"containers:write\",\n \"d1:write\",\n \"pages:write\",\n \"pipelines:write\",\n \"queues:write\",\n \"secrets_store:write\",\n \"ssl_certs:write\",\n \"user:read\",\n \"vectorize:write\",\n \"workers_kv:write\",\n \"workers_observability:read\",\n \"workers_observability:write\",\n \"workers_observability_telemetry:write\",\n \"workers_routes:write\",\n \"workers_scripts:write\",\n \"workers_tail:read\",\n \"workers:write\",\n \"zone:read\",\n];\nexport const OAUTH_CLIENT_ID = \"6d8c2255-0773-45f6-b376-2914632e6f91\";\nexport const OAUTH_REDIRECT_URI = \"https://alchemy.run/auth/callback\";\nexport const OAUTH_LOCAL_CALLBACK_URI = \"http://localhost:9976/auth/callback\";\nexport const OAUTH_ENDPOINTS = {\n authorize: \"https://dash.cloudflare.com/oauth2/authorize\",\n token: \"https://dash.cloudflare.com/oauth2/token\",\n revoke: \"https://dash.cloudflare.com/oauth2/revoke\",\n};\n//# sourceMappingURL=AuthProvider.js.map","import * as Effect from \"effect/Effect\";\nimport { AuthError } from \"../Auth/AuthProvider.js\";\nimport { getEnv } from \"../Auth/Env.js\";\n/**\n * Normalize a user-supplied GitHub host or URL into the REST API base URL\n * Octokit expects, following the same conventions as the `gh` CLI and the\n * Terraform GitHub provider:\n *\n * - `github.com` / `api.github.com` → `undefined` (Octokit's default)\n * - GitHub Enterprise Cloud with data residency (`acme.ghe.com` or\n * `api.acme.ghe.com`) → `https://api.acme.ghe.com`\n * - GitHub Enterprise Server (`github.example.com`) → `https://github.example.com/api/v3`;\n * an explicit path (e.g. an already-complete `/api/v3` URL) is honored as-is.\n *\n * Accepts a bare hostname or a full URL.\n */\nexport const normalizeGitHubBaseUrl = (input) => Effect.try({\n try: () => {\n const trimmed = input.trim();\n const url = new URL(trimmed.includes(\"://\") ? trimmed : `https://${trimmed}`);\n const host = url.hostname.toLowerCase();\n if (host === \"github.com\" ||\n host === \"www.github.com\" ||\n host === \"api.github.com\") {\n return undefined;\n }\n if (host.endsWith(\".ghe.com\")) {\n return `https://${host.startsWith(\"api.\") ? host : `api.${host}`}`;\n }\n const path = url.pathname.replace(/\\/+$/, \"\");\n return `${url.protocol}//${url.host}${path === \"\" ? \"/api/v3\" : path}`;\n },\n catch: () => new AuthError({\n message: `Invalid GitHub base URL: '${input}'. Provide a hostname (github.example.com) or URL (https://github.example.com/api/v3).`,\n }),\n});\n/**\n * The hostname `gh auth token --hostname` expects for a normalized API base\n * URL — the plain host for GitHub Enterprise Server, and the `api.`-less\n * host for GitHub Enterprise Cloud with data residency.\n */\nexport const githubHostname = (baseUrl) => {\n const host = new URL(baseUrl).hostname;\n return host.startsWith(\"api.\") && host.endsWith(\".ghe.com\")\n ? host.slice(\"api.\".length)\n : host;\n};\n/**\n * Resolve the GitHub API base URL from the environment:\n * `GITHUB_BASE_URL` (Terraform convention), then `GITHUB_API_URL` (set by\n * GitHub Actions runners), then `GH_HOST` (gh CLI convention, a bare\n * hostname). Returns `undefined` when unset or when the value points at\n * github.com.\n */\nexport const resolveGitHubBaseUrlFromEnv = Effect.gen(function* () {\n for (const key of [\"GITHUB_BASE_URL\", \"GITHUB_API_URL\", \"GH_HOST\"]) {\n const value = yield* getEnv(key);\n if (value !== undefined && value.trim() !== \"\") {\n return yield* normalizeGitHubBaseUrl(value);\n }\n }\n return undefined;\n});\n//# sourceMappingURL=BaseUrl.js.map","import * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as Match from \"effect/Match\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as Stream from \"effect/Stream\";\nimport * as ChildProcess from \"effect/unstable/process/ChildProcess\";\nimport { ChildProcessSpawner } from \"effect/unstable/process/ChildProcessSpawner\";\nimport { AuthError, AuthProviderLayer, } from \"../Auth/AuthProvider.js\";\nimport { CredentialsStore, displayRedacted } from \"../Auth/Credentials.js\";\nimport { getEnvRedacted, retryOnce } from \"../Auth/Env.js\";\nimport * as Clank from \"../Util/Clank.js\";\nimport { githubHostname, normalizeGitHubBaseUrl, resolveGitHubBaseUrlFromEnv, } from \"./BaseUrl.js\";\nconst options = [\n {\n value: \"gh-cli\",\n label: \"GitHub CLI\",\n hint: \"delegate to `gh auth token` (run `gh auth login` first)\",\n },\n {\n value: \"env\",\n label: \"Environment Variables\",\n hint: \"GITHUB_ACCESS_TOKEN or GITHUB_TOKEN\",\n },\n {\n value: \"stored\",\n label: \"Personal Access Token\",\n hint: \"enter PAT interactively, stored in ~/.alchemy/credentials\",\n },\n];\nexport const GITHUB_AUTH_PROVIDER_NAME = \"GitHub\";\nclass GhCliError extends Error {\n _tag = \"GhCliError\";\n}\n/**\n * Read a token from the environment for the given (already-resolved) base\n * URL. On a GitHub Enterprise host, the gh CLI's enterprise token variables\n * (`GH_ENTERPRISE_TOKEN`, `GITHUB_ENTERPRISE_TOKEN`) are checked before the\n * standard `GITHUB_ACCESS_TOKEN` / `GITHUB_TOKEN`.\n */\nconst readEnvTokenFor = (baseUrl) => Effect.gen(function* () {\n const candidates = baseUrl !== undefined\n ? [\n \"GH_ENTERPRISE_TOKEN\",\n \"GITHUB_ENTERPRISE_TOKEN\",\n \"GITHUB_ACCESS_TOKEN\",\n \"GITHUB_TOKEN\",\n ]\n : [\"GITHUB_ACCESS_TOKEN\", \"GITHUB_TOKEN\"];\n for (const key of candidates) {\n const token = yield* getEnvRedacted(key);\n if (token) {\n return {\n type: \"token\",\n token,\n baseUrl,\n source: { type: \"env\", details: key },\n };\n }\n }\n return yield* new AuthError({\n message: `GitHub env credentials not found. Set ${candidates.join(\", \")}.`,\n });\n});\n/**\n * Read GitHub credentials from the environment. The base URL comes from the\n * stored config when set, otherwise from `GITHUB_BASE_URL`, `GITHUB_API_URL`,\n * or `GH_HOST`.\n */\nexport const readEnvCredentials = (configBaseUrl) => Effect.gen(function* () {\n const baseUrl = configBaseUrl ?? (yield* resolveGitHubBaseUrlFromEnv);\n return yield* readEnvTokenFor(baseUrl);\n});\nexport const makeGitHubAuth = (authOptions) => AuthProviderLayer()(GITHUB_AUTH_PROVIDER_NAME, Effect.gen(function* () {\n const store = yield* CredentialsStore;\n const cp = yield* ChildProcessSpawner;\n // Hard-coded host from `providers({ baseUrl })`, resolved once at layer\n // build. Kept as an object so \"no option\" (undefined) is distinct from\n // \"option normalized to the github.com default\" ({ baseUrl: undefined })\n // — both matter: the latter still pins the host and mutes the prompt.\n const fixed = authOptions?.baseUrl !== undefined\n ? {\n baseUrl: yield* normalizeGitHubBaseUrl(authOptions.baseUrl).pipe(Effect.orDie),\n }\n : undefined;\n // The host every method authenticates against: the hard-coded value\n // wins, then the profile's configured host, then the environment.\n const effectiveBaseUrl = (config) => fixed !== undefined\n ? Effect.succeed(fixed.baseUrl)\n : config.baseUrl !== undefined\n ? Effect.succeed(config.baseUrl)\n : resolveGitHubBaseUrlFromEnv;\n const ghCliToken = (hostname) => Effect.gen(function* () {\n const handle = yield* cp.spawn(ChildProcess.make(\"gh\", [\n \"auth\",\n \"token\",\n ...(hostname !== undefined ? [\"--hostname\", hostname] : []),\n ], { shell: false }));\n const [exitCode, stdout, stderr] = yield* Effect.all([\n handle.exitCode,\n Stream.mkString(Stream.decodeText(handle.stdout)),\n Stream.mkString(Stream.decodeText(handle.stderr)),\n ], { concurrency: 3 });\n if (exitCode !== 0) {\n return yield* Effect.fail(new GhCliError(`gh auth token exited with ${exitCode}: ${stderr.trim() || stdout.trim()}`));\n }\n const token = stdout.trim();\n if (!token) {\n return yield* Effect.fail(new GhCliError(\"gh auth token returned empty output\"));\n }\n return token;\n }).pipe(Effect.scoped, Effect.mapError((e) => e instanceof GhCliError\n ? new AuthError({ message: e.message, cause: e })\n : new AuthError({\n message: \"Could not invoke `gh`. Install GitHub CLI from https://cli.github.com/ and run `gh auth login`.\",\n cause: e,\n })));\n const loginStored = Effect.fn(function* (profileName, baseUrl) {\n const token = yield* Clank.password({\n message: \"GitHub Personal Access Token (needs `repo` scope; `workflow` for Actions)\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n }).pipe(retryOnce);\n yield* store.write(profileName, \"gh-stored\", {\n type: \"pat\",\n token,\n });\n yield* Clank.success(\"GitHub: credentials saved.\");\n return { method: \"stored\", baseUrl };\n });\n // Optional GitHub Enterprise host. Blank means github.com; anything else\n // is normalized into the REST API base URL (GHES gets `/api/v3`\n // appended, data-residency hosts get the `api.` prefix).\n const promptBaseUrl = Clank.text({\n message: \"GitHub host (leave blank for github.com; e.g. github.example.com for GitHub Enterprise)\",\n placeholder: \"github.com\",\n defaultValue: \"\",\n }).pipe(retryOnce, Effect.flatMap((input) => {\n const trimmed = (input ?? \"\").trim();\n return trimmed === \"\"\n ? Effect.succeed(undefined)\n : normalizeGitHubBaseUrl(trimmed);\n }));\n const configureInteractive = (profileName) => Effect.gen(function* () {\n const method = yield* Clank.select({\n message: \"GitHub authentication method\",\n options,\n });\n // The host prompt is skipped when providers({ baseUrl }) pinned it —\n // nothing is stored in the profile config; `read` re-applies the\n // pinned value from code on every resolution.\n const baseUrl = fixed !== undefined ? undefined : yield* promptBaseUrl;\n const verifyHost = fixed !== undefined ? fixed.baseUrl : baseUrl;\n return yield* Match.value(method).pipe(Match.when(\"env\", () => Effect.succeed({ method: \"env\", baseUrl })), Match.when(\"gh-cli\", () => ghCliToken(verifyHost !== undefined\n ? githubHostname(verifyHost)\n : undefined).pipe(Effect.as({ method: \"gh-cli\", baseUrl }), Effect.mapError((e) => new AuthError({\n message: `gh CLI not available: ${e.message}`,\n cause: e,\n })))), Match.when(\"stored\", () => loginStored(profileName, baseUrl)), Match.exhaustive);\n });\n const configureCredentials = (profileName, ctx) => Effect.gen(function* () {\n if (ctx.ci) {\n return { method: \"env\" };\n }\n return yield* configureInteractive(profileName);\n }).pipe(Effect.mapError((e) => new AuthError({\n message: \"failed to configure credentials\",\n cause: e,\n })));\n const resolveCredentials = (profileName, config) => Match.value(config).pipe(Match.when({ method: \"env\" }, (c) => effectiveBaseUrl(c).pipe(Effect.flatMap(readEnvTokenFor))), Match.when({ method: \"stored\" }, Effect.fn(function* (c) {\n const baseUrl = yield* effectiveBaseUrl(c);\n const creds = yield* store.read(profileName, \"gh-stored\");\n if (creds == null) {\n return yield* new AuthError({\n message: \"GitHub stored credentials not found. Run: alchemy login --configure\",\n });\n }\n return {\n type: \"token\",\n token: Redacted.make(creds.token),\n baseUrl,\n source: { type: \"stored\" },\n };\n })), Match.when({ method: \"gh-cli\" }, Effect.fn(function* (c) {\n const baseUrl = yield* effectiveBaseUrl(c);\n const token = yield* ghCliToken(baseUrl !== undefined ? githubHostname(baseUrl) : undefined);\n return {\n type: \"token\",\n token: Redacted.make(token),\n baseUrl,\n source: { type: \"gh-cli\" },\n };\n })), Match.exhaustive);\n const logout = (profileName, config) => Match.value(config).pipe(Match.when({ method: \"env\" }, () => Effect.void), Match.when({ method: \"gh-cli\" }, () => Effect.void), Match.when({ method: \"stored\" }, () => store\n .delete(profileName, \"gh-stored\")\n .pipe(Effect.andThen(Clank.success(\"GitHub: stored credentials removed\")))), Match.exhaustive);\n const login = (profileName, config) => Match.value(config)\n .pipe(Match.when({ method: \"env\" }, () => Effect.void), Match.when({ method: \"gh-cli\" }, (c) => effectiveBaseUrl(c).pipe(Effect.flatMap((baseUrl) => ghCliToken(baseUrl !== undefined ? githubHostname(baseUrl) : undefined)), Effect.tap(() => Clank.success(\"GitHub: gh CLI authentication available.\")), Effect.asVoid)), Match.when({ method: \"stored\" }, (c) => store\n .read(profileName, \"gh-stored\")\n .pipe(Effect.flatMap((creds) => creds == null\n ? loginStored(profileName, c.baseUrl)\n : Effect.void))), Match.exhaustive)\n .pipe(Effect.mapError((e) => new AuthError({ message: \"login failed\", cause: e })));\n const prettyPrint = (profileName, config) => resolveCredentials(profileName, config).pipe(Effect.tap((creds) => {\n const sourceStr = creds.source.details\n ? `${creds.source.type} - ${creds.source.details}`\n : creds.source.type;\n return Effect.all([\n Console.log(` token: ${displayRedacted(creds.token, 6)}`),\n Console.log(` source: ${sourceStr}`),\n ...(creds.baseUrl !== undefined\n ? [Console.log(` baseUrl: ${creds.baseUrl}`)]\n : []),\n ]);\n }));\n return {\n configure: configureCredentials,\n logout,\n login,\n prettyPrint,\n read: resolveCredentials,\n };\n}));\n/**\n * The default GitHub AuthProvider layer — {@link makeGitHubAuth} with no\n * hard-coded host. Use `GitHub.providers({ baseUrl })` (or\n * `makeGitHubAuth({ baseUrl })` directly) to pin a GitHub Enterprise host.\n */\nexport const GitHubAuth = makeGitHubAuth();\n//# sourceMappingURL=AuthProvider.js.map","import { DEFAULT_API_BASE_URL } from \"@distilled.cloud/hetzner\";\nimport * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as Match from \"effect/Match\";\nimport * as Redacted from \"effect/Redacted\";\nimport { AuthError, AuthProviderLayer, } from \"../Auth/AuthProvider.js\";\nimport { CredentialsStore, displayRedacted } from \"../Auth/Credentials.js\";\nimport { getEnv, getEnvRedacted, retryOnce } from \"../Auth/Env.js\";\nimport { AlchemyProfile } from \"../Auth/Profile.js\";\nimport * as Clank from \"../Util/Clank.js\";\nexport const HETZNER_AUTH_PROVIDER_NAME = \"Hetzner\";\nexport const HCLOUD_TOKEN_ENV = \"HCLOUD_TOKEN\";\nexport const HCLOUD_ENDPOINT_ENV = \"HCLOUD_ENDPOINT\";\nconst STORAGE_KEY = \"hetzner-stored\";\nconst options = [\n {\n value: \"env\",\n label: \"Environment Variables\",\n hint: `${HCLOUD_TOKEN_ENV} + optional ${HCLOUD_ENDPOINT_ENV}`,\n },\n {\n value: \"stored\",\n label: \"API Token\",\n hint: \"enter interactively, stored in ~/.alchemy/credentials\",\n },\n];\nconst resolveApiBaseUrl = (explicit) => getEnv(HCLOUD_ENDPOINT_ENV).pipe(Effect.map((fromEnv) => explicit ?? fromEnv ?? DEFAULT_API_BASE_URL));\n/**\n * Layer that registers the Hetzner {@link AuthProvider} into the\n * {@link AuthProviders} registry. Include this in the Hetzner\n * `providers()` layer so `alchemy login` can discover it.\n *\n * Auth is a Hetzner Cloud API token (`HCLOUD_TOKEN`). The token is\n * issued per project in the Cloud Console — there is no account-wide\n * token. An optional `HCLOUD_ENDPOINT` overrides the API root\n * (default `https://api.hetzner.cloud/v1`).\n */\nexport const HetznerAuth = AuthProviderLayer()(HETZNER_AUTH_PROVIDER_NAME, Effect.gen(function* () {\n const profiles = yield* AlchemyProfile;\n const store = yield* CredentialsStore;\n const loginStored = Effect.fn(function* (profileName) {\n const token = yield* Clank.password({\n message: \"Hetzner Cloud API Token\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n }).pipe(retryOnce);\n const envEndpoint = yield* getEnv(HCLOUD_ENDPOINT_ENV);\n const endpointPrompt = yield* Clank.text({\n message: \"Hetzner API endpoint (Enter for default)\",\n placeholder: DEFAULT_API_BASE_URL,\n defaultValue: envEndpoint ?? DEFAULT_API_BASE_URL,\n }).pipe(retryOnce);\n const trimmed = (endpointPrompt ?? \"\").trim();\n const apiBaseUrl = trimmed.length > 0 && trimmed !== DEFAULT_API_BASE_URL\n ? trimmed\n : undefined;\n yield* store.write(profileName, STORAGE_KEY, {\n type: \"token\",\n token,\n apiBaseUrl,\n });\n yield* Clank.success(\"Hetzner: credentials saved.\");\n return { method: \"stored\" };\n });\n const configureInteractive = (profileName) => Clank.select({\n message: \"Hetzner authentication method\",\n options,\n }).pipe(Effect.flatMap((method) => Match.value(method).pipe(Match.when(\"env\", () => Effect.succeed({ method: \"env\" })), Match.when(\"stored\", () => loginStored(profileName)), Match.exhaustive)));\n const configureCredentials = (profileName, ctx) => Effect.gen(function* () {\n if (ctx.ci) {\n return { method: \"env\" };\n }\n return yield* configureInteractive(profileName);\n }).pipe(Effect.mapError((e) => new AuthError({\n message: \"failed to configure credentials\",\n cause: e,\n })));\n const resolveCredentials = (profileName, config) => Match.value(config).pipe(Match.when({ method: \"env\" }, Effect.fn(function* () {\n const token = yield* getEnvRedacted(HCLOUD_TOKEN_ENV);\n if (!token) {\n return yield* new AuthError({\n message: `Hetzner env credentials not found. Set ${HCLOUD_TOKEN_ENV}.`,\n });\n }\n const apiBaseUrl = yield* resolveApiBaseUrl();\n return {\n type: \"token\",\n token,\n apiBaseUrl,\n source: { type: \"env\", details: HCLOUD_TOKEN_ENV },\n };\n })), Match.when({ method: \"stored\" }, () => store.read(profileName, STORAGE_KEY).pipe(Effect.flatMap((creds) => creds == null\n ? Effect.fail(new AuthError({\n message: \"Hetzner stored credentials not found. Run: alchemy login --configure\",\n }))\n : resolveApiBaseUrl(creds.apiBaseUrl).pipe(Effect.map((apiBaseUrl) => ({\n type: \"token\",\n token: Redacted.make(creds.token),\n apiBaseUrl,\n source: { type: \"stored\" },\n })))))), Match.exhaustive);\n const logout = (profileName, config) => Match.value(config).pipe(Match.when({ method: \"env\" }, () => Effect.void), Match.when({ method: \"stored\" }, () => store\n .delete(profileName, STORAGE_KEY)\n .pipe(Effect.andThen(Clank.success(\"Hetzner: stored credentials removed\")))), Match.exhaustive);\n const login = (profileName, config) => Match.value(config)\n .pipe(Match.when({ method: \"env\" }, () => \n // If HCLOUD_TOKEN isn't set, fall through to the interactive picker\n // so the user can switch to `stored` (or be told to set the env var)\n // instead of silently failing later in `read`. The new selection is\n // persisted to the profile so subsequent logins don't re-prompt.\n getEnvRedacted(HCLOUD_TOKEN_ENV).pipe(Effect.flatMap((token) => token\n ? Effect.void\n : Effect.gen(function* () {\n const next = yield* configureInteractive(profileName);\n const existing = yield* profiles.getProfile(profileName);\n yield* profiles.setProfile(profileName, {\n ...existing,\n [HETZNER_AUTH_PROVIDER_NAME]: next,\n });\n })))), Match.when({ method: \"stored\" }, () => store\n .read(profileName, STORAGE_KEY)\n .pipe(Effect.flatMap((creds) => creds == null ? loginStored(profileName) : Effect.void))), Match.exhaustive)\n .pipe(Effect.mapError((e) => new AuthError({ message: \"login failed\", cause: e })));\n const prettyPrint = (profileName, config) => resolveCredentials(profileName, config).pipe(Effect.tap((creds) => {\n const sourceStr = creds.source.details\n ? `${creds.source.type} - ${creds.source.details}`\n : creds.source.type;\n return Effect.all([\n Console.log(` token: ${displayRedacted(creds.token, 6)}`),\n Console.log(` apiBaseUrl: ${creds.apiBaseUrl}`),\n Console.log(` source: ${sourceStr}`),\n ]);\n }));\n return {\n configure: configureCredentials,\n logout,\n login,\n prettyPrint,\n read: resolveCredentials,\n };\n}));\n//# sourceMappingURL=AuthProvider.js.map","import * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as Match from \"effect/Match\";\nimport * as Redacted from \"effect/Redacted\";\nimport { AuthError, AuthProviderLayer, } from \"../Auth/AuthProvider.js\";\nimport { CredentialsStore, displayRedacted } from \"../Auth/Credentials.js\";\nimport { getEnvRedacted, retryOnce } from \"../Auth/Env.js\";\nimport { AlchemyProfile } from \"../Auth/Profile.js\";\nimport * as Clank from \"../Util/Clank.js\";\nexport const NEON_AUTH_PROVIDER_NAME = \"Neon\";\nconst options = [\n {\n value: \"env\",\n label: \"Environment Variable\",\n hint: \"NEON_API_KEY\",\n },\n {\n value: \"stored\",\n label: \"API Key\",\n hint: \"enter interactively, stored in ~/.alchemy/credentials\",\n },\n];\n/**\n * Layer that registers the Neon {@link AuthProvider} into the\n * {@link AuthProviders} registry.\n */\nexport const NeonAuth = AuthProviderLayer()(NEON_AUTH_PROVIDER_NAME, Effect.gen(function* () {\n const profiles = yield* AlchemyProfile;\n const store = yield* CredentialsStore;\n const loginStored = Effect.fn(function* (profileName) {\n const apiKey = yield* Clank.password({\n message: \"Neon API Key\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n }).pipe(retryOnce);\n yield* store.write(profileName, \"neon-stored\", {\n type: \"apiKey\",\n apiKey,\n });\n yield* Clank.success(\"Neon: credentials saved.\");\n return { method: \"stored\" };\n });\n const configureInteractive = (profileName) => Clank.select({\n message: \"Neon authentication method\",\n options,\n }).pipe(Effect.flatMap((method) => Match.value(method).pipe(Match.when(\"env\", () => Effect.succeed({ method: \"env\" })), Match.when(\"stored\", () => loginStored(profileName)), Match.exhaustive)));\n const configureCredentials = (profileName, ctx) => Effect.gen(function* () {\n if (ctx.ci) {\n return { method: \"env\" };\n }\n return yield* configureInteractive(profileName);\n }).pipe(Effect.mapError((e) => new AuthError({\n message: \"failed to configure credentials\",\n cause: e,\n })));\n const resolveCredentials = (profileName, config) => Match.value(config).pipe(Match.when({ method: \"env\" }, Effect.fn(function* () {\n const apiKey = yield* getEnvRedacted(\"NEON_API_KEY\");\n if (!apiKey) {\n return yield* new AuthError({\n message: \"Neon env credentials not found. Set NEON_API_KEY.\",\n });\n }\n return {\n type: \"apiKey\",\n apiKey,\n source: { type: \"env\" },\n };\n })), Match.when({ method: \"stored\" }, () => store.read(profileName, \"neon-stored\").pipe(Effect.flatMap((creds) => creds == null\n ? Effect.fail(new AuthError({\n message: \"Neon stored credentials not found. Run: alchemy login --configure\",\n }))\n : Effect.succeed({\n type: \"apiKey\",\n apiKey: Redacted.make(creds.apiKey),\n source: { type: \"stored\" },\n })))), Match.exhaustive);\n const logout = (profileName, config) => Match.value(config).pipe(Match.when({ method: \"env\" }, () => Effect.void), Match.when({ method: \"stored\" }, () => store\n .delete(profileName, \"neon-stored\")\n .pipe(Effect.andThen(Clank.success(\"Neon: stored credentials removed\")))), Match.exhaustive);\n const login = (profileName, config) => Match.value(config)\n .pipe(Match.when({ method: \"env\" }, () => \n // If NEON_API_KEY isn't set, fall through to the interactive picker\n // so the user can switch to `stored` (or be told to set the env var)\n // instead of silently failing later in `read`. The new selection is\n // persisted to the profile so subsequent logins don't re-prompt.\n getEnvRedacted(\"NEON_API_KEY\").pipe(Effect.flatMap((apiKey) => apiKey\n ? Effect.void\n : Effect.gen(function* () {\n const next = yield* configureInteractive(profileName);\n const existing = yield* profiles.getProfile(profileName);\n yield* profiles.setProfile(profileName, {\n ...existing,\n [NEON_AUTH_PROVIDER_NAME]: next,\n });\n })))), Match.when({ method: \"stored\" }, () => store\n .read(profileName, \"neon-stored\")\n .pipe(Effect.flatMap((creds) => creds == null ? loginStored(profileName) : Effect.void))), Match.exhaustive)\n .pipe(Effect.mapError((e) => new AuthError({ message: \"login failed\", cause: e })));\n const prettyPrint = (profileName, config) => resolveCredentials(profileName, config).pipe(Effect.tap((creds) => {\n const sourceStr = creds.source.details\n ? `${creds.source.type} - ${creds.source.details}`\n : creds.source.type;\n return Effect.all([\n Console.log(` apiKey: ${displayRedacted(creds.apiKey, 9)}`),\n Console.log(` source: ${sourceStr}`),\n ]);\n }));\n return {\n configure: configureCredentials,\n logout,\n login,\n prettyPrint,\n read: resolveCredentials,\n };\n}));\n//# sourceMappingURL=AuthProvider.js.map","import * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport crypto from \"node:crypto\";\nimport http from \"node:http\";\nimport { AUTH_ERROR_URL, AUTH_SUCCESS_URL } from \"../Auth/AuthProvider.js\";\nexport class OAuthError extends Data.TaggedError(\"OAuthError\") {\n}\n/**\n * Registered PlanetScale OAuth application credentials.\n *\n * Unlike Cloudflare, PlanetScale OAuth has **no public-client flow** — the\n * token endpoint requires client authentication for every grant (PKCE is\n * advertised in their discovery doc but does not lift that requirement), so\n * exchanging the authorization code (and refreshing the token) requires the\n * application's `client_secret`. There is no way to keep that secret out of\n * a distributed CLI, so it ships here: the exposure is the same posture as a\n * public `client_id` (a stolen refresh token is usable, exactly like\n * Cloudflare's secret-less refresh), and it can be rotated by cutting a new\n * release. PlanetScale's own CLI ships its OAuth `client_secret` in source\n * the same way:\n * https://github.com/planetscale/cli/blob/main/internal/auth/authenticator.go\n *\n * Registered at https://app.planetscale.com with redirect URI\n * {@link OAUTH_REDIRECT_URI}. Scopes are configured on the application\n * itself, not requested per-authorization. Rotate by registering a new\n * secret and cutting a release.\n */\nexport const OAUTH_CLIENT_ID = \"pscale_app_aa12e3938baebb788aac443f66e422da\";\nexport const OAUTH_CLIENT_SECRET = \"pscale_app_secret_yyZ3Q8oe99GP9_yA5wrA5er6RuN6Lz9dC66Bj1OJzpg\";\nexport const OAUTH_REDIRECT_URI = \"https://alchemy.run/auth/callback\";\nexport const OAUTH_LOCAL_CALLBACK_URI = \"http://localhost:9976/auth/callback\";\nexport const OAUTH_ENDPOINTS = {\n // PlanetScale's own .well-known OAuth discovery doc declares this as\n // the authorization_endpoint — NOT auth.planetscale.com/oauth/authorize\n // (which their public docs cite). The auth.planetscale.com alias does\n // render a consent screen but emits codes whose resulting tokens lack\n // a `sub` claim, so the resource API at api.planetscale.com rejects\n // them as invalid. Use the canonical endpoint.\n authorize: \"https://app.planetscale.com/oauth/authorize\",\n token: \"https://auth.planetscale.com/oauth/token\",\n};\nfunction generateState(length = 32) {\n return Buffer.from(crypto.randomBytes(length)).toString(\"base64url\");\n}\nfunction extractCredentials(json) {\n return {\n type: \"oauth\",\n access: json.access_token,\n refresh: json.refresh_token,\n expires: Date.now() + json.expires_in * 1000,\n scopes: json.scope ? json.scope.split(\" \") : [],\n };\n}\nconst tokenRequest = (params) => Effect.gen(function* () {\n // PlanetScale's docs show the token endpoint with all parameters in\n // the query string (https://planetscale.com/docs/api/reference/oauth).\n // Their .well-known discovery doc advertises client_secret_basic /\n // client_secret_post instead, but both behave identically to the\n // query-string form in practice, so we follow the public docs\n // literally.\n const url = new URL(OAUTH_ENDPOINTS.token);\n for (const [k, v] of Object.entries(params)) {\n url.searchParams.set(k, v);\n }\n const res = yield* Effect.tryPromise({\n try: () => fetch(url.toString(), {\n method: \"POST\",\n headers: { Accept: \"application/json\" },\n }),\n catch: (err) => new OAuthError({\n error: \"network_error\",\n errorDescription: `Token request failed: ${err}`,\n }),\n });\n if (!res.ok) {\n const json = yield* Effect.tryPromise({\n try: () => res.json(),\n catch: () => new OAuthError({\n error: \"parse_error\",\n errorDescription: `Token endpoint returned ${res.status}`,\n }),\n });\n return yield* new OAuthError({\n error: json.error,\n errorDescription: json.error_description,\n });\n }\n const json = yield* Effect.tryPromise({\n try: () => res.json(),\n catch: () => new OAuthError({\n error: \"parse_error\",\n errorDescription: \"Failed to parse token response\",\n }),\n });\n return extractCredentials(json);\n});\n/**\n * Generate a PlanetScale authorization URL.\n *\n * No `scope` parameter is sent: PlanetScale scopes are configured on the\n * OAuth application itself, not requested per-authorization, so the\n * consent screen shows whatever the app is registered with.\n */\nexport function authorize() {\n const state = generateState();\n const url = new URL(OAUTH_ENDPOINTS.authorize);\n url.searchParams.set(\"client_id\", OAUTH_CLIENT_ID);\n url.searchParams.set(\"redirect_uri\", OAUTH_REDIRECT_URI);\n url.searchParams.set(\"response_type\", \"code\");\n url.searchParams.set(\"state\", state);\n return { url: url.toString(), state };\n}\n/**\n * Exchange an authorization code for OAuth credentials.\n */\nexport const exchange = (code) => tokenRequest({\n grant_type: \"authorization_code\",\n code,\n client_id: OAUTH_CLIENT_ID,\n client_secret: OAUTH_CLIENT_SECRET,\n redirect_uri: OAUTH_REDIRECT_URI,\n});\n/**\n * Refresh expired OAuth credentials.\n */\nexport const refresh = (credentials) => tokenRequest({\n grant_type: \"refresh_token\",\n refresh_token: credentials.refresh,\n client_id: OAUTH_CLIENT_ID,\n client_secret: OAUTH_CLIENT_SECRET,\n});\n/**\n * Exchange a code copied from the hosted relay page, or extract the code from\n * either the hosted or loopback callback URL.\n */\nexport const exchangeCallbackInput = (input, authorization) => Effect.gen(function* () {\n const value = input.trim();\n let code = value;\n let state = null;\n try {\n const url = new URL(value);\n code = url.searchParams.get(\"code\") ?? \"\";\n state = url.searchParams.get(\"state\");\n }\n catch {\n const separator = value.lastIndexOf(\"#\");\n if (separator >= 0) {\n code = value.slice(0, separator);\n state = value.slice(separator + 1);\n }\n }\n if (!code) {\n return yield* new OAuthError({\n error: \"invalid_request\",\n errorDescription: \"The authorization code is missing.\",\n });\n }\n if (state !== null && state !== authorization.state) {\n return yield* new OAuthError({\n error: \"invalid_request\",\n errorDescription: \"The authorization state does not match.\",\n });\n }\n return yield* exchange(code);\n});\n/**\n * Start a local HTTP server to listen for the OAuth callback, exchange\n * the authorization code, and return the credentials.\n *\n * Times out after 5 minutes.\n */\nexport const callback = (authorization) => Effect.tryPromise({\n try: (signal) => callbackPromise(authorization, signal),\n catch: (err) => {\n if (err instanceof OAuthError)\n return err;\n return new OAuthError({\n error: \"callback_error\",\n errorDescription: `OAuth callback failed: ${err}`,\n });\n },\n});\nfunction callbackPromise(authorization, signal) {\n const { pathname, port } = new URL(OAUTH_LOCAL_CALLBACK_URI);\n return new Promise((resolve, reject) => {\n const server = http.createServer(async (req, res) => {\n const url = new URL(req.url ?? \"/\", `http://${req.headers.host}`);\n if (url.pathname === \"/auth/ping\") {\n res.writeHead(req.method === \"OPTIONS\" ? 204 : 200, {\n \"Access-Control-Allow-Origin\": new URL(OAUTH_REDIRECT_URI).origin,\n \"Access-Control-Allow-Methods\": \"GET, OPTIONS\",\n \"Access-Control-Allow-Private-Network\": \"true\",\n \"Cache-Control\": \"no-store\",\n });\n res.end();\n return;\n }\n if (url.pathname !== pathname) {\n res.statusCode = 404;\n res.end(\"Not Found\");\n return;\n }\n const error = url.searchParams.get(\"error\");\n const errorDescription = url.searchParams.get(\"error_description\");\n if (error) {\n res.writeHead(302, { Location: AUTH_ERROR_URL });\n res.end();\n cleanup();\n reject(new OAuthError({\n error,\n errorDescription: errorDescription ?? \"An unknown error occurred.\",\n }));\n return;\n }\n const code = url.searchParams.get(\"code\");\n const state = url.searchParams.get(\"state\");\n if (!code || !state) {\n res.writeHead(302, { Location: AUTH_ERROR_URL });\n res.end();\n cleanup();\n reject(new OAuthError({\n error: \"invalid_request\",\n errorDescription: \"Missing code or state\",\n }));\n return;\n }\n if (state !== authorization.state) {\n res.writeHead(302, { Location: AUTH_ERROR_URL });\n res.end();\n cleanup();\n reject(new OAuthError({\n error: \"invalid_request\",\n errorDescription: \"Invalid state\",\n }));\n return;\n }\n try {\n const credentials = await Effect.runPromise(exchange(code));\n res.writeHead(302, { Location: AUTH_SUCCESS_URL });\n res.end();\n cleanup();\n resolve(credentials);\n }\n catch (err) {\n res.writeHead(302, { Location: AUTH_ERROR_URL });\n res.end();\n cleanup();\n reject(err);\n }\n });\n const timeout = setTimeout(() => {\n cleanup();\n reject(new OAuthError({\n error: \"timeout\",\n errorDescription: \"The authorization process timed out.\",\n }));\n }, 5 * 60 * 1000);\n function cleanup() {\n clearTimeout(timeout);\n signal.removeEventListener(\"abort\", cleanup);\n server.close();\n }\n signal.addEventListener(\"abort\", cleanup, { once: true });\n server.on(\"error\", (err) => {\n cleanup();\n reject(new OAuthError({\n error: \"server_error\",\n errorDescription: `Failed to start callback server: ${err.message}`,\n }));\n });\n server.listen(Number(port));\n });\n}\n//# sourceMappingURL=OAuthClient.js.map","import { listOrganizations } from \"@distilled.cloud/planetscale\";\nimport * as PsCredentialsModule from \"@distilled.cloud/planetscale/Credentials\";\nimport * as Console from \"effect/Console\";\nimport * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Match from \"effect/Match\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\";\nimport * as HttpClient from \"effect/unstable/http/HttpClient\";\nimport { AuthError, AuthProviderLayer, } from \"../Auth/AuthProvider.js\";\nimport { CredentialsStore, displayRedacted } from \"../Auth/Credentials.js\";\nimport { getEnvRedactedRequired, getEnvRequired, retryOnce, } from \"../Auth/Env.js\";\nimport * as Clank from \"../Util/Clank.js\";\nimport * as OAuthClient from \"./OAuthClient.js\";\n/**\n * Canonical name registered in {@link AuthProviders}. Use this key to look\n * up the PlanetScale {@link AuthProvider} from inside provider Layers.\n */\nexport const PLANETSCALE_AUTH_PROVIDER_NAME = \"Planetscale\";\n/**\n * Provide PlanetScale `Credentials` + `HttpClient` to an Effect using a\n * just-obtained OAuth access token. Used during configure to call\n * org-discovery endpoints before the user has chosen an org.\n *\n * `organization` is required by the credential type but isn't consulted by\n * `listOrganizations` (it's a user-scoped endpoint), so an empty string is\n * fine here.\n */\nconst withOAuthCredentials = (accessToken, effect) => Effect.provide(effect, Layer.mergeAll(PsCredentialsModule.fromOAuth({\n accessToken,\n organization: \"\",\n}), FetchHttpClient.layer));\n/**\n * List the organizations the OAuth user belongs to and either auto-pick\n * (one org) or prompt the user to choose. Returns the org's URL slug\n * (`name` field, used as `{organization}` in API paths).\n */\nconst selectOrganization = (accessToken) => Effect.gen(function* () {\n const list = yield* listOrganizations;\n const response = yield* list({});\n const orgs = response.data;\n if (orgs.length === 0) {\n return yield* new AuthError({\n message: \"Planetscale: no organizations found for this credential.\",\n });\n }\n if (orgs.length === 1) {\n const org = orgs[0];\n yield* Clank.info(`Planetscale: using organization: ${org.name} (${org.id})`);\n return org.name;\n }\n return yield* Clank.select({\n message: \"Select a Planetscale organization\",\n options: orgs.map((o) => ({\n value: o.name,\n label: o.name,\n hint: o.id,\n })),\n }).pipe(retryOnce);\n}).pipe((e) => withOAuthCredentials(accessToken, e));\nconst options = [\n {\n value: \"env\",\n label: \"Environment Variables\",\n hint: \"PLANETSCALE_API_TOKEN_ID + PLANETSCALE_API_TOKEN + PLANETSCALE_ORGANIZATION\",\n },\n {\n value: \"oauth\",\n label: \"OAuth\",\n hint: \"recommended — browser-based login with automatic token refresh\",\n },\n {\n value: \"stored\",\n label: \"Service Token\",\n hint: \"enter service token interactively, stored in ~/.alchemy/credentials\",\n },\n];\n/**\n * Layer that registers the PlanetScale {@link AuthProvider} into the\n * {@link AuthProviders} registry when built. Include this in the\n * PlanetScale `providers()` layer so `alchemy login` can discover it.\n *\n * Supported methods:\n * - `env`: reads `PLANETSCALE_API_TOKEN_ID`/`PLANETSCALE_API_TOKEN`/`PLANETSCALE_ORGANIZATION`.\n * - `stored`: prompts for a service token interactively and writes it to\n * `~/.alchemy/credentials/<profile>/planetscale-stored.json`.\n * - `oauth`: browser-based login storing access/refresh tokens at\n * `~/.alchemy/credentials/<profile>/planetscale-oauth.json`.\n */\nexport const PlanetscaleAuth = AuthProviderLayer()(PLANETSCALE_AUTH_PROVIDER_NAME, Effect.gen(function* () {\n const store = yield* CredentialsStore;\n const oauthLogin = (profileName) => Effect.gen(function* () {\n const authorization = OAuthClient.authorize();\n yield* Clank.info(\"Planetscale: opening browser for OAuth login...\");\n yield* Clank.info(authorization.url);\n yield* Clank.openUrl(authorization.url).pipe(Effect.catch(() => Clank.warn(\"Planetscale: could not open browser automatically. Please open the URL above manually.\")));\n yield* Clank.info(\"Planetscale: waiting for authorization (up to 5 minutes).\");\n const credentials = yield* Effect.raceFirst(OAuthClient.callback(authorization), Clank.text({\n message: \"Paste the authorization code or callback URL\",\n placeholder: \"The browser will complete this automatically when local\",\n validate: (value) => value.trim().length > 0 ? undefined : \"Paste a code or URL\",\n }).pipe(Effect.flatMap((input) => OAuthClient.exchangeCallbackInput(input, authorization))));\n yield* store.write(profileName, \"planetscale-oauth\", credentials);\n yield* Clank.success(\"Planetscale: OAuth credentials saved.\");\n return credentials;\n });\n const configureOAuth = Effect.fn(function* (profileName) {\n const oauthCreds = yield* oauthLogin(profileName);\n // Use the just-issued access token to list the user's orgs and let\n // them pick (mirrors Cloudflare's selectAccount). Requires the\n // `user:read_organizations` scope. If the call fails for any\n // reason — missing scope, network, off-spec response — fall back\n // to a manual prompt so login still completes.\n const organization = yield* selectOrganization(oauthCreds.access).pipe(Effect.catch((e) => Effect.gen(function* () {\n yield* Clank.warn(`Planetscale: could not auto-list organizations (${String(e)}). Falling back to manual entry.`);\n return yield* Clank.text({\n message: \"Planetscale Organization (URL slug)\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n }).pipe(retryOnce);\n })));\n return { method: \"oauth\", organization };\n });\n const loginStored = Effect.fn(function* (profileName) {\n const tokenId = yield* Clank.text({\n message: \"Planetscale Service Token ID\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n }).pipe(retryOnce);\n const token = yield* Clank.password({\n message: \"Planetscale Service Token\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n }).pipe(retryOnce);\n const organization = yield* Clank.text({\n message: \"Planetscale Organization (URL slug)\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n }).pipe(retryOnce);\n yield* store.write(profileName, \"planetscale-stored\", {\n type: \"apiToken\",\n tokenId,\n token,\n organization,\n });\n yield* Clank.success(\"Planetscale: credentials saved.\");\n return { method: \"stored\" };\n });\n const configureInteractive = (profileName) => Clank.select({\n message: \"Planetscale authentication method\",\n options,\n }).pipe(Effect.flatMap((method) => Match.value(method).pipe(Match.when(\"env\", () => Effect.succeed({ method: \"env\" })), Match.when(\"oauth\", () => configureOAuth(profileName)), Match.when(\"stored\", () => loginStored(profileName)), Match.exhaustive)));\n const configureCredentials = (profileName, ctx) => Effect.gen(function* () {\n if (ctx.ci) {\n return { method: \"env\" };\n }\n return yield* configureInteractive(profileName);\n }).pipe(Effect.mapError((e) => new AuthError({\n message: \"failed to configure credentials\",\n cause: e,\n })));\n const resolveCredentials = (profileName, config) => Match.value(config).pipe(Match.when({ method: \"env\" }, Effect.fn(function* () {\n const tokenId = yield* getEnvRedactedRequired(\"PLANETSCALE_API_TOKEN_ID\");\n const token = yield* getEnvRedactedRequired(\"PLANETSCALE_API_TOKEN\");\n const organization = yield* getEnvRequired(\"PLANETSCALE_ORGANIZATION\");\n return {\n type: \"apiToken\",\n tokenId,\n token,\n organization,\n source: {\n type: \"env\",\n details: \"PLANETSCALE_API_TOKEN_ID/PLANETSCALE_API_TOKEN\",\n },\n };\n })), Match.when({ method: \"stored\" }, () => store\n .read(profileName, \"planetscale-stored\")\n .pipe(Effect.flatMap((creds) => creds == null\n ? Effect.fail(new AuthError({\n message: \"Planetscale stored credentials not found. Run: alchemy login --configure\",\n }))\n : Effect.succeed({\n type: \"apiToken\",\n tokenId: Redacted.make(creds.tokenId),\n token: Redacted.make(creds.token),\n organization: creds.organization,\n source: {\n type: \"stored\",\n details: undefined,\n },\n })))), Match.when({ method: \"oauth\" }, (cfg) => Effect.gen(function* () {\n const creds = yield* store.read(profileName, \"planetscale-oauth\");\n if (creds == null || creds.type !== \"oauth\") {\n return yield* Effect.fail(new AuthError({\n message: \"Planetscale OAuth credentials not found. Run: alchemy login\",\n }));\n }\n // Refresh proactively if the token has expired (or is within\n // 10s of expiring). Persist the refreshed creds so subsequent\n // resolves don't repeat the round-trip.\n const fresh = creds.expires > Date.now() + 10_000\n ? creds\n : yield* OAuthClient.refresh(creds).pipe(Effect.tap((refreshed) => store.write(profileName, \"planetscale-oauth\", refreshed)), Effect.mapError((e) => new AuthError({\n message: \"Planetscale OAuth refresh failed. Run: alchemy login\",\n cause: e,\n })));\n return {\n type: \"oauth\",\n accessToken: Redacted.make(fresh.access),\n expires: fresh.expires,\n organization: cfg.organization,\n source: { type: \"oauth\" },\n };\n })), Match.exhaustive);\n const logout = (profileName, config) => Match.value(config).pipe(Match.when({ method: \"env\" }, () => Effect.void), Match.when({ method: \"stored\" }, () => store\n .delete(profileName, \"planetscale-stored\")\n .pipe(Effect.andThen(Clank.success(\"Planetscale: stored credentials removed\")))), \n // PlanetScale publishes no token-revocation endpoint, so logout just\n // drops the locally stored tokens.\n Match.when({ method: \"oauth\" }, () => store\n .delete(profileName, \"planetscale-oauth\")\n .pipe(Effect.andThen(Clank.success(\"Planetscale: OAuth credentials removed.\")))), Match.exhaustive);\n const login = (profileName, config) => Match.value(config)\n .pipe(Match.when({ method: \"env\" }, () => Effect.void), Match.when({ method: \"stored\" }, () => store\n .read(profileName, \"planetscale-stored\")\n .pipe(Effect.flatMap((creds) => creds == null ? loginStored(profileName) : Effect.void))), Match.when({ method: \"oauth\" }, (c) => Effect.gen(function* () {\n const creds = yield* store.read(profileName, \"planetscale-oauth\");\n if (creds?.type === \"oauth\") {\n yield* Clank.info(\"Planetscale: refreshing OAuth credentials...\");\n yield* OAuthClient.refresh(creds).pipe(Effect.flatMap((refreshed) => store\n .write(profileName, \"planetscale-oauth\", refreshed)\n .pipe(Effect.andThen(Clank.success(\"Planetscale: OAuth credentials refreshed.\")))), Effect.catchTag(\"OAuthError\", () => oauthLogin(profileName).pipe(Effect.asVoid)));\n return;\n }\n yield* oauthLogin(profileName);\n })), Match.exhaustive)\n .pipe(Effect.mapError((e) => new AuthError({ message: \"login failed\", cause: e })));\n const prettyPrint = (profileName, config) => resolveCredentials(profileName, config).pipe(Effect.tap((creds) => {\n const sourceStr = creds.source.details\n ? `${creds.source.type} - ${creds.source.details}`\n : creds.source.type;\n return Match.value(creds).pipe(Match.when({ type: \"apiToken\" }, (c) => Effect.all([\n Console.log(` tokenId: ${displayRedacted(c.tokenId, 3)}`),\n Console.log(` token: ${displayRedacted(c.token, 6)}`),\n Console.log(` organization: ${c.organization}`),\n Console.log(` source: ${sourceStr}`),\n ])), Match.when({ type: \"oauth\" }, (c) => {\n const remainingMs = c.expires - Date.now();\n const expiresAt = new Date(c.expires).toISOString();\n const expiresStr = remainingMs <= 0\n ? `expired (${expiresAt})`\n : `in ${Duration.format(Duration.millis(remainingMs))} (${expiresAt})`;\n return Effect.all([\n Console.log(` accessToken: ${displayRedacted(c.accessToken)}`),\n Console.log(` expires: ${expiresStr}`),\n Console.log(` organization: ${c.organization}`),\n Console.log(` source: ${sourceStr}`),\n ]);\n }), Match.exhaustive);\n }));\n return {\n configure: configureCredentials,\n logout,\n login,\n prettyPrint,\n read: resolveCredentials,\n };\n}));\n//# sourceMappingURL=AuthProvider.js.map","import * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as Match from \"effect/Match\";\nimport * as Redacted from \"effect/Redacted\";\nimport { AuthError, AuthProviderLayer, } from \"../Auth/AuthProvider.js\";\nimport { CredentialsStore, displayRedacted } from \"../Auth/Credentials.js\";\nimport { getEnvRedacted, retryOnce } from \"../Auth/Env.js\";\nimport { AlchemyProfile } from \"../Auth/Profile.js\";\nimport * as Clank from \"../Util/Clank.js\";\nexport const PRISMA_AUTH_PROVIDER_NAME = \"Prisma\";\nexport const PRISMA_SERVICE_TOKEN_ENV = \"PRISMA_SERVICE_TOKEN\";\nexport const PRISMA_API_TOKEN_ENV = \"PRISMA_API_TOKEN\";\nconst options = [\n {\n value: \"env\",\n label: \"Environment Variable\",\n hint: `${PRISMA_SERVICE_TOKEN_ENV} or ${PRISMA_API_TOKEN_ENV}`,\n },\n {\n value: \"stored\",\n label: \"Service Token\",\n hint: \"enter interactively, stored in ~/.alchemy/credentials\",\n },\n];\nconst nonEmptyToken = (token) => token !== undefined && Redacted.value(token).trim().length > 0;\nconst validStoredCredentials = (credentials) => credentials?.type === \"serviceToken\" &&\n credentials.serviceToken.trim().length > 0;\nconst trimToken = (token) => Redacted.make(Redacted.value(token).trim());\nconst readEnvServiceToken = Effect.fnUntraced(function* () {\n const serviceToken = yield* getEnvRedacted(PRISMA_SERVICE_TOKEN_ENV);\n if (nonEmptyToken(serviceToken)) {\n return {\n serviceToken: trimToken(serviceToken),\n envName: PRISMA_SERVICE_TOKEN_ENV,\n };\n }\n const apiToken = yield* getEnvRedacted(PRISMA_API_TOKEN_ENV);\n if (nonEmptyToken(apiToken)) {\n return {\n serviceToken: trimToken(apiToken),\n envName: PRISMA_API_TOKEN_ENV,\n };\n }\n return undefined;\n});\n/**\n * Layer that registers the Prisma Management API auth provider.\n */\nexport const PrismaAuth = AuthProviderLayer()(PRISMA_AUTH_PROVIDER_NAME, Effect.gen(function* () {\n const profiles = yield* AlchemyProfile;\n const store = yield* CredentialsStore;\n const loginStored = Effect.fnUntraced(function* (profileName) {\n const serviceToken = yield* Clank.password({\n message: \"Prisma Service Token\",\n validate: (v) => (v.trim().length === 0 ? \"Required\" : undefined),\n }).pipe(retryOnce);\n yield* store.write(profileName, \"prisma-stored\", {\n type: \"serviceToken\",\n serviceToken: serviceToken.trim(),\n });\n yield* Clank.success(\"Prisma: credentials saved.\");\n return { method: \"stored\" };\n });\n const configureInteractive = (profileName) => Clank.select({\n message: \"Prisma authentication method\",\n options,\n }).pipe(Effect.flatMap((method) => Match.value(method).pipe(Match.when(\"env\", () => Effect.succeed({ method: \"env\" })), Match.when(\"stored\", () => loginStored(profileName)), Match.exhaustive)));\n const configure = (profileName, ctx) => Effect.gen(function* () {\n if (ctx.ci)\n return { method: \"env\" };\n return yield* configureInteractive(profileName);\n }).pipe(Effect.mapError((e) => new AuthError({\n message: \"failed to configure credentials\",\n cause: e,\n })));\n const read = (profileName, config) => Match.value(config).pipe(Match.when({ method: \"env\" }, Effect.fnUntraced(function* () {\n const envToken = yield* readEnvServiceToken();\n if (!envToken) {\n return yield* new AuthError({\n message: `Prisma env credentials not found. Set ${PRISMA_SERVICE_TOKEN_ENV} or ${PRISMA_API_TOKEN_ENV}.`,\n });\n }\n return {\n type: \"serviceToken\",\n serviceToken: envToken.serviceToken,\n source: { type: \"env\", details: envToken.envName },\n };\n })), Match.when({ method: \"stored\" }, () => store\n .read(profileName, \"prisma-stored\")\n .pipe(Effect.flatMap((creds) => !validStoredCredentials(creds)\n ? Effect.fail(new AuthError({\n message: creds == null\n ? \"Prisma stored credentials not found. Run: alchemy login --configure\"\n : \"Prisma stored credentials are invalid. Run: alchemy login --configure\",\n }))\n : Effect.succeed({\n type: \"serviceToken\",\n serviceToken: Redacted.make(creds.serviceToken.trim()),\n source: { type: \"stored\" },\n })))), Match.exhaustive);\n const login = (profileName, config) => Match.value(config)\n .pipe(Match.when({ method: \"env\" }, () => readEnvServiceToken().pipe(Effect.flatMap((envToken) => envToken\n ? Effect.void\n : Effect.gen(function* () {\n const next = yield* configureInteractive(profileName);\n const existing = yield* profiles.getProfile(profileName);\n yield* profiles.setProfile(profileName, {\n ...existing,\n [PRISMA_AUTH_PROVIDER_NAME]: next,\n });\n })))), Match.when({ method: \"stored\" }, () => store\n .read(profileName, \"prisma-stored\")\n .pipe(Effect.flatMap((creds) => validStoredCredentials(creds)\n ? Effect.void\n : loginStored(profileName)))), Match.exhaustive)\n .pipe(Effect.mapError((e) => new AuthError({ message: \"login failed\", cause: e })));\n const logout = (profileName, config) => Match.value(config).pipe(Match.when({ method: \"env\" }, () => Effect.void), Match.when({ method: \"stored\" }, () => store\n .delete(profileName, \"prisma-stored\")\n .pipe(Effect.andThen(Clank.success(\"Prisma: stored credentials removed\")))), Match.exhaustive);\n const prettyPrint = (profileName, config) => read(profileName, config).pipe(Effect.tap((creds) => {\n const source = creds.source.details\n ? `${creds.source.type} - ${creds.source.details}`\n : creds.source.type;\n return Effect.all([\n Console.log(` serviceToken: ${displayRedacted(creds.serviceToken, 9)}`),\n Console.log(` source: ${source}`),\n ]);\n }), Effect.catch((e) => Console.error(` Failed to retrieve credentials: ${e}`)));\n return { configure, login, logout, prettyPrint, read };\n}));\n//# sourceMappingURL=AuthProvider.js.map","var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n};\nimport * as Cause from \"effect/Cause\";\nimport * as Config from \"effect/Config\";\nimport * as ConfigProvider from \"effect/ConfigProvider\";\nimport * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Logger from \"effect/Logger\";\nimport * as Option from \"effect/Option\";\nimport * as Path from \"effect/Path\";\nimport * as S from \"effect/Schema\";\nimport * as Argument from \"effect/unstable/cli/Argument\";\nimport * as CliError from \"effect/unstable/cli/CliError\";\nimport * as Flag from \"effect/unstable/cli/Flag\";\nimport { pathToFileURL } from \"node:url\";\nimport { AuthError, AuthProviders, } from \"../../Auth/AuthProvider.js\";\nimport { ALCHEMY_PROFILE, withProfileOverride, } from \"../../Auth/Profile.js\";\nimport { AwsAuth } from \"../../AWS/AuthProvider.js\";\nimport { AxiomAuth } from \"../../Axiom/AuthProvider.js\";\nimport { CloudflareAuth } from \"../../Cloudflare/Auth/AuthProvider.js\";\nimport { GitHubAuth } from \"../../GitHub/AuthProvider.js\";\nimport { HetznerAuth } from \"../../Hetzner/AuthProvider.js\";\nimport { NeonAuth } from \"../../Neon/AuthProvider.js\";\nimport { PlanetscaleAuth } from \"../../Planetscale/AuthProvider.js\";\nimport { PrismaAuth } from \"../../Prisma/AuthProvider.js\";\nimport * as Stack from \"../../Stack.js\";\nimport { Stage } from \"../../Stage.js\";\nimport { recordCli } from \"../../Telemetry/Metrics.js\";\nimport { PromptCancelled } from \"../../Util/Clank.js\";\nimport { loadConfigProvider } from \"../../Util/ConfigProvider.js\";\nimport { fileLogger } from \"../../Util/FileLogger.js\";\nexport const USER = Config.string(\"USER\").pipe(Config.orElse(() => Config.string(\"USERNAME\")), Config.withDefault(\"unknown\"));\nexport const STAGE = Config.string(\"STAGE\").pipe(Config.option, (a) => a, Effect.map(Option.getOrUndefined));\n/**\n * `true` if `e` is a {@link PromptCancelled}, or an {@link AuthError} whose\n * `cause` chain bottoms out in one. Schema-tagged errors don't always\n * survive `instanceof` across module boundaries, so we also accept any\n * object whose `_tag` matches.\n */\nconst isPromptCancellation = (e) => {\n for (let cur = e, i = 0; cur != null && i < 16; i++) {\n if (cur instanceof PromptCancelled)\n return true;\n if (typeof cur === \"object\" &&\n cur._tag === \"PromptCancelled\") {\n return true;\n }\n if (cur instanceof AuthError ||\n (typeof cur === \"object\" &&\n cur._tag === \"AuthError\")) {\n cur = cur.cause;\n continue;\n }\n return false;\n }\n return false;\n};\n/**\n * Catches user cancellations (Ctrl+C inside a prompt, surfaced as\n * {@link PromptCancelled} or wrapped in an {@link AuthError}) and exits\n * the CLI cleanly with a friendly message instead of dumping a stack\n * trace.\n */\nexport const handleCancellation = (self) => self.pipe(Effect.catchCause((cause) => {\n const cancelled = cause.reasons.some((r) => {\n if (Cause.isFailReason(r))\n return isPromptCancellation(r.error);\n if (Cause.isDieReason(r))\n return isPromptCancellation(r.defect);\n return false;\n });\n return cancelled\n ? Console.log(\"\\nCancelled.\")\n : Effect.failCause(cause);\n}), \n// A bare fiber interrupt (Ctrl+C while not inside a prompt) shouldn't\n// dump a stack trace either.\nEffect.onInterrupt(() => Console.log(\"\\nInterrupted.\")));\nexport const stage = Flag.string(\"stage\").pipe(Flag.withSchema(S.String.check(S.isPattern(/^[a-z0-9]+([-_a-z0-9]+)*$/gi))), Flag.withDescription(\"Stage to deploy to, defaults to dev_${USER}\"), Flag.optional, Flag.map(Option.getOrUndefined), Flag.mapEffect(Effect.fn(function* (stage) {\n if (stage) {\n return stage;\n }\n return yield* STAGE.pipe(Effect.catch(() => Effect.fail(new CliError.MissingOption({\n option: \"stage\",\n }))), Effect.flatMap((s) => s === undefined\n ? USER.pipe(Effect.map((user) => `dev_${user}`), Effect.catch(() => Effect.succeed(\"unknown\")))\n : Effect.succeed(s)));\n})));\nexport const envFile = Flag.file(\"env-file\").pipe(Flag.optional, Flag.withDescription(\"File to load environment variables from, defaults to .env\"));\nexport const dryRun = Flag.boolean(\"dry-run\").pipe(Flag.withDescription(\"Dry run the deployment, do not actually deploy\"), Flag.withDefault(false));\nexport const yes = Flag.boolean(\"yes\").pipe(Flag.withDescription(\"Yes to all prompts\"), Flag.withDefault(false));\nexport const force = Flag.boolean(\"force\").pipe(Flag.withDescription(\"Force updates for resources that would otherwise no-op\"), Flag.withDefault(false));\nexport const script = Argument.file(\"main\", {\n mustExist: true,\n}).pipe(Argument.withDescription(\"Main file to deploy, defaults to alchemy.run.ts\"), Argument.withDefault(\"alchemy.run.ts\"));\nexport const profile = Flag.string(\"profile\").pipe(Flag.withDescription(\"Auth profile to use (~/.alchemy/profiles.json). Defaults to $ALCHEMY_PROFILE or 'default'.\"), Flag.optional, Flag.mapEffect(Effect.fn(function* (profile) {\n // --profile wins; otherwise fall back to $ALCHEMY_PROFILE (which\n // itself defaults to \"default\"). Without this, the flag's default\n // would shadow the env var via withProfileOverride.\n if (Option.isSome(profile)) {\n return profile.value;\n }\n return yield* ALCHEMY_PROFILE.pipe(Effect.catch(() => Effect.succeed(\"default\")));\n})));\nexport const resourceFilter = Flag.string(\"filter\").pipe(Flag.withDescription(\"Comma-separated logical resource IDs (e.g. Api,Sandbox). Only those resources are included.\"), Flag.optional, Flag.map(Option.getOrUndefined));\nexport const TAIL_COLORS = [\n \"\\x1b[36m\", // cyan\n \"\\x1b[35m\", // magenta\n \"\\x1b[33m\", // yellow\n \"\\x1b[32m\", // green\n \"\\x1b[34m\", // blue\n \"\\x1b[91m\", // bright red\n \"\\x1b[96m\", // bright cyan\n \"\\x1b[95m\", // bright magenta\n \"\\x1b[93m\", // bright yellow\n \"\\x1b[92m\", // bright green\n];\nexport const TAIL_RESET = \"\\x1b[0m\";\nexport const formatLocalTimestamp = (date) => {\n const y = date.getFullYear();\n const mo = String(date.getMonth() + 1).padStart(2, \"0\");\n const d = String(date.getDate()).padStart(2, \"0\");\n const h = String(date.getHours()).padStart(2, \"0\");\n const mi = String(date.getMinutes()).padStart(2, \"0\");\n const s = String(date.getSeconds()).padStart(2, \"0\");\n const ms = String(date.getMilliseconds()).padStart(3, \"0\");\n const tz = new Intl.DateTimeFormat(\"en-US\", { timeZoneName: \"short\" })\n .formatToParts(date)\n .find((p) => p.type === \"timeZoneName\")?.value ?? \"\";\n return `${y}-${mo}-${d} ${h}:${mi}:${s}.${ms} ${tz}`;\n};\nexport const parseResourceFilter = (filter) => {\n if (filter === undefined)\n return undefined;\n const ids = filter\n .split(\",\")\n .map((s) => s.trim())\n .filter((s) => s.length > 0);\n if (ids.length === 0)\n return undefined;\n return new Set(ids);\n};\nexport const parseSince = (value) => {\n const match = value.match(/^(\\d+)([smhd])$/);\n if (match) {\n const num = parseInt(match[1], 10);\n const unit = match[2];\n const ms = unit === \"s\"\n ? num * 1000\n : unit === \"m\"\n ? num * 60_000\n : unit === \"h\"\n ? num * 3_600_000\n : num * 86_400_000;\n return new Date(Date.now() - ms);\n }\n const parsed = new Date(value);\n if (isNaN(parsed.getTime())) {\n throw new Error(`Invalid --since value: '${value}'. Use a duration (e.g. '1h', '30m') or ISO date.`);\n }\n return parsed;\n};\n/**\n * Wraps a CLI command handler with a top-level OpenTelemetry span\n * (`cli.<command>`) and bumps the `alchemy.cli.invocations` counter.\n *\n * `attrs` runs against the parsed command args and contributes\n * additional attributes to the span (e.g. stage, profile, dry-run flag).\n *\n * Usage:\n * ```ts\n * Command.make(\n * \"deploy\",\n * { ...flags },\n * instrumentCommand(\"deploy\", (a) => ({\n * \"alchemy.stage\": a.stage,\n * \"alchemy.profile\": a.profile,\n * }))(execStack),\n * );\n * ```\n */\nexport const instrumentCommand = (command, attrs) => (handler) => (args) => handler(args).pipe(Effect.withSpan(`cli.${command}`, {\n attributes: attrs ? attrs(args) : {},\n}), recordCli(command));\n/**\n * Render a profile's stored credential entries the same way across\n * `alchemy login` and `alchemy profile show`: one `── Provider ──`\n * header per entry, then either the provider's own `prettyPrint` block\n * (preferred) or a JSON-style fallback when the provider isn't\n * registered in the supplied {@link AuthProviders} registry.\n */\nexport const printProfile = Effect.fn(function* (profile, stored, registry) {\n yield* Console.log(`Profile: ${profile}`);\n const names = Object.keys(stored).sort();\n if (names.length === 0) {\n yield* Console.log(\"(no providers configured)\");\n return;\n }\n for (const name of names) {\n const cfg = stored[name];\n yield* Console.log(\"\");\n yield* Console.log(`── ${name} ──`);\n const provider = registry[name];\n if (provider == null) {\n yield* Console.log(` method: ${cfg.method}`);\n const { method: _method, ...rest } = cfg;\n for (const [k, v] of Object.entries(rest)) {\n yield* Console.log(` ${k}: ${typeof v === \"string\" ? v : JSON.stringify(v)}`);\n }\n continue;\n }\n // A provider's `prettyPrint` catches its own credential-resolution\n // failures, but some resolve paths `Effect.orDie` (e.g. AWS SSO with an\n // expired token), which escapes as a defect. Contain it here — via\n // `Console.log` so the message stays on stdout under this provider's\n // header instead of interleaving on stderr — so one broken provider\n // can't abort rendering the rest of the profile.\n yield* provider.prettyPrint(profile, cfg).pipe(Effect.catchCause((cause) => {\n const error = Cause.squash(cause);\n const message = error instanceof Error ? error.message : String(error);\n return Console.log(` Failed to retrieve credentials: ${message}`);\n }));\n }\n});\nexport const importStack = Effect.fn(function* (main) {\n const path = yield* Path.Path;\n // Build a `file://` URL from the absolute path. `import.meta.resolve` expects a\n // module specifier / URL, not a raw filesystem path: on Windows an absolute\n // path like `D:\\stack.ts` is not a valid specifier and fails to resolve, so the\n // CLI cannot load the user's stack. `pathToFileURL` produces a valid URL on\n // every platform.\n const url = pathToFileURL(path.resolve(main)).href;\n const module = yield* Effect.promise(() => import(__rewriteRelativeImportExtension(url)));\n const stackEffect = module.default;\n if (!Effect.isEffect(stackEffect)) {\n return yield* Effect.die(new Error(`Main file '${main}' must export a default stack definition (export default Alchemy.Stack({...}))`));\n }\n return stackEffect;\n});\n/**\n * Placeholder {@link Stack.Stack} value used while building a stack's\n * `providers()` layer out of band. No real resources exist yet — we only\n * want the layer's provider/auth registrations and cloud-environment\n * services, so `resources`/`bindings`/`actions` are empty and the stage is a\n * sentinel.\n */\nconst placeholderStack = (name) => ({\n actions: {},\n bindings: {},\n name,\n resources: {},\n stage: \"placeholder\",\n});\n/**\n * Import a stack entrypoint and build its `providers()` (+ `state()`) layer\n * out of band against placeholder {@link Stack.Stack}/{@link Stage} services,\n * so its `AuthProviderLayer` registrations land in an {@link AuthProviders}\n * registry and the built context holds every resource provider plus the\n * cloud-environment services their operations need.\n *\n * Shared by `alchemy login`, `alchemy profile show`, and `alchemy unsafe\n * nuke`. The caller decides what to do with the result — use `authProviders`\n * (login / profile show) or `context` (nuke) — and whether a missing/invalid\n * entrypoint is fatal (login / nuke let it propagate) or best-effort\n * (profile show wraps the call in `Effect.catchCause`).\n */\nexport const buildStackProviders = Effect.fn(\"buildStackProviders\")(function* (options) {\n const authProviders = options.registry ?? {};\n const stackEffect = yield* importStack(options.main);\n const configProvider = withProfileOverride(yield* loadConfigProvider(options.envFile), options.profile);\n const context = yield* Layer.build((stackEffect.providers ?? Layer.empty).pipe(Layer.provideMerge(stackEffect.state ?? Layer.empty), Layer.provideMerge(Layer.mergeAll(Layer.succeed(AuthProviders, authProviders), ConfigProvider.layer(configProvider), options.logger ??\n Logger.layer([fileLogger(\"out\")], { mergeWithExisting: true }), Layer.succeed(Stage, \"placeholder\"), Layer.succeed(Stack.Stack, placeholderStack(stackEffect.stackName)), options.extra ?? Layer.empty))));\n return { authProviders, context, stackEffect };\n});\n/**\n * The auth providers Alchemy ships with. Used as the baseline registry so\n * `alchemy login` works from any folder (no `alchemy.run.ts` required) and\n * `alchemy profile show` can pretty-print any provider a profile mentions,\n * even one the current stack doesn't wire up.\n */\nexport const builtinAuth = Layer.mergeAll(AwsAuth, AxiomAuth, CloudflareAuth, GitHubAuth, HetznerAuth, NeonAuth, PlanetscaleAuth, PrismaAuth);\n/**\n * Build {@link builtinAuth} against `registry` so every built-in auth\n * provider registers itself, without importing any stack entrypoint.\n */\nexport const buildBuiltinAuthProviders = Effect.fn(\"buildBuiltinAuthProviders\")(function* (options) {\n const authProviders = options.registry ?? {};\n yield* Layer.build(Layer.provide(builtinAuth, Layer.mergeAll(Layer.succeed(AuthProviders, authProviders), ConfigProvider.layer(withProfileOverride(yield* loadConfigProvider(options.envFile), options.profile)), Logger.layer([fileLogger(\"out\")], { mergeWithExisting: true }))));\n return authProviders;\n});\n//# sourceMappingURL=_shared.js.map","import * as Cause from \"effect/Cause\";\nimport * as ConfigProvider from \"effect/ConfigProvider\";\nimport * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Logger from \"effect/Logger\";\nimport * as Option from \"effect/Option\";\nimport * as Schema from \"effect/Schema\";\nimport * as Command from \"effect/unstable/cli/Command\";\nimport * as Flag from \"effect/unstable/cli/Flag\";\nimport * as GlobalFlag from \"effect/unstable/cli/GlobalFlag\";\nimport { AdoptPolicy } from \"../../AdoptPolicy.js\";\nimport { AlchemyContext } from \"../../AlchemyContext.js\";\nimport { apply } from \"../../Apply.js\";\nimport { ArtifactStore, createArtifactStore } from \"../../Artifacts.js\";\nimport { AuthProviders } from \"../../Auth/AuthProvider.js\";\nimport { withProfileOverride } from \"../../Auth/Profile.js\";\nimport * as CLI from \"../../Cli/Cli.js\";\nimport * as Plan from \"../../Plan.js\";\nimport { Stage } from \"../../Stage.js\";\nimport { isTelemetryDisabled } from \"../../Telemetry/Attributes.js\";\nimport { loadConfigProvider } from \"../../Util/ConfigProvider.js\";\nimport { fileLogger } from \"../../Util/FileLogger.js\";\nimport { dryRun as dryRunFlag, envFile, force, importStack, instrumentCommand, profile, script, stage, yes, } from \"./_shared.js\";\nexport const ExecStackOptions = Schema.Struct({\n main: Schema.String,\n stage: Schema.String,\n envFile: Schema.OptionFromOptional(Schema.String),\n profile: Schema.optional(Schema.String),\n dryRun: Schema.optional(Schema.Boolean),\n force: Schema.optional(Schema.Boolean),\n yes: Schema.optional(Schema.Boolean),\n destroy: Schema.optional(Schema.Boolean),\n dev: Schema.optional(Schema.Boolean),\n adopt: Schema.optional(Schema.Boolean),\n});\nconst stackSpanAttrs = (args) => ({\n \"alchemy.stage\": args.stage,\n \"alchemy.profile\": args.profile,\n \"alchemy.main\": args.main,\n \"alchemy.dry_run\": !!args.dryRun,\n \"alchemy.force\": !!args.force,\n \"alchemy.destroy\": !!args.destroy,\n \"alchemy.dev\": !!args.dev,\n \"alchemy.adopt\": !!args.adopt,\n});\nconst adopt = Flag.boolean(\"adopt\").pipe(Flag.withDescription(\"Adopt pre-existing cloud resources that conflict with this stack instead of failing. \" +\n \"Useful for re-importing infrastructure into a fresh state store.\"), Flag.withDefault(false));\nconst runStack = Effect.fn(function* ({ main, stage, envFile, profile, dryRun = false, force = false, yes = false, destroy = false, dev = false, adopt = false, }) {\n const stackEffect = yield* importStack(main);\n // `--log-level <x>` has to actually put log records on the user's\n // terminal. With telemetry on (the default) `TelemetryLive` deliberately\n // drops the console logger, so every record lands in `.alchemy/log/out`\n // and nothing reaches stderr — which is how a stalled deploy produced ten\n // minutes of `--log-level debug` and zero bytes of output (#1231). Re-add\n // a console sink for that run only. With telemetry off the default\n // console logger is still in the set, and adding a second would\n // double-print every line.\n const askedForLogs = Option.isSome(Option.flatten(yield* Effect.serviceOption(GlobalFlag.LogLevel)));\n const consoleSink = askedForLogs && !(yield* isTelemetryDisabled)\n ? [Logger.consolePretty()]\n : [];\n const services = Layer.mergeAll(Layer.effect(AlchemyContext, AlchemyContext.pipe(Effect.map((ctx) => ({\n ...ctx,\n dev,\n adopt,\n // `--yes` also auto-accepts (and performs) an out-of-date state\n // store upgrade, instead of prompting.\n updateStateStore: yes,\n })))), \n // `--adopt` opts the entire deploy in to adoption-on-conflict.\n // Resource providers that wire `AdoptPolicy` (Worker domains,\n // Cloudflare.SecretsStore, etc.) will reconcile against\n // pre-existing cloud resources instead of failing on duplicates.\n // Default is `false` so an unintentional collision still surfaces\n // loudly.\n Layer.succeed(AdoptPolicy, adopt), Layer.succeed(ArtifactStore, createArtifactStore()), Layer.succeed(AuthProviders, yield* Effect.serviceOption(AuthProviders).pipe(Effect.map(Option.getOrElse(() => ({}))))), ConfigProvider.layer(withProfileOverride(yield* loadConfigProvider(envFile), profile)), Logger.layer([fileLogger(\"out\"), ...consoleSink], {\n mergeWithExisting: true,\n }), Layer.succeed(Stage, stage));\n yield* Effect.gen(function* () {\n const cli = yield* CLI.Cli;\n const stack = yield* stackEffect;\n yield* Effect.gen(function* () {\n const updatePlan = destroy\n ? yield* Plan.destroy(stack)\n : yield* Plan.make(stack, { force });\n if (dryRun) {\n yield* cli.displayPlan(updatePlan);\n }\n else {\n const hasChanges = Object.keys(updatePlan.deletions).length > 0 ||\n Object.values(updatePlan.resources).some((node) => node.action !== \"noop\" ||\n node.bindings.some((b) => b.action !== \"noop\"));\n if (!yes && hasChanges) {\n const approved = yield* cli.approvePlan(updatePlan);\n if (!approved) {\n return;\n }\n }\n // Smoke-test kill switch: `ALCHEMY_DEV_ONCE=1 alchemy dev` exits after\n // the first apply instead of keeping the dev session alive — apply\n // failures propagate (non-zero exit) instead of being swallowed, so\n // scripts and CI can assert \"dev deploys cleanly\" without a timeout.\n const devOnce = dev &&\n (process.env.ALCHEMY_DEV_ONCE === \"1\" ||\n process.env.ALCHEMY_DEV_ONCE === \"true\");\n // In dev, a failed apply must not drain the keep-alive below:\n // `alchemy dev` runs under `bun --watch`, which cancels watch mode\n // entirely on a clean exit (oven-sh/bun#10983), so completing here\n // would tear down every healthy local resource along with the failed\n // one. Swallow apply failures (logging the full cause, since the TUI\n // renderer only shows the failure status) so the keep-alive engages\n // and the rest of the stack keeps serving, but re-propagate a pure\n // interruption (Ctrl-C / fiber kill) so dev still shuts down cleanly.\n const applyPlan = dev && !devOnce\n ? apply(updatePlan).pipe(Effect.catchCause((cause) => Cause.hasInterruptsOnly(cause)\n ? Effect.failCause(cause)\n : Console.error(`alchemy dev: apply failed; keeping dev alive so healthy resources keep serving.\\n${Cause.pretty(cause)}`).pipe(Effect.as(undefined))))\n : apply(updatePlan);\n const outputs = yield* applyPlan;\n if (outputs !== undefined) {\n yield* Console.log(outputs);\n }\n if (dev) {\n if (devOnce) {\n return;\n }\n return yield* Effect.never;\n }\n }\n }).pipe(Effect.provide(stack.services));\n }).pipe(Effect.provide(services));\n});\n// In dev, failures OUTSIDE the apply guard above must not exit the process\n// either: the user saves mid-edit states where importing the stack module\n// itself throws (missing export, module-evaluation crash), or planning fails\n// against the half-edited program. Those failures escape `runStack` before\n// the apply-level guard exists, and exiting here kills the `--watch` session\n// (oven-sh/bun#10983), so dev would stop reloading on subsequent saves. Log\n// the cause and park forever; the watcher restarts the run on the next file\n// change. Pure interruption (Ctrl-C / fiber kill) still propagates so dev\n// shuts down cleanly.\nexport const devKeepAlive = (effect) => effect.pipe(Effect.catchCause((cause) => Cause.hasInterruptsOnly(cause)\n ? Effect.failCause(cause)\n : Console.error(`alchemy dev: run failed; waiting for the next file change to retry.\\n${Cause.pretty(cause)}`).pipe(Effect.andThen(Effect.never))));\nexport const execStack = (options) => options.dev ? devKeepAlive(runStack(options)) : runStack(options);\nexport const deployCommand = Command.make(\"deploy\", {\n dryRun: dryRunFlag,\n force,\n main: script,\n envFile,\n stage,\n yes,\n profile,\n adopt,\n}, instrumentCommand(\"deploy\", stackSpanAttrs)(execStack));\nexport const destroyCommand = Command.make(\"destroy\", {\n dryRun: dryRunFlag,\n main: script,\n envFile,\n stage,\n yes,\n profile,\n}, instrumentCommand(\"destroy\", stackSpanAttrs)((args) => execStack({\n ...args,\n destroy: true,\n})));\nexport const planCommand = Command.make(\"plan\", {\n main: script,\n envFile,\n stage,\n profile,\n}, instrumentCommand(\"plan\", stackSpanAttrs)((args) => execStack({\n ...args,\n // plan is the same as deploy with dryRun always set to true\n dryRun: true,\n})));\n//# sourceMappingURL=deploy.js.map","/**\n * Pure formatting shared by the plan/deploy renderers (Ink TUI +\n * non-interactive LoggingCli) for the local-vs-live provider-mode\n * indicator on a resource row.\n *\n * The rule: in a dev run every mode-stamped row shows its mode — the\n * whole point of `alchemy dev` is knowing what is emulated and what is\n * real, so `(local)` and `(remote)` are both explicit. A live deploy\n * only tags the exceptions (`local` leftovers from dev being\n * deleted/replaced) — tagging every row `remote` in a normal deploy\n * would be noise.\n *\n * - `alchemy dev` (default `\"local\"`): local rows are tagged `local`,\n * live rows are tagged `remote` — matching the `Alchemy.remote()`\n * vocabulary users see. The persisted enum stays `\"live\"`; only the\n * display says `remote`.\n * - `alchemy deploy` (default `\"live\"`): rows resolved to the local\n * provider are tagged `local`; live rows are untagged.\n * - Mode-agnostic providers have no resolved mode (`undefined`) — nothing\n * is shown.\n * - Mode-switch replacements ALWAYS annotate the transition\n * (e.g. `local → live`), regardless of the run default.\n */\n/** The display label for a mode-stamped row (`\"live\"` renders as `remote`). */\nexport const modeLabel = (mode) => mode === \"live\" ? \"remote\" : \"local\";\n/**\n * The mode note for a resource row, or `undefined` when nothing should be\n * shown (mode-agnostic rows, and live rows in a live-default run).\n *\n * @param mode the mode the node's provider was resolved for (`undefined`\n * for mode-agnostic providers — never annotated)\n * @param priorMode for replacements, the mode the old generation was\n * created with; when it differs from `mode` the transition is shown\n * @param defaultMode the run-level default (`alchemy dev` → `\"local\"`,\n * otherwise `\"live\"`); `undefined` is treated as `\"live\"`\n */\nexport const formatModeNote = (options) => {\n const { mode, priorMode } = options;\n if (mode === undefined)\n return undefined;\n // A genuine mode switch is always surfaced as the raw transition.\n if (priorMode !== undefined && priorMode !== mode) {\n return `${priorMode} → ${mode}`;\n }\n const defaultMode = options.defaultMode ?? \"live\";\n // Live-default runs stay quiet for live rows; dev runs tag everything.\n if (defaultMode === \"live\" && mode === \"live\")\n return undefined;\n return modeLabel(mode);\n};\n//# sourceMappingURL=ModeTag.js.map","import * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport { Cli } from \"./Cli.js\";\nimport { formatModeNote } from \"./ModeTag.js\";\nconst ESC = \"\\x1b[\";\nconst RESET = `${ESC}0m`;\nconst useColor = process.stdout.hasColors?.() ?? !!process.stdout.isTTY;\nconst c = (code, s) => useColor ? `${ESC}${code}m${s}${RESET}` : s;\nconst dim = (s) => c(\"2\", s);\nconst bold = (s) => c(\"1\", s);\nconst red = (s) => c(\"31\", s);\nconst green = (s) => c(\"32\", s);\nconst yellow = (s) => c(\"33\", s);\nconst blue = (s) => c(\"34\", s);\nconst magenta = (s) => c(\"35\", s);\nconst cyan = (s) => c(\"36\", s);\nconst actionColor = {\n create: green,\n update: yellow,\n replace: magenta,\n delete: red,\n noop: dim,\n};\nconst statusColor = (status) => {\n switch (status) {\n case \"created\":\n case \"updated\":\n case \"replaced\":\n return green;\n case \"deleted\":\n return dim;\n case \"retained\":\n return dim;\n case \"fail\":\n return red;\n case \"attaching\":\n case \"post-attach\":\n return cyan;\n default:\n return yellow;\n }\n};\nconst tag = (id) => bold(`[${id}]`);\nconst isTerminal = (status) => status === \"created\" ||\n status === \"updated\" ||\n status === \"deleted\" ||\n status === \"retained\" ||\n status === \"replaced\" ||\n status === \"fail\";\n/**\n * Dim `(local)` / `(remote)` / `(local → live)` suffix for a resource row,\n * or `\"\"` when the row's mode matches the run default (the quiet common\n * case). See {@link formatModeNote} for the rule.\n */\nconst modeSuffix = (options) => {\n const note = formatModeNote(options);\n return note ? ` ${dim(`(${note})`)}` : \"\";\n};\n/** Exported for unit tests — pure plan-preview rendering. */\nexport const formatPlanLines = (plan) => {\n const items = [\n ...Object.values(plan.resources),\n ...Object.values(plan.deletions),\n ];\n if (items.length === 0)\n return [bold(\"Plan:\") + \" no changes\"];\n const counts = items.reduce((acc, item) => ((acc[item.action] = (acc[item.action] ?? 0) + 1), acc), {});\n const summary = [\"create\", \"update\", \"replace\", \"delete\", \"noop\"]\n .filter((a) => counts[a])\n .map((a) => actionColor[a](`${counts[a]} to ${a}`))\n .join(dim(\", \"));\n const sorted = [...items].sort((a, b) => a.resource.LogicalId.localeCompare(b.resource.LogicalId));\n const lines = [`${bold(\"Plan:\")} ${summary}`];\n for (const item of sorted) {\n const action = actionColor[item.action](item.action);\n const mode = modeSuffix({\n mode: item.mode,\n priorMode: item.action === \"replace\" ? item.state.providerMode : undefined,\n defaultMode: plan.defaultMode,\n });\n // Surface FQN migrations: `[Assets] update (renamed from Bucket)` —\n // the update exists to re-brand the moved row's physical resource, and\n // without the note the plan gives no hint why an untouched resource\n // reconciles. (Only apply-side nodes can carry a rename — see\n // `ApplyNodeBase`.)\n const renamed = item.action !== \"delete\" && item.renamedFrom?.length\n ? ` ${dim(`(renamed from ${item.renamedFrom.join(\", \")})`)}`\n : \"\";\n lines.push(`${tag(item.resource.LogicalId)} ${action}${mode}${renamed}`);\n for (const binding of item.bindings) {\n if (binding.action === \"noop\")\n continue;\n const bindingAction = actionColor[binding.action](binding.action);\n lines.push(`${tag(`${item.resource.LogicalId}/${binding.sid}`)} ${bindingAction}`);\n }\n }\n return lines;\n};\nexport const LoggingCli = Layer.succeed(Cli, Cli.of({\n approvePlan: (plan) => Effect.gen(function* () {\n for (const line of formatPlanLines(plan))\n yield* Console.log(line);\n yield* Console.log(`\\n${yellow(\"Non-interactive terminal detected.\")} Pass ${bold(\"--yes\")} to approve, or set ${bold(\"ALCHEMY_TUI=1\")} for the interactive UI.`);\n return false;\n }),\n displayPlan: (plan) => Effect.gen(function* () {\n for (const line of formatPlanLines(plan))\n yield* Console.log(line);\n }),\n startApplySession: (plan) => Effect.gen(function* () {\n for (const line of formatPlanLines(plan))\n yield* Console.log(line);\n yield* Console.log(\"\");\n const counts = { ok: 0, fail: 0 };\n return {\n // Write through the Effect Console SERVICE (not the global\n // `console`) so environments that override it — e.g. the\n // alchemy-test runner's per-test buffering console — capture\n // apply progress instead of having it leak to stdout.\n emit: (event) => Effect.suspend(() => {\n if (event.kind === \"annotate\") {\n return Console.log(`${tag(event.id)} ${blue(event.message)}`);\n }\n const id = event.bindingId\n ? `${event.id}/${event.bindingId}`\n : event.id;\n const status = statusColor(event.status)(event.status);\n const mode = modeSuffix({\n mode: event.providerMode,\n priorMode: event.fromProviderMode,\n defaultMode: plan.defaultMode,\n });\n const msg = event.message ? ` ${dim(\"—\")} ${event.message}` : \"\";\n if (isTerminal(event.status)) {\n if (event.status === \"fail\")\n counts.fail++;\n else\n counts.ok++;\n }\n return Console.log(`${tag(id)} ${status}${mode}${msg}`);\n }),\n done: () => Console.log(`\\n${bold(\"Done:\")} ${green(`${counts.ok} succeeded`)}${counts.fail ? dim(\", \") + red(`${counts.fail} failed`) : \"\"}`),\n };\n }),\n}));\n//# sourceMappingURL=LoggingCli.js.map","import { toPath } from \"../FQN.js\";\nexport function buildNamespaceTree(items, actions = []) {\n const root = {\n id: \"\",\n path: [],\n children: new Map(),\n resources: [],\n actions: [],\n };\n const getNode = (path) => {\n let current = root;\n for (let i = 0; i < path.length; i++) {\n const segment = path[i];\n let child = current.children.get(segment);\n if (!child) {\n child = {\n id: segment,\n path: path.slice(0, i + 1),\n children: new Map(),\n resources: [],\n actions: [],\n };\n current.children.set(segment, child);\n }\n current = child;\n }\n return current;\n };\n for (const item of items) {\n getNode(toPath(item.resource.Namespace)).resources.push(item);\n }\n for (const action of actions) {\n getNode(toPath(action.def.Namespace)).actions.push(action);\n }\n return root;\n}\nexport function deriveNamespaceAction(node) {\n const actions = new Set();\n for (const resource of node.resources) {\n actions.add(deriveResourceChildrenAction(resource, node));\n }\n for (const action of node.actions) {\n // Map task actions onto the resource action space for the rollup:\n // run → create, delete → delete, noop → noop.\n actions.add(action.action === \"run\"\n ? \"create\"\n : action.action === \"delete\"\n ? \"delete\"\n : \"noop\");\n }\n for (const child of node.children.values()) {\n const childAction = deriveNamespaceAction(child);\n if (childAction === \"mixed\") {\n return \"mixed\";\n }\n actions.add(childAction);\n }\n return deriveAction(actions);\n}\nexport function flattenTree(node, depth = 0, result = []) {\n flattenNamespace(node, depth, result);\n return result;\n}\nconst flattenNamespace = (node, depth, result) => {\n const sortedResources = [...node.resources].sort((a, b) => a.resource.LogicalId.localeCompare(b.resource.LogicalId));\n const sortedChildren = Array.from(node.children.entries()).sort(([a], [b]) => a.localeCompare(b));\n const resourceIds = new Set(sortedResources.map((resource) => resource.resource.LogicalId));\n for (const [id, child] of sortedChildren) {\n if (resourceIds.has(id) || isEmpty(child)) {\n continue;\n }\n result.push({\n type: \"namespace\",\n depth,\n id,\n path: child.path,\n action: deriveNamespaceAction(child),\n hasChildren: true,\n });\n flattenNamespace(child, depth + 1, result);\n }\n for (const resource of sortedResources) {\n const childNamespace = node.children.get(resource.resource.LogicalId);\n result.push({\n type: \"resource\",\n depth,\n id: resource.resource.LogicalId,\n path: [...node.path, resource.resource.LogicalId],\n action: resource.action,\n resourceType: resource.resource.Type,\n bindingCount: resource.bindings.length,\n providerMode: resource.mode,\n fromProviderMode: resource.action === \"replace\" &&\n resource.mode !== undefined &&\n resource.state.providerMode !== undefined &&\n resource.state.providerMode !== resource.mode\n ? resource.state.providerMode\n : undefined,\n });\n for (const binding of [...resource.bindings].sort((a, b) => a.sid.localeCompare(b.sid))) {\n result.push({\n type: \"binding\",\n depth: depth + 1,\n id: binding.sid,\n path: [...node.path, resource.resource.LogicalId, binding.sid],\n action: binding.action,\n bindingSid: binding.sid,\n });\n }\n if (childNamespace) {\n flattenNamespace(childNamespace, depth + 1, result);\n }\n }\n // Actions are listed after resources at the same depth.\n const sortedActions = [...node.actions].sort((a, b) => a.def.LogicalId.localeCompare(b.def.LogicalId));\n for (const action of sortedActions) {\n result.push({\n type: \"action\",\n depth,\n id: action.def.LogicalId,\n path: [...node.path, action.def.LogicalId],\n action: action.action,\n actionType: action.def.Type,\n });\n }\n};\nconst isEmpty = (node) => node.resources.length === 0 &&\n node.actions.length === 0 &&\n Array.from(node.children.values()).every(isEmpty);\nconst countVisibleChildren = (node) => {\n const resourceIds = new Set(node.resources.map((resource) => resource.resource.LogicalId));\n return (node.resources.length +\n Array.from(node.children.keys()).filter((id) => !resourceIds.has(id)).length);\n};\nconst deriveResourceChildrenAction = (resource, node) => {\n const actions = new Set([\n resource.action,\n ]);\n for (const binding of resource.bindings) {\n actions.add(binding.action);\n }\n const childNamespace = node.children.get(resource.resource.LogicalId);\n if (childNamespace) {\n actions.add(deriveNamespaceAction(childNamespace));\n }\n return deriveAction(actions);\n};\nconst deriveAction = (actions) => {\n if (actions.size === 0)\n return \"noop\";\n if (actions.has(\"replace\"))\n return actions.size === 1 ? \"replace\" : \"mixed\";\n if (actions.has(\"delete\"))\n return actions.size === 1 ? \"delete\" : \"mixed\";\n if (actions.has(\"create\"))\n return actions.size === 1 ? \"create\" : \"mixed\";\n if (actions.has(\"update\"))\n return actions.size === 1 ? \"update\" : \"mixed\";\n return \"noop\";\n};\n//# sourceMappingURL=NamespaceTree.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/** @jsxImportSource react */\nimport { useMemo } from \"react\";\nimport { Box, Text } from \"ink\";\nimport { buildNamespaceTree, flattenTree, } from \"../../NamespaceTree.js\";\nimport { formatModeNote } from \"../../ModeTag.js\";\nexport function Plan({ plan }) {\n const items = useMemo(() => [\n ...Object.values(plan.resources),\n ...Object.values(plan.deletions),\n ], [plan]);\n const taskItems = useMemo(() => [\n ...Object.values(plan.actions ?? {}),\n ...Object.values(plan.actionDeletions ?? {}),\n ].filter((t) => t !== undefined), [plan]);\n const flatItems = useMemo(() => {\n const tree = buildNamespaceTree(items, taskItems);\n return flattenTree(tree);\n }, [items, taskItems]);\n if (items.length === 0 && taskItems.length === 0) {\n return _jsx(Text, { color: \"gray\", children: \"No changes planned\" });\n }\n const counts = items.reduce((acc, item) => (acc[item.action]++, acc), {\n create: 0,\n update: 0,\n delete: 0,\n noop: 0,\n replace: 0,\n });\n const taskCounts = taskItems.reduce((acc, item) => (acc[item.action]++, acc), { run: 0, noop: 0, delete: 0 });\n const actions = [\"create\", \"update\", \"delete\", \"replace\"].filter((action) => counts[action] > 0);\n const taskHeaderEntries = [\n taskCounts.run > 0 ? `${taskCounts.run} to run` : undefined,\n taskCounts.delete > 0 ? `${taskCounts.delete} to drop` : undefined,\n ].filter((s) => !!s);\n return (_jsxs(Box, { flexDirection: \"column\", children: [_jsxs(Box, { marginTop: 1, children: [_jsx(Text, { underline: true, children: \"Plan\" }), _jsx(Text, { children: \": \" }), [\n ...actions.map((action) => {\n const count = counts[action];\n const color = actionColor(action);\n return (_jsx(Box, { children: _jsxs(Text, { color: color, children: [count, \" to \", action] }) }, action));\n }),\n ...taskHeaderEntries.map((label, i) => (_jsx(Box, { children: _jsx(Text, { color: \"cyan\", children: label }) }, `task-${i}`))),\n ].flatMap((box, i, arr) => i === arr.length - 1\n ? [box]\n : [box, _jsx(Text, { children: \" | \" }, `sep-${i}`)])] }), _jsx(Box, { flexDirection: \"column\", marginTop: 1, children: flatItems.map((item) => {\n const indent = \" \".repeat(item.depth);\n const color = getActionColor(item.action);\n const icon = getActionIcon(item.action);\n const key = item.path.join(\"/\");\n if (item.type === \"namespace\") {\n return (_jsxs(Box, { flexDirection: \"row\", children: [_jsx(Text, { children: indent }), _jsx(Box, { width: 2, children: _jsxs(Text, { color: color, children: [icon, \" \"] }) }), _jsx(Text, { color: \"blueBright\", children: item.id })] }, key));\n }\n if (item.type === \"binding\") {\n return (_jsxs(Box, { flexDirection: \"row\", children: [_jsx(Text, { children: indent }), _jsx(Box, { width: 2, children: _jsxs(Text, { color: color, children: [icon, \" \"] }) }), _jsx(Text, { color: \"cyan\", children: item.bindingSid })] }, key));\n }\n if (item.type === \"action\") {\n return (_jsxs(Box, { flexDirection: \"row\", children: [_jsx(Text, { children: indent }), _jsx(Box, { width: 2, children: _jsxs(Text, { color: color, children: [icon, \" \"] }) }), _jsx(Box, { children: _jsx(Text, { bold: true, children: item.id }) }), _jsx(Box, { marginLeft: 1, children: _jsxs(Text, { color: \"blackBright\", children: [\"(\", item.actionType, \")\"] }) }), _jsx(Box, { marginLeft: 1, children: _jsx(Text, { color: \"cyan\", children: \"[action]\" }) })] }, key));\n }\n // Resource item\n const modeNote = formatModeNote({\n mode: item.providerMode,\n priorMode: item.fromProviderMode,\n defaultMode: plan.defaultMode,\n });\n return (_jsxs(Box, { flexDirection: \"row\", children: [_jsx(Text, { children: indent }), _jsx(Box, { width: 2, children: _jsxs(Text, { color: color, children: [icon, \" \"] }) }), _jsx(Box, { children: _jsx(Text, { bold: true, children: item.id }) }), _jsx(Box, { marginLeft: 1, children: _jsxs(Text, { color: \"blackBright\", children: [\"(\", item.resourceType, \")\"] }) }), modeNote && (_jsx(Box, { marginLeft: 1, children: _jsxs(Text, { color: \"blackBright\", children: [\"(\", modeNote, \")\"] }) })), item.bindingCount !== undefined && item.bindingCount > 0 && (_jsx(Box, { marginLeft: 1, children: _jsxs(Text, { color: \"cyan\", children: [\"(\", item.bindingCount, \" bindings)\"] }) }))] }, key));\n }) })] }));\n}\nconst getActionColor = (action) => ({\n noop: \"gray\",\n create: \"green\",\n update: \"yellow\",\n delete: \"red\",\n replace: \"magenta\",\n mixed: \"cyan\",\n run: \"cyan\",\n})[action] ?? \"gray\";\nconst getActionIcon = (action) => ({\n create: \"+\",\n update: \"~\",\n delete: \"-\",\n noop: \"•\",\n replace: \"!\",\n mixed: \"*\",\n run: \"λ\",\n})[action] ?? \"?\";\nconst actionColor = (action) => getActionColor(action);\n//# sourceMappingURL=Plan.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/** @jsxImportSource react */\nimport { useState } from \"react\";\nimport { Box, Text, useApp, useInput } from \"ink\";\nimport { Plan } from \"./Plan.js\";\nexport function ApprovePlan(props) {\n const { plan, approve } = props;\n const [selected, setSelected] = useState(0);\n const { exit } = useApp();\n useInput((_input, key) => {\n if (key.leftArrow || key.rightArrow) {\n setSelected((prev) => (prev === 0 ? 1 : 0));\n }\n else if (key.return) {\n approve(selected === 0);\n exit();\n }\n });\n return (_jsxs(Box, { flexDirection: \"column\", children: [_jsx(Plan, { plan: plan }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { children: \"Proceed?\" }) }), _jsxs(Box, { gap: 1, children: [_jsxs(Text, { color: selected === 0 ? \"green\" : \"gray\", children: [selected === 0 ? \"◉\" : \"○\", \" Yes\"] }), _jsxs(Text, { color: selected === 1 ? \"red\" : \"gray\", children: [selected === 1 ? \"◉\" : \"○\", \" No\"] })] })] }));\n}\n//# sourceMappingURL=ApprovePlan.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/** @jsxImportSource react */\nimport { useEffect, useMemo, useRef, useState } from \"react\";\nimport { Box, Text } from \"ink\";\nimport { buildNamespaceTree, flattenTree, } from \"../../NamespaceTree.js\";\nimport { formatModeNote } from \"../../ModeTag.js\";\nconst getTaskKey = (item) => item.path.join(\"/\");\nexport const buildProgressRows = (plan) => {\n const items = [\n ...Object.values(plan.resources),\n ...Object.values(plan.deletions).filter((item) => item !== undefined),\n ];\n const taskItems = [\n ...Object.values(plan.actions ?? {}),\n ...Object.values(plan.actionDeletions ?? {}),\n ].filter((t) => t !== undefined);\n const tree = buildNamespaceTree(items, taskItems);\n return flattenTree(tree)\n .filter((item) => item.type !== \"binding\")\n .map((item) => {\n if (item.type === \"namespace\") {\n return {\n key: getTaskKey(item),\n type: \"namespace\",\n id: item.id,\n depth: item.depth,\n action: item.action,\n };\n }\n if (item.type === \"action\") {\n return {\n key: getTaskKey(item),\n type: \"task\",\n id: item.id,\n depth: item.depth,\n actionType: item.actionType ?? \"unknown\",\n action: item.action,\n };\n }\n return {\n key: getTaskKey(item),\n type: \"resource\",\n id: item.id,\n depth: item.depth,\n resourceType: item.resourceType ?? \"unknown\",\n action: item.action,\n providerMode: item.providerMode,\n fromProviderMode: item.fromProviderMode,\n persistedApplyStatus: item.action === \"noop\"\n ? (() => {\n const crud = findCrudByLogicalId(plan, item.id);\n return crud?.action === \"noop\" ? crud.state.status : undefined;\n })()\n : undefined,\n };\n });\n};\nconst buildLogicalIdIndex = (rows) => {\n const index = new Map();\n for (const row of rows) {\n if (row.type !== \"resource\" && row.type !== \"task\")\n continue;\n const keys = index.get(row.id);\n if (keys) {\n keys.push(row.key);\n }\n else {\n index.set(row.id, [row.key]);\n }\n }\n return index;\n};\nexport function toPlanTask(rowOrId, planItem) {\n if (typeof rowOrId === \"string\") {\n return {\n key: rowOrId,\n id: rowOrId,\n type: planItem.resource.Type,\n status: planItem.action === \"noop\" ? planItem.state.status : \"pending\",\n updatedAt: Date.now(),\n };\n }\n return {\n key: rowOrId.key,\n id: rowOrId.id,\n type: rowOrId.resourceType,\n status: rowOrId.action === \"noop\"\n ? (rowOrId.persistedApplyStatus ?? \"created\")\n : \"pending\",\n updatedAt: Date.now(),\n };\n}\nconst buildInitialTasks = (rows) => new Map(rows.flatMap((row) => row.type === \"resource\"\n ? [[row.key, toPlanTask(row)]]\n : row.type === \"task\"\n ? [\n [\n row.key,\n {\n key: row.key,\n id: row.id,\n type: row.actionType,\n // `noop` tasks are skipped — render as gray `•` from the start\n // rather than briefly flashing the `ran` cyan styling.\n status: row.action === \"noop\"\n ? \"skipped\"\n : \"pending\",\n updatedAt: Date.now(),\n },\n ],\n ]\n : []));\nexport function PlanProgress(props) {\n const { source, plan } = props;\n const spinner = useGlobalSpinner();\n const rows = useMemo(() => buildProgressRows(plan), [plan]);\n const logicalIdIndex = useMemo(() => buildLogicalIdIndex(rows), [rows]);\n const [tasks, setTasks] = useState(() => buildInitialTasks(rows));\n const unsubscribeRef = useRef(null);\n useEffect(() => {\n unsubscribeRef.current?.();\n unsubscribeRef.current = source.subscribe((event) => {\n setTasks((prev) => {\n const next = new Map(prev);\n const keys = logicalIdIndex.get(event.id) ?? [];\n if (event.kind === \"status-change\") {\n if (!event.bindingId) {\n for (const key of keys) {\n const current = next.get(key);\n next.set(key, {\n key,\n id: event.id,\n type: event.type,\n status: event.status,\n message: event.message ?? current?.message,\n updatedAt: Date.now(),\n });\n }\n }\n }\n else {\n for (const key of keys) {\n const current = next.get(key);\n if (!current)\n continue;\n next.set(key, {\n ...current,\n message: event.message,\n updatedAt: Date.now(),\n });\n }\n }\n return next;\n });\n });\n return () => {\n unsubscribeRef.current?.();\n unsubscribeRef.current = null;\n };\n }, [logicalIdIndex, source]);\n useEffect(() => {\n setTasks(buildInitialTasks(rows));\n }, [rows]);\n return (_jsx(Box, { flexDirection: \"column\", children: rows.map((row) => {\n const indent = \" \".repeat(row.depth);\n if (row.type === \"namespace\") {\n return (_jsxs(Box, { flexDirection: \"row\", children: [_jsx(Text, { children: indent }), _jsx(Box, { width: 2, children: _jsx(Text, { color: \"blueBright\", children: \"\\u21B3 \" }) }), _jsx(Text, { color: \"blueBright\", children: row.id })] }, row.key));\n }\n if (row.type === \"task\") {\n const t = tasks.get(row.key);\n const status = t?.status ?? (row.action === \"noop\" ? \"ran\" : \"pending\");\n const color = statusColor(status);\n const icon = taskIcon(row.action, status, spinner);\n const label = row.action === \"delete\"\n ? status === \"deleted\" || status === \"retained\"\n ? status\n : \"drop\"\n : status === \"ran\"\n ? row.action === \"noop\"\n ? \"skip\"\n : \"ran\"\n : status === \"running\"\n ? \"running\"\n : status === \"fail\"\n ? \"fail\"\n : row.action === \"noop\"\n ? \"skip\"\n : \"run\";\n return (_jsxs(Box, { flexDirection: \"column\", children: [_jsxs(Box, { flexDirection: \"row\", children: [_jsx(Text, { children: indent }), _jsx(Box, { width: 2, children: _jsxs(Text, { color: color, children: [icon, \" \"] }) }), _jsx(Text, { bold: true, children: row.id }), _jsxs(Text, { dimColor: true, children: [\" (\", row.actionType, \")\"] }), _jsxs(Text, { color: color, children: [\" \", label] }), _jsxs(Text, { color: \"cyan\", dimColor: true, children: [\" \", \"[action]\"] })] }), t?.message ? (_jsx(Box, { paddingLeft: row.depth * 2 + 2, children: _jsxs(Text, { dimColor: true, children: [\"\\u2022 \", t.message] }) })) : null] }, row.key));\n }\n const task = tasks.get(row.key) ?? toPlanTask(row);\n const displayStatus = getDisplayStatus(row, task.status);\n const color = statusColor(displayStatus);\n const icon = statusIcon(task.status, spinner);\n const modeNote = formatModeNote({\n mode: row.providerMode,\n priorMode: row.fromProviderMode,\n defaultMode: plan.defaultMode,\n });\n return (_jsxs(Box, { flexDirection: \"column\", children: [_jsxs(Box, { flexDirection: \"row\", children: [_jsx(Text, { children: indent }), _jsx(Box, { width: 2, children: _jsxs(Text, { color: color, children: [icon, \" \"] }) }), _jsx(Text, { bold: true, children: task.id }), _jsxs(Text, { dimColor: true, children: [\" (\", task.type, \")\"] }), modeNote ? _jsxs(Text, { dimColor: true, children: [\" (\", modeNote, \")\"] }) : null, _jsxs(Text, { color: color, children: [\" \", displayStatus] })] }), task.message ? (_jsx(Box, { paddingLeft: row.depth * 2 + 2, children: _jsxs(Text, { dimColor: true, children: [\"\\u2022 \", task.message] }) })) : null] }, row.key));\n }) }));\n}\nfunction getDisplayStatus(row, status) {\n if (row.action === \"noop\" && (status === \"created\" || status === \"updated\")) {\n return \"no change\";\n }\n return status;\n}\nfunction statusColor(status) {\n switch (status) {\n case \"no change\":\n return \"gray\";\n case \"pending\":\n return \"gray\";\n case \"creating\":\n case \"created\":\n return \"green\";\n case \"updating\":\n case \"updated\":\n return \"yellow\";\n case \"deleting\":\n case \"deleted\":\n return \"red\";\n case \"retained\":\n return \"gray\";\n case \"running\":\n case \"ran\":\n return \"cyan\";\n case \"skipped\":\n return \"gray\";\n case \"fail\":\n return \"redBright\";\n default:\n return undefined;\n }\n}\nfunction taskIcon(action, status, spinnerChar) {\n if (status === \"running\")\n return spinnerChar;\n if (status === \"fail\")\n return \"✗\";\n if (status === \"skipped\")\n return \"•\";\n if (status === \"ran\")\n return action === \"noop\" ? \"•\" : \"✓\";\n if (status === \"deleted\" || status === \"retained\")\n return \"✓\";\n if (action === \"delete\")\n return \"-\";\n if (action === \"noop\")\n return \"•\";\n return \"λ\";\n}\nfunction statusIcon(status, spinnerChar) {\n if (isInProgress(status))\n return spinnerChar;\n if (status === \"fail\")\n return \"✗\";\n return \"✓\"; // created/updated/deleted/replaced/etc.\n}\nfunction isInProgress(status) {\n return (status === \"pending\" ||\n status === \"creating\" ||\n status === \"updating\" ||\n status === \"deleting\" ||\n status === \"running\");\n}\nconst spinnerFrames = [\"⠋\", \"⠙\", \"⠹\", \"⠸\", \"⠼\", \"⠴\", \"⠦\", \"⠧\", \"⠇\", \"⠏\"];\nfunction useGlobalSpinner(intervalMs = 80) {\n const [index, setIndex] = useState(0);\n useEffect(() => {\n const timer = setInterval(() => {\n setIndex((i) => (i + 1) % spinnerFrames.length);\n }, intervalMs);\n return () => clearInterval(timer);\n }, [intervalMs]);\n return spinnerFrames[index];\n}\nconst findCrudByLogicalId = (plan, logicalId) => {\n for (const node of Object.values(plan.resources)) {\n if (node.resource.LogicalId === logicalId) {\n return node;\n }\n }\n for (const node of Object.values(plan.deletions)) {\n if (node?.resource.LogicalId === logicalId) {\n return node;\n }\n }\n return undefined;\n};\n//# sourceMappingURL=PlanProgress.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\n/** @jsxImportSource react */\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport { render } from \"ink\";\nimport { Cli } from \"../Cli.js\";\nimport { ApprovePlan } from \"./components/ApprovePlan.js\";\nimport { Plan as PlanComponent } from \"./components/Plan.js\";\nimport { PlanProgress } from \"./components/PlanProgress.js\";\nexport const inkCLI = () => Layer.succeed(Cli, Cli.of({\n approvePlan,\n displayPlan,\n startApplySession,\n}));\nconst approvePlan = Effect.fn(function* (plan) {\n let approved = false;\n const { waitUntilExit } = render(_jsx(ApprovePlan, { plan: plan, approve: (a) => (approved = a) }));\n yield* Effect.promise(waitUntilExit);\n return approved;\n});\nconst displayPlan = (plan) => Effect.sync(() => {\n const { unmount } = render(_jsx(PlanComponent, { plan: plan }));\n unmount();\n});\nconst startApplySession = Effect.fn(function* (plan) {\n // Print the plan preview once into scrollback before mounting the\n // animated progress region (mirrors LoggingCli, which prints the plan\n // lines at session start — `alchemy dev`/`--yes` runs never call\n // displayPlan/approvePlan, so without this the TTY path shows no plan at\n // all). Rendering + immediately unmounting leaves the frame behind and\n // releases the Ink instance for PlanProgress; forwarded runtime logs then\n // insert BETWEEN the preview and the live region instead of piling above\n // the entire transcript.\n yield* displayPlan(plan);\n const listeners = new Set();\n const { unmount } = render(_jsx(PlanProgress, { plan: plan, source: {\n subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n } }));\n return {\n done: Effect.fn(function* () {\n yield* Effect.sleep(10); // give the react event loop time to re-render\n yield* Effect.sync(() => unmount());\n }),\n emit: (event) => Effect.sync(() => {\n for (const listener of listeners)\n listener(event);\n }),\n };\n});\n//# sourceMappingURL=InkCLI.js.map","import * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport { isNonInteractive } from \"../Util/interactive.js\";\nimport { LoggingCli } from \"./LoggingCli.js\";\nexport { isNonInteractive } from \"../Util/interactive.js\";\nexport const selectCli = () => isNonInteractive()\n ? LoggingCli\n : // Defer importing the Ink/React TUI (`./tui/InkCLI.tsx` pulls in `ink`)\n // until we actually need the interactive renderer. Non-interactive runs\n // (agents, CI, piped output) take the cheap `LoggingCli` branch and never\n // pay the TUI import cost.\n Layer.unwrap(Effect.promise(() => import(\"./tui/InkCLI.js\").then((m) => m.inkCLI())));\n//# sourceMappingURL=selectCli.js.map","import * as ConfigProvider from \"effect/ConfigProvider\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Schema from \"effect/Schema\";\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\";\nimport { AlchemyContextLive } from \"../AlchemyContext.js\";\nimport { CredentialsStoreLive } from \"../Auth/Credentials.js\";\nimport { ProfileLive } from \"../Auth/Profile.js\";\nimport * as RpcProviderProxy from \"../Local/RpcProviderProxy.js\";\nimport { forwardSidecarLogs } from \"../Local/RpcSpawner.js\";\nimport { PlatformServices } from \"../Util/PlatformServices.js\";\nimport { execStack, ExecStackOptions } from \"./commands/deploy.js\";\nimport { LoggingCli } from \"./LoggingCli.js\";\nimport { selectCli } from \"./selectCli.js\";\n// `alchemy dev` is a long-running session whose primary output is the log\n// stream (worker starts, cron fires, request logs) interleaved with\n// re-applies on file change. Ink's insertion model stacks inserted lines\n// ABOVE the animated region, so runtime logs end up above the plan/apply\n// output in scrollback. Append-only chronological rendering is the correct\n// model for a dev server (plan → status → logs, strictly in order), so dev\n// always takes the line renderer; deploy/destroy keep the interactive TUI.\nconst makeServices = (dev) => Layer.merge(dev ? LoggingCli : selectCli(), RpcProviderProxy.fromEnv()).pipe(Layer.provideMerge(Layer.mergeAll(AlchemyContextLive, ProfileLive, CredentialsStoreLive)), Layer.provideMerge(Layer.mergeAll(PlatformServices, FetchHttpClient.layer, ConfigProvider.layer(ConfigProvider.fromEnv()))));\nexport const exec = () => {\n const options = Schema.decodeSync(ExecStackOptions)(JSON.parse(process.env.ALCHEMY_EXEC_OPTIONS));\n // Subscribe to the spawner's sidecar log stream BEFORE the stack runs:\n // this process owns the terminal renderer, so sidecar output printed here\n // lands in chronological order with the run's own lines instead of racing\n // the shared tty. No-op outside dev.\n return forwardSidecarLogs.pipe(Effect.andThen(execStack(options)), Effect.provide(makeServices(options.dev)), Effect.scoped);\n};\n//# sourceMappingURL=exec.js.map","import { exec } from \"alchemy/Cli\";\nimport { runMain } from \"alchemy/Util/PlatformServices\";\n\nexec().pipe(runMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKa,iBAAb,cAAoC,cAAc,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAC/E;CACa,qBAAqB,MAAM,OAAO,gBAAgB,OAAO,IAAI,aAAa;EACnF,MAAM,KAAK,OAAO,WAAW;EAE7B,MAAM,OAAM,OADQA,OAAK,KAAA,CACR,KAAK,QAAQ,IAAI,GAAG,UAAU;EAC/C,OAAO,GAAG,cAAc,KAAK,EAAE,WAAW,KAAK,CAAC;EAChD,OAAO;GACH,YAAY;GACZ,kBAAkB;GAClB,KAAK;GACL,OAAO;EACX;CACJ,CAAC,CAAC;;;;;;CCJW,yBAAyB;EAClC,MAAM,MAAM,QAAQ;EACpB,IAAI,IAAI,kBAAkB,OAAO,IAAI,mBAAmB,KACpD,OAAO;EACX,IAAI,IAAI,gBAAgB,KACpB,OAAO;EACX,IAAI,CAAC,QAAQ,OAAO,OAChB,OAAO;EACX,IAAI,IAAI,IACJ,OAAO;EAGX,IAAI,IAAI,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AC,CAAC,CAAC;;;ACNnC,oBAAA;AACI,iBAAA;AACb,aAAA;AACgB,sBAAA;AAEF,sBAAA;AAW9D,MAAM,gBAAgB,QAAQ,MAAM,MAAM,MAAM,aAAa,UAAU,GAAGE,QAAyB,CAAC,CAAC,CAAC,KAAK,MAAM,aAAa,MAAM,SAAS,oBAAoB,aAAa,oBAAoB,CAAC,GAAG,MAAM,aAAa,MAAM,SAAS,kBAAkB,gBAAgB,OAAO,eAAe,MAAM,eAAe,QAAQ,CAAC,CAAC,CAAC,CAAC;AACjU,MAAaC,eAAa;CACtB,MAAM,UAAU,OAAO,WAAW,gBAAgB,CAAC,CAAC,KAAK,MAAM,QAAQ,IAAI,oBAAoB,CAAC;CAKhG,OAAO,mBAAmB,KAAK,OAAO,QAAQ,UAAU,OAAO,CAAC,GAAG,OAAO,QAAQ,aAAa,QAAQ,GAAG,CAAC,GAAG,OAAO,MAAM;AAC/H;;;AC5BuD,sBAAA;AAEvDC,OAAK,CAAC,CAAC,KAAK,OAAO"}
1
+ {"version":3,"file":"exec.js","names":["Path","Path","Context","Context","statusColor","Context","Path","Context","Context","Path","Context","Interaction.Interaction","Interaction.accessors","Context","fromEnvironment","of","options","configureMethods","Interaction.accessors","Region.of","Endpoint.none","EffectConsole","Interaction.Interaction","Interaction.openUrl","Path","openUrl","Interaction.openUrl","Interaction.Interaction","OAUTH_CLIENT_ID","OAUTH_REDIRECT_URI","OAUTH_LOCAL_CALLBACK_URI","OAUTH_ENDPOINTS","client","options","withOAuthCredentials","Interaction.accessors","Interaction.Interaction","OAuthClient.authorize","OAuthClient.callback","OAuthClient.exchangeCallbackInput","STATE_STORE_CREDENTIALS_FILE","OAuthClient.usesCurrentClient","OAuthClient.refresh","OAuthClient.revoke","resolveApiBaseUrl","DEFAULT_API_BASE_URL","options","Interaction.accessors","ChildProcess","DEFAULT_API_BASE_URL","Interaction.accessors","options","OAuthClient.authorize","OAuthClient.callback","OAuthClient.exchangeCallbackInput","OAuthClient.usesCurrentClient","OAuthClient.refresh","normalizeApiBaseUrl","DEFAULT_API_BASE_URL","Interaction.accessors","Os","Interaction.Interaction","Interaction.openUrl","DEFAULT_API_BASE_URL","Context","Context","Context","Context","Context","inspect","State.State","Stack","Context","Stack","Output.stackRef","make","Context","Context","Context","Stack.Stack","Path","Output.isOutput","Context","Output.NamedExpr","Output.EffectExpr","Output.VoidExpr","Context","make","Stack","Context","make","ChildProcessSpawner","ChildProcess","os","crypto","packageJson.version","packageJson.version","Output.isExpr","Output.hasOutputs","Context","Output.ResourceExpr","Output.isExpr","Output.of","Output.isResourceExpr","Output.isPropExpr","Output.isApplyExpr","Output.hasOutputs","Output.isEffectExpr","Output.isFlatMapExpr","Output.asOutput","Output.isAllExpr","Output.isLiteralExpr","Output.isRefExpr","Output.InvalidReferenceError","Output.isStackRefExpr","Output.isNamedExpr","Output.upstreamAny","apply","Stack","Output.evaluate","Output.resolveUpstream","Output.upstreamAny","Plan.destroy","Plan.make","Plan.describePlan","applyPlan","packageJson.version","Context","_jsx","Text","_jsx","SigilText","SigilHyperlink","_jsx","Box","Row","_jsxs","Text","SigilBox","_jsxs","Box","_jsx","Text","statusColor","_jsxs","Text","_jsx","Box","_Fragment","_jsxs","Row","_jsx","Text","_jsxs","Text","_jsx","_jsxs","Box","Text","_jsx","_Fragment","_jsx","_Fragment","_jsxs","Context","Text","Report.Cli","_jsx","Box","Output.isExpr","isTerminal","_jsxs","Row","_jsx","Text","_jsxs","_Fragment","_jsx","Text","Box","Row","_jsxs","Text","Box","_jsx","_jsx","PlanComponent","_jsx","Box","Text","_jsx","Text","_jsxs","Box","_Fragment","packageJson.version","CliKit.CliKitInteraction","CliKit.layer","RpcProviderProxy.fromEnv","Stacks.plan","Stacks.apply","CliKit.CliKit","Path","exec","exec"],"sources":["../lib/AlchemyContext.js","../lib/UserFacingError.js","../lib/Alchemist/Entrypoint.js","../lib/AdoptPolicy.js","../lib/Artifacts.js","../lib/Util/cached-function.js","../lib/Util/Terminal.js","../lib/Util/Theme.js","../lib/Interaction.js","../lib/Auth/Paths.js","../lib/Auth/Lock.js","../lib/Auth/AuthProvider.js","../lib/Util/AtomicFile.js","../lib/Util/interactive.js","../lib/Auth/Profile.js","../lib/Util/ConfigProvider.js","../lib/Auth/Resolve.js","../lib/Auth/Credentials.js","../lib/Auth/Env.js","../lib/Auth/StoredAuthProvider.js","../lib/AWS/Environment.js","../lib/AWS/Endpoint.js","../lib/AWS/Region.js","../lib/AWS/AuthProvider.js","../lib/Axiom/AuthProvider.js","../lib/Auth/OAuthFlow.js","../lib/Auth/BrowserOAuth.js","../lib/Cloudflare/StateStore/CredentialsFile.js","../lib/Cloudflare/Auth/OAuthClient.js","../lib/Cloudflare/Auth/AuthConfig.js","../lib/Cloudflare/Auth/OAuthScopes.js","../lib/Cloudflare/Auth/AuthProvider.js","../lib/Fly/AuthProvider.js","../lib/GitHub/BaseUrl.js","../lib/GitHub/AuthProvider.js","../lib/Hetzner/AuthProvider.js","../lib/Neon/AuthProvider.js","../lib/Planetscale/OAuthClient.js","../lib/Planetscale/AuthProvider.js","../lib/Prisma/AuthProvider.js","../lib/Railway/LoginSession.js","../lib/Railway/AuthProvider.js","../lib/Stripe/AuthProvider.js","../lib/Ref.js","../lib/FQN.js","../lib/ProviderMode.js","../lib/Provider.js","../lib/Resource.js","../lib/RuntimeContext.js","../lib/Stage.js","../lib/State/State.js","../lib/Util/data.js","../lib/Output.js","../lib/StackContext.js","../lib/Util/effect.js","../lib/Util/FileLogger.js","../lib/Util/Node.js","../lib/Util/PlatformServices.js","../lib/Stack.js","../lib/Report.js","../lib/Alchemist/Progress.js","../lib/Alchemist/Session.js","../lib/Local/DevLog.js","../lib/State/StateEncoding.js","../lib/Local/RpcSerialization.js","../lib/Local/RpcServerEnvironment.js","../lib/Local/RpcProviderProxy.js","../lib/Local/RpcSpawner.js","../package.json","../lib/Telemetry/Attributes.js","../lib/Telemetry/Layer.js","../lib/ActionRuntimeContext.js","../lib/Auth/Demand.js","../lib/Diff.js","../lib/InstanceId.js","../lib/Util/Memoize.js","../lib/Util/types.js","../lib/Action.js","../lib/Telemetry/Metrics.js","../lib/Util/scc.js","../lib/Util/sha256.js","../lib/Plan.js","../lib/Apply.js","../lib/Alchemist/routes/stack.js","../lib/Cli/DevOptions.js","../lib/Util/ConsoleSink.js","../lib/Cli/GlobalLog.js","../lib/Cli/CliKit/CliKit.js","../lib/Cli/components/ui/Environment.js","../lib/Cli/components/ui/Typography.js","../lib/Cli/components/ui/Layout.js","../lib/Cli/components/ui/Feedback.js","../lib/Cli/components/ui/Interactive.js","../lib/Cli/components/ui/Live.js","../lib/Cli/components/ui/Transcript.js","../lib/Cli/components/view/Prompts.js","../lib/Cli/components/view/Runtime.js","../lib/Cli/CliKit/layer.js","../lib/Cli/CliKit/interaction.js","../lib/Cli/components/types.js","../lib/Cli/CliKit/index.js","../lib/Cli/commands/errors.js","../lib/Cli/commands/render.js","../lib/Cli/components/ui/index.js","../lib/Cli/components/view/StackOutputs.js","../lib/Cli/Format.js","../lib/Cli/components/view/statusStyle.js","../lib/Cli/ModeTag.js","../lib/Util/ResourceOutput.js","../lib/Cli/PropertyDiff.js","../lib/Cli/NamespaceTree.js","../lib/Cli/LoggingCli.js","../lib/Cli/PlainCliFormatter.js","../lib/Cli/components/view/PlanRow.js","../lib/Cli/components/view/PlanTree.js","../lib/Cli/components/view/usePlanViewport.js","../lib/Cli/components/view/usePlanPresentation.js","../lib/Cli/components/view/PlanView.js","../lib/Cli/components/view/ApprovePlan.js","../lib/Cli/components/view/SigilCli.js","../lib/Cli/components/view/Logo.js","../lib/Cli/components/view/Help.js","../lib/Cli/selectCli.js","../lib/Cli/exec.js","exec.ts"],"sourcesContent":["import * as EffectContext from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Path from \"effect/Path\";\nexport class AlchemyContext extends EffectContext.Service()(\"alchemy/Context\") {\n}\nexport const AlchemyContextLive = Layer.effect(AlchemyContext, Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const dir = path.join(process.cwd(), \".alchemy\");\n yield* fs.makeDirectory(dir, { recursive: true });\n return {\n dotAlchemy: dir,\n updateStateStore: false,\n dev: false,\n adopt: false,\n };\n}));\n//# sourceMappingURL=AlchemyContext.js.map","import * as Predicate from \"effect/Predicate\";\n/**\n * Marker for error classes whose `message` is written for end users. The CLI's\n * top-level handler prints a marked error's `message` as a single friendly\n * line instead of dumping the raw cause chain.\n *\n * Mark a class by assigning the symbol in the class body:\n *\n * ```ts\n * export class MyError extends Data.TaggedError(\"MyError\")<{\n * readonly message: string;\n * }> {\n * readonly [UserFacingError] = true;\n * }\n * ```\n *\n * Classes without a human-readable `message` prop derive one with a getter\n * (see `AlchemistNotFound` in `Alchemist/Errors.ts`).\n */\nexport const UserFacingError = Symbol.for(\"alchemy/UserFacingError\");\nexport const isUserFacing = (error) => Predicate.hasProperty(error, UserFacingError) &&\n error[UserFacingError] === true &&\n Predicate.hasProperty(error, \"message\") &&\n typeof error.message === \"string\";\n//# sourceMappingURL=UserFacingError.js.map","import * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Path from \"effect/Path\";\nimport { UserFacingError } from \"../UserFacingError.js\";\nexport class StackEntrypointError extends Data.TaggedError(\"StackEntrypointError\") {\n [UserFacingError] = true;\n}\nexport const DEFAULT_ENTRYPOINT = \"alchemy.run.ts\";\n/**\n * The absolute path of the stack entrypoint, or the user-facing error for\n * a missing one. Kept apart from `Session.ts` so the `alchemy dev`\n * supervisor can check the entry before it starts an exec child, without\n * loading the engine that module carries.\n */\nexport const resolveStackEntrypoint = Effect.fn(function* (main) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const absolutePath = path.resolve(main);\n if (!(yield* fs.exists(absolutePath))) {\n return yield* Effect.fail(new StackEntrypointError({\n message: `Stack entrypoint '${main}' does not exist in '${path.dirname(absolutePath)}'. Run this command from an Alchemy project or pass --config <path>.`,\n }));\n }\n return absolutePath;\n});\n//# sourceMappingURL=Entrypoint.js.map","import * as Context from \"effect/Context\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\n/**\n * AdoptPolicy controls whether the engine should \"adopt\" pre-existing cloud\n * resources that conflict with this stack instead of failing.\n *\n * The engine always calls a provider's `read` lifecycle operation when there\n * is no prior state and `read` is implemented. The provider's job is to\n * report two things:\n *\n * 1. Whether the resource exists (returns attributes vs. `undefined`).\n * 2. Whether *we* own it (plain attributes vs. {@link Unowned}-branded).\n *\n * The engine then routes:\n *\n * | `read` outcome | `adopt: false` | `adopt: true` |\n * | ------------------- | -------------- | ----------------- |\n * | undefined | create | create |\n * | owned (plain attrs) | silent adopt | silent adopt |\n * | {@link Unowned} | fail | takeover (adopt) |\n *\n * \"Owned\" means a provider has affirmatively determined the resource was\n * created by this stack/stage/logical-id (typically by inspecting tags or\n * naming conventions). Resources without ownership semantics simply always\n * return plain attrs — they are treated as owned by default, so silent\n * adoption is the norm and `--adopt` is unnecessary.\n *\n * The policy can be overridden per-effect via {@link adopt} — most commonly\n * applied at the resource or stack scope.\n */\nexport class AdoptPolicy extends Context.Service()(\"AdoptPolicy\") {\n}\n/**\n * Engine-raised failure produced when `read` reports an existing resource\n * marked as {@link Unowned} and `adopt` is `false`. Surface this to the user\n * to indicate they should either re-tag the cloud resource, pick a different\n * physical name, or re-run with `--adopt` (or `adopt(true)`) to force a\n * takeover.\n */\nexport class OwnedBySomeoneElse extends Data.TaggedError(\"OwnedBySomeoneElse\") {\n}\n/**\n * Private symbol used to brand attribute objects returned by `read` as\n * \"exists in cloud, but not owned by this stack/stage/logical-id\".\n *\n * Deliberately *not* registered via `Symbol.for` — the brand is an\n * engine-internal routing hint and must not be observable or\n * forgeable from outside this module. The engine strips it before any\n * state persistence (see {@link stripUnowned}) so it never leaks into\n * the state store, JSON serialization, or downstream `Output`s.\n */\nconst UnownedTag = Symbol(\"alchemy/Unowned\");\n/**\n * Brand a `read` return value as belonging to a different owner.\n *\n * Use this in a provider's `read` implementation when the resource exists in\n * the cloud but a positive ownership check (e.g. tag inspection) shows it\n * was *not* created by this stack/stage/logical-id:\n *\n * ```ts\n * read: Effect.fn(function* ({ id, output, olds }) {\n * const settings = yield* getScriptSettings({ ... }).pipe(\n * Effect.catchTag(\"WorkerNotFound\", () => Effect.succeed(undefined)),\n * );\n * if (!settings) return undefined;\n *\n * const attrs = { workerName, ...buildAttrs(settings) };\n * return hasAlchemyWorkerTags(id, settings.tags) ? attrs : Unowned(attrs);\n * }),\n * ```\n *\n * The returned value is structurally still `T` — there is no wrapper to\n * unwrap. The brand is a non-enumerable symbol that the engine inspects\n * during planning to decide whether to take over (`adopt: true`) or fail\n * loudly (`adopt: false`).\n *\n * Resources without ownership semantics should simply return plain attrs —\n * the engine treats them as owned and silent adoption is the default.\n */\nexport const Unowned = Object.assign((attrs) => {\n const cloned = { ...attrs };\n Object.defineProperty(cloned, UnownedTag, {\n value: true,\n enumerable: false,\n writable: false,\n configurable: false,\n });\n return cloned;\n}, {\n is: (value) => typeof value === \"object\" &&\n value !== null &&\n value[UnownedTag] === true,\n});\n/**\n * Strip the {@link Unowned} brand from an attributes object before persisting\n * it — state should not carry per-deploy ownership-routing metadata.\n *\n * The brand is intentionally non-enumerable, so a plain spread already\n * drops it; the additional `delete` is defense-in-depth in case a future\n * change makes the descriptor enumerable. Always returns a fresh object\n * (never mutates the input).\n */\nexport const stripUnowned = (attrs) => {\n const out = { ...attrs };\n if (UnownedTag in out)\n delete out[UnownedTag];\n return out;\n};\nexport const adopt = ((enabled = true) => (eff) => eff.pipe(typeof enabled === \"boolean\"\n ? Effect.provideService(AdoptPolicy, enabled ?? true)\n : Effect.provideServiceEffect(AdoptPolicy, enabled)));\n//# sourceMappingURL=AdoptPolicy.js.map","import * as Context from \"effect/Context\";\nimport * as Deferred from \"effect/Deferred\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\n/**\n * Per-resource in-memory artifacts shared across a single `Plan.make -> apply`\n * execution.\n *\n * The engine scopes this service by resource `FQN` before invoking lifecycle\n * handlers, so providers should treat it as a resource-local bag for expensive,\n * deterministic intermediate results that can be reused across phases.\n *\n * Expected usage:\n *\n * - `diff` computes an expensive artifact once and stores it\n * - `create` / `update` reads the same artifact and skips recomputing it\n * - artifacts are ephemeral and must never be required for correctness on a\n * later deploy because the bag is reset between runs\n *\n * Example:\n *\n * ```ts\n * const artifacts = yield* Artifacts;\n * const cached = yield* artifacts.get<PreparedBundle>(\"bundle\");\n * if (cached) return cached;\n *\n * const bundle = yield* prepareBundle();\n * yield* artifacts.set(\"bundle\", bundle);\n * return bundle;\n * ```\n */\nexport class Artifacts extends Context.Service()(\"Artifacts\") {\n}\nexport class ArtifactStore extends Context.Service()(\"Artifacts/Store\") {\n}\n/**\n * Create a fresh root store for one deploy/test run.\n */\nexport const createArtifactStore = () => new Map();\nconst getOrCreateBag = (store, fqn) => {\n const existing = store.get(fqn);\n if (existing) {\n return existing;\n }\n const bag = new Map();\n store.set(fqn, bag);\n return bag;\n};\nexport const makeScopedArtifacts = (store, fqn) => {\n const bag = getOrCreateBag(store, fqn);\n return {\n get: (key) => Effect.sync(() => bag.get(key)),\n set: (key, value) => Effect.sync(() => {\n bag.set(key, value);\n }),\n delete: (key) => Effect.sync(() => {\n bag.delete(key);\n }),\n };\n};\nexport const scopedArtifacts = (fqn) => Layer.effect(Artifacts, ArtifactStore.useSync((store) => makeScopedArtifacts(store, fqn)));\n/**\n * Run an effect with a fresh artifact root, replacing any existing store.\n * Use this at top-level entrypoints that intentionally define a new deploy run.\n */\nexport const provideFreshArtifactStore = (effect) => effect.pipe(Effect.provideServiceEffect(ArtifactStore, Effect.sync(createArtifactStore)));\n/**\n * Ensure an artifact root exists, reusing the ambient store when one is already\n * present. This lets nested helpers participate in the same run-scoped cache.\n */\nexport const ensureArtifactStore = (effect) => Effect.serviceOption(ArtifactStore).pipe(Effect.map(Option.getOrUndefined), Effect.flatMap((existing) => effect.pipe(Effect.provideService(ArtifactStore, existing ?? createArtifactStore()))));\nexport const cached = (id) => (eff) => Effect.gen(function* () {\n const artifacts = yield* Artifacts;\n const deferred = yield* Deferred.make();\n const cached = yield* artifacts.get(id);\n if (cached) {\n if (Effect.isEffect(cached)) {\n return yield* cached;\n }\n return cached;\n }\n yield* artifacts.set(id, Deferred.await(deferred));\n const result = yield* eff;\n yield* Deferred.succeed(deferred, result);\n yield* artifacts.set(id, result);\n return result;\n});\n//# sourceMappingURL=Artifacts.js.map","import * as Deferred from \"effect/Deferred\";\nimport * as Effect from \"effect/Effect\";\n/**\n * Creates a memoized version of a function that returns an Effect.\n *\n * The key feature is deduplication of concurrent calls with the same inputs -\n * only one execution happens while other callers wait for and receive the same result.\n *\n * @example\n * ```ts\n * import * as Effect from \"effect/Effect\";\n * import { cachedFunction } from \"~/lib/cached-function\";\n *\n * const fetchUser = (id: string) =>\n * Effect.promise(() => fetch(`/users/${id}`).then(r => r.json()));\n *\n * const program = Effect.gen(function* () {\n * const cachedFetchUser = yield* cachedFunction(fetchUser);\n *\n * // These concurrent calls will only trigger one fetch\n * const [user1, user2] = yield* Effect.all([\n * cachedFetchUser(\"123\"),\n * cachedFetchUser(\"123\"),\n * ]);\n * });\n * ```\n */\nexport const cachedFunction = (fn, options) => Effect.sync(() => {\n const keyFn = options?.key ?? JSON.stringify;\n const cache = new Map();\n return (...args) => Effect.suspend(() => {\n const cacheKey = keyFn(args);\n const existing = cache.get(cacheKey);\n // If there's already a deferred for this key, wait on it\n if (existing) {\n return Deferred.await(existing);\n }\n // Create a new deferred and store it\n return Effect.gen(function* () {\n const deferred = yield* Deferred.make();\n cache.set(cacheKey, deferred);\n // Execute the effect and complete the deferred\n const exit = yield* Effect.exit(fn(...args));\n yield* Deferred.done(deferred, exit);\n if (exit._tag === \"Failure\") {\n cache.delete(cacheKey);\n }\n // Return the result\n return yield* exit;\n });\n });\n});\n//# sourceMappingURL=cached-function.js.map","/** Terminal-emulator features shared by CliKit components. */\nimport { detectColorLevel, detectUnicodeSupport, } from \"@alchemy.run/sigil/capabilities\";\nimport { setClipboard, setTerminalProgress, stringWidth, tmuxPassthrough, } from \"@alchemy.run/sigil/ansi\";\nexport const ANSI_RESET = \"\\u001B[0m\";\nexport const ANSI_BOLD = \"\\u001B[1m\";\nexport const ANSI_DIM = \"\\u001B[2m\";\n/** Truecolor foreground escape for raw, non-layout output. */\nexport const ansiFg = (hex) => {\n const red = Number.parseInt(hex.slice(1, 3), 16);\n const green = Number.parseInt(hex.slice(3, 5), 16);\n const blue = Number.parseInt(hex.slice(5, 7), 16);\n return `\\u001B[38;2;${red};${green};${blue}m`;\n};\n/**\n * The canonical color-support decision, shared by raw terminal strings and\n * CliKit capability detection so the two can never disagree.\n */\nexport const colorsEnabled = (stream = process.stdout) => detectColorLevel(stream) > 0;\n/** The canonical Unicode-support decision for raw terminal strings. */\nexport const unicodeEnabled = detectUnicodeSupport;\n/** Environment override for child processes whose piped output returns here. */\nexport const pipedColorEnv = () => colorsEnabled() ? { FORCE_COLOR: process.env.FORCE_COLOR ?? \"1\" } : {};\nexport const paint = (code, value) => colorsEnabled() ? `${code}${value}${ANSI_RESET}` : value;\nexport const copyToClipboard = (text, stdout = process.stdout) => {\n let sequence = setClipboard(text);\n if (process.env.TMUX !== undefined) {\n sequence = tmuxPassthrough(sequence);\n }\n stdout.write(sequence);\n};\nexport const setNativeProgress = (state, value, stdout = process.stdout) => {\n if (stdout.isTTY !== true)\n return;\n let sequence = setTerminalProgress(state, value);\n if (process.env.TMUX !== undefined)\n sequence = tmuxPassthrough(sequence);\n stdout.write(sequence);\n};\nconst truncateSegmenter = new Intl.Segmenter();\n/** Display-width-aware truncation (wide CJK/emoji count by rendered cells). */\nexport const truncate = (value, width) => {\n const max = Math.max(4, width);\n if (stringWidth(value) <= max)\n return value;\n let total = 0;\n let kept = \"\";\n for (const { segment } of truncateSegmenter.segment(value)) {\n const segmentWidth = stringWidth(segment);\n if (total + segmentWidth > max - 1)\n break;\n total += segmentWidth;\n kept += segment;\n }\n return `${kept}…`;\n};\n//# sourceMappingURL=Terminal.js.map","/**\n * Alchemy's palette is anchored in terracotta and green. The supporting\n * amber, olive, sage, and coral tones stay within that warm botanical range.\n */\nconst color = {\n brand: \"#e28a5b\",\n accent: \"#9acb69\",\n accentBright: \"#c5df8c\",\n accentMuted: \"#60764b\",\n success: \"#9acb69\",\n warning: \"#efb85a\",\n danger: \"#d96f52\",\n magenta: \"#c084d6\",\n info: \"#b6c77a\",\n sage: \"#b8cf83\",\n olive: \"#9ea85e\",\n coral: \"#ef9a6a\",\n muted: \"#8f887c\",\n diffAddBackground: \"#263b2a\",\n diffRemoveBackground: \"#422a26\",\n onAccent: \"#14110d\",\n emphasis: \"#f5f0e6\",\n};\nexport const theme = {\n color,\n space: {\n inline: 1,\n indent: 2,\n section: 1,\n },\n paint: {\n focus: color.brand,\n interactive: color.brand,\n info: color.info,\n success: color.success,\n warning: color.warning,\n error: color.danger,\n },\n glyph: {\n section: \"●\",\n /**\n * Marks the step currently being answered — the same \"active one\" glyph\n * the profile tabs use. Deliberately not a chevron so the list cursor\n * (`pointer`) is the only chevron on screen.\n */\n active: \"◆\",\n /** List cursor: the one focus glyph shared by every prompt and dashboard row. */\n pointer: \"❯\",\n success: \"✓\",\n warning: \"!\",\n error: \"×\",\n info: \"•\",\n selected: \"◆\",\n unselected: \"·\",\n checked: \"✓\",\n unchecked: \"·\",\n add: \"+\",\n adopt: \"(+)\",\n edit: \"~\",\n refresh: \"↻\",\n delete: \"-\",\n orphan: \"(-)\",\n replace: \"↔\",\n run: \"▶\",\n bar: \"┊\",\n mask: \"•\",\n bullet: \"·\",\n overflowUp: \"↑\",\n overflowDown: \"↓\",\n overflowLeft: \"‹\",\n overflowRight: \"›\",\n },\n /**\n * Key-hint labels for KeyBar footers. Resolve through `useKeyGlyphs()`\n * (components/Environment.tsx) so ASCII terminals get readable fallbacks\n * instead of mojibake.\n */\n keyHint: {\n enter: \"↩\",\n upDown: \"↑/↓\",\n leftRight: \"←/→\",\n escape: \"esc\",\n space: \"space\",\n tab: \"tab\",\n yesNo: \"y/n\",\n },\n};\nexport const asciiGlyphs = {\n section: \"@\",\n active: \"*\",\n pointer: \">\",\n success: \"+\",\n warning: \"!\",\n error: \"x\",\n info: \"i\",\n selected: \"*\",\n unselected: \".\",\n checked: \"x\",\n unchecked: \".\",\n add: \"+\",\n adopt: \"(+)\",\n edit: \"~\",\n refresh: \"r\",\n delete: \"-\",\n orphan: \"(-)\",\n replace: \"~\",\n run: \">\",\n bar: \":\",\n mask: \"*\",\n bullet: \".\",\n overflowUp: \"^\",\n overflowDown: \"v\",\n overflowLeft: \"<\",\n overflowRight: \">\",\n};\nexport const glyphsFor = (unicode) => unicode ? theme.glyph : asciiGlyphs;\nconst spinnerFrames = [\n \"⠋\",\n \"⠙\",\n \"⠹\",\n \"⠸\",\n \"⠼\",\n \"⠴\",\n \"⠦\",\n \"⠧\",\n \"⠇\",\n \"⠏\",\n];\nconst asciiSpinnerFrames = [\"-\", \"\\\\\", \"|\", \"/\"];\nexport const spinnerFramesFor = (unicode) => unicode ? spinnerFrames : asciiSpinnerFrames;\nexport const statusColor = (variant) => variant === \"error\" ? theme.color.danger : theme.color[variant];\nexport const statusPaint = (variant) => theme.paint[variant];\n//# sourceMappingURL=Theme.js.map","/**\n * The engine's capability contract for talking to a human.\n *\n * `Interaction` is the narrow, presentation-free slice of terminal\n * interaction that non-CLI code (auth flows, the state store, engine\n * surfaces) may use: plain-string messages, a handful of prompt shapes,\n * and `task`. Nothing in its vocabulary knows a renderer exists — the CLI\n * provides an implementation backed by its terminal UI kit (see\n * `Cli/CliKit/interaction.ts`), while every other process gets\n * {@link layerNonInteractive}: messages render as plain status lines and\n * every prompt fails with the typed {@link NonInteractiveTerminal}.\n *\n * Child processes (the RPC sidecar, spawned dev children) deliberately do\n * NOT provide this service at all — interaction capability is structural,\n * not configured. Code that might need a human declares it; a process that\n * cannot reach one simply doesn't have the service in its graph.\n */\nimport * as Cause from \"effect/Cause\";\nimport * as Context from \"effect/Context\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport { ChildProcess } from \"effect/unstable/process\";\nimport { UserFacingError } from \"./UserFacingError.js\";\nimport { ANSI_DIM, ANSI_RESET, ansiFg, colorsEnabled, } from \"./Util/Terminal.js\";\nimport { glyphsFor, statusColor } from \"./Util/Theme.js\";\nimport { unicodeEnabled } from \"./Util/Terminal.js\";\n/** The user dismissed the active terminal interaction. */\nexport class TerminalCancelled extends Data.TaggedError(\"TerminalCancelled\") {\n}\n/** An interactive operation was requested without an interactive terminal. */\nexport class NonInteractiveTerminal extends Data.TaggedError(\"NonInteractiveTerminal\") {\n [UserFacingError] = true;\n}\n/** The platform's browser launcher exited unsuccessfully. */\nexport class BrowserOpenFailed extends Data.TaggedError(\"BrowserOpenFailed\") {\n}\n/**\n * The capability to ask or tell the human driving this process. Provided\n * by the CLI (terminal-backed) or {@link layerNonInteractive} (plain\n * output, typed prompt failures); never provided in child processes.\n */\nexport class Interaction extends Context.Service()(\"Alchemy::Interaction\") {\n}\n/** Effectful service accessors for code that must defer acquisition to use time. */\nexport const accessors = {\n output: {\n info: (message) => Effect.flatMap(Interaction, (service) => service.output.info(message)),\n success: (message) => Effect.flatMap(Interaction, (service) => service.output.success(message)),\n warning: (message) => Effect.flatMap(Interaction, (service) => service.output.warning(message)),\n error: (message) => Effect.flatMap(Interaction, (service) => service.output.error(message)),\n },\n prompt: {\n text: (options) => Effect.flatMap(Interaction, (service) => service.prompt.text(options)),\n password: (options) => Effect.flatMap(Interaction, (service) => service.prompt.password(options)),\n confirm: (options) => Effect.flatMap(Interaction, (service) => service.prompt.confirm(options)),\n select: (options) => Effect.flatMap(Interaction, (service) => service.prompt.select(options)),\n multiSelect: (options) => Effect.flatMap(Interaction, (service) => service.prompt.multiSelect(options)),\n },\n};\n/**\n * Open a URL in the platform's default browser without invoking a shell.\n *\n * Fails with {@link BrowserOpenFailed} when the launcher exits non-zero (e.g.\n * `xdg-open` with no handler installed). Some `xdg-open` configurations block\n * until the browser itself exits — a launcher still running after a short\n * grace period is treated as a successful launch rather than awaited.\n */\nexport const openUrl = (url) => Effect.gen(function* () {\n const [command, args] = process.platform === \"win32\"\n ? [\"rundll32.exe\", [\"url.dll,FileProtocolHandler\", url]]\n : process.platform === \"darwin\"\n ? [\"open\", [url]]\n : [\"xdg-open\", [url]];\n const handle = yield* ChildProcess.make(command, [...args], {\n shell: false,\n });\n const exitCode = yield* handle.exitCode.pipe(Effect.timeoutOption(\"3 seconds\"));\n if (Option.isSome(exitCode) && exitCode.value !== 0) {\n return yield* Effect.fail(new BrowserOpenFailed({ command, exitCode: exitCode.value }));\n }\n}).pipe(Effect.scoped);\nconst makeNonInteractive = (options) => {\n const stdout = options.stdout ?? process.stdout;\n const colors = options.colors ?? colorsEnabled(stdout);\n const glyphs = glyphsFor(options.unicode ?? unicodeEnabled());\n const colorize = (hex, value) => colors ? `${ansiFg(hex)}${value}${ANSI_RESET}` : value;\n const muted = (value) => colors ? `${ANSI_DIM}${value}${ANSI_RESET}` : value;\n // Plain-string equivalent of the CLI's `Status` component: colored glyph,\n // the message (painted for errors), and a muted `· detail` suffix.\n const statusText = (variant, message, detail) => {\n const glyph = colorize(statusColor(variant), glyphs[variant]);\n const body = variant === \"error\" ? colorize(statusColor(variant), message) : message;\n return `${glyph} ${body}${detail === undefined ? \"\" : ` ${muted(`· ${detail}`)}`}`;\n };\n const log = (variant) => (message) => Effect.sync(() => {\n const { message: text, detail } = typeof message === \"string\" ? { message } : message;\n stdout.write(`${statusText(variant, text, detail)}\\n`);\n });\n const unavailable = (operation) => Effect.fail(new NonInteractiveTerminal({\n operation,\n message: `Cannot run ${operation} without an interactive terminal. Provide the equivalent command flags instead.`,\n }));\n return {\n output: {\n info: log(\"info\"),\n success: log(\"success\"),\n warning: log(\"warning\"),\n error: log(\"error\"),\n },\n prompt: {\n text: () => unavailable(\"text input\"),\n password: () => unavailable(\"password input\"),\n confirm: () => unavailable(\"confirmation\"),\n select: () => unavailable(\"selection\"),\n multiSelect: () => unavailable(\"multiple selection\"),\n awaitExternal: () => unavailable(\"external authorization\"),\n },\n task: (taskOptions, effect) => Effect.suspend(() => {\n let settled = false;\n const settle = (variant, message) => Effect.suspend(() => {\n if (settled)\n return Effect.void;\n settled = true;\n return log(variant)(message ?? taskOptions.label);\n });\n return log(\"info\")({\n message: taskOptions.label,\n detail: taskOptions.detail,\n }).pipe(Effect.andThen(effect.pipe(Effect.onExit((exit) => Exit.isSuccess(exit)\n ? settle(\"success\")\n : // Interruption (Ctrl+C) is not a failure — leave the row\n // unsettled instead of painting a red error status.\n Cause.hasInterruptsOnly(exit.cause)\n ? Effect.void\n : settle(\"error\")))));\n }),\n };\n};\n/**\n * The default Interaction for processes without a terminal renderer: the\n * programmatic engine API, tests, and any headless embedding. Messages\n * print as plain status lines; every prompt fails immediately with the\n * typed {@link NonInteractiveTerminal}.\n */\nexport const layerNonInteractive = (options = {}) => Layer.effect(Interaction, Effect.sync(() => makeNonInteractive(options)));\n//# sourceMappingURL=Interaction.js.map","import os from \"node:os\";\nimport path from \"pathe\";\n/**\n * Root of alchemy's user-level auth state (`~/.alchemy`). Overridable with\n * `ALCHEMY_HOME`, which relocates profiles, credential files,\n * and cross-process locks together — used by tests to isolate a temp home\n * and available to users who keep dotfiles elsewhere. Resolved lazily so an\n * override set after module load (e.g. in a test) still takes effect.\n */\nexport const rootDir = () => process.env.ALCHEMY_HOME ?? path.join(os.homedir(), \".alchemy\");\nexport const configFilePath = () => path.join(rootDir(), \"profiles.json\");\n/** Directory containing one directory per named profile. */\nexport const profilesDirPath = () => path.join(rootDir(), \"profiles\");\n/** Directory containing all provider documents for a named profile. */\nexport const profileDirPath = (profile) => path.join(profilesDirPath(), profile);\n/** The single persisted document for one provider in one profile. */\nexport const profileProviderFilePath = (profile, provider) => path.join(profileDirPath(profile), `${provider.toLowerCase()}.json`);\nexport const credentialsDirPath = () => path.join(rootDir(), \"credentials\");\nexport const profileCredentialsDirPath = (profile) => path.join(credentialsDirPath(), profile);\n//# sourceMappingURL=Paths.js.map","import * as Clock from \"effect/Clock\";\nimport * as Console from \"effect/Console\";\nimport * as Data from \"effect/Data\";\nimport * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Option from \"effect/Option\";\nimport * as Path from \"effect/Path\";\nimport * as Schedule from \"effect/Schedule\";\nimport * as Semaphore from \"effect/Semaphore\";\nimport { rootDir } from \"./Paths.js\";\nconst semaphores = new Map();\n// Keep STALE well above REFRESH — a saturated machine can starve the\n// heartbeat fiber for seconds.\nconst STALE = Duration.seconds(30);\nconst REFRESH = Duration.seconds(10);\nconst RETRY_INTERVAL = Duration.millis(50);\nconst DEFAULT_TIMEOUT = Duration.minutes(2);\n// How often to remind the user that a lock wait / locked operation is still\n// outstanding. Long enough that healthy runs never print it.\nconst STALL_INTERVAL = Duration.seconds(30);\nclass LockHeld extends Data.TaggedError(\"LockHeld\") {\n}\nclass LockTimeout extends Data.TaggedError(\"LockTimeout\") {\n}\n/**\n * Make a lock key safe to use as a file name on every platform.\n *\n * Keys are derived from user-controlled values (profile names), which\n * have shown up in production containing shell placeholders like\n * `${ALCHEMY_PROFILE:-default}` — `:`/`{`/`$` are invalid in Windows\n * file names and mkdir fails with EINVAL. Collapse anything outside a\n * conservative allow-list to `_`.\n *\n * @internal exported for unit testing.\n */\nexport const sanitizeLockKey = (key) => key.replace(/[^A-Za-z0-9._-]/g, \"_\");\n/**\n * Take the cross-process lock. On success the ambient scope owns it: a\n * finalizer removes it and a forked heartbeat keeps its mtime fresh.\n */\nconst acquireFileLock = Effect.fn(function* (lockPath, timeout) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const ownerPath = path.join(lockPath, \"owner\");\n const owner = yield* Effect.sync(() => crypto.randomUUID());\n yield* fs.makeDirectory(path.dirname(lockPath), { recursive: true });\n // Reap a lock whose crashed holder stopped refreshing its mtime.\n const reapStale = Effect.gen(function* () {\n const info = yield* fs.stat(lockPath);\n const now = yield* Clock.currentTimeMillis;\n const isStale = Option.exists(info.mtime, (mtime) => mtime.getTime() < now - Duration.toMillis(STALE));\n if (isStale) {\n yield* fs.remove(lockPath, { recursive: true, force: true });\n }\n }).pipe(Effect.catchReason(\"PlatformError\", \"NotFound\", () => Effect.void));\n // A non-recursive mkdir is the atomic test-and-set; the owner marker lets\n // release and refresh verify the lock wasn't reaped and re-taken.\n yield* Effect.acquireRelease(fs\n .makeDirectory(lockPath)\n .pipe(Effect.andThen(fs\n .writeFileString(ownerPath, owner)\n .pipe(Effect.onError(() => fs\n .remove(lockPath, { recursive: true, force: true })\n .pipe(Effect.ignore))))), () => fs.readFileString(ownerPath).pipe(Effect.filterOrFail((current) => current === owner), Effect.andThen(fs.remove(lockPath, { recursive: true, force: true })), Effect.ignore)).pipe(Effect.catchReason(\"PlatformError\", \"AlreadyExists\", () => reapStale.pipe(Effect.andThen(Effect.fail(new LockHeld())))), Effect.retry({\n while: (error) => error._tag === \"LockHeld\",\n schedule: Schedule.spaced(RETRY_INTERVAL).pipe(Schedule.upTo({ duration: timeout })),\n }), Effect.catchTag(\"LockHeld\", () => Effect.die(new LockTimeout({\n lockPath,\n timeout,\n message: `Timed out waiting for the alchemy auth lock '${lockPath}' — another alchemy ` +\n `process has held it for over ${Duration.toSeconds(timeout)}s. If no other ` +\n `alchemy process is running, delete the lock directory and retry.`,\n }))));\n yield* fs.readFileString(ownerPath).pipe(Effect.filterOrFail((current) => current === owner), Effect.andThen(Clock.currentTimeMillis.pipe(Effect.map((now) => new Date(now)))), \n // NB: utimes interprets a bare number as *seconds* since epoch.\n Effect.flatMap((now) => fs.utimes(lockPath, now, now)), Effect.repeat(Schedule.spaced(REFRESH)), Effect.catch(() => Effect.logWarning(`auth lock compromised (continuing): '${lockPath}' is no longer owned by this process`)), \n // Acquisition returns while this fiber refreshes until the lock scope ends.\n Effect.forkScoped);\n});\n/**\n * Periodic \"I am not dead, I am stuck here\" notice, forked for the lifetime\n * of a {@link withLock} call.\n *\n * Deliberately `Console.error` rather than `Effect.logWarning`: the CLI's\n * telemetry layer replaces the console logger with the OTLP one (see\n * `Telemetry/Layer.ts`), so log records reach `.alchemy/log/out` but never\n * the terminal. The whole point of this notice is to reach the user who is\n * watching a frozen terminal, so it must not go through the logger.\n */\nconst stallNotice = (lockPath, label, phase, interval) => Effect.gen(function* () {\n const start = yield* Clock.currentTimeMillis;\n const notice = Effect.gen(function* () {\n // Report real elapsed time, not an accumulated interval count — the\n // notice cadence and the reported wait must not drift apart.\n const now = yield* Clock.currentTimeMillis;\n const seconds = Math.round((now - start) / 1000);\n yield* Console.error(phase.current === \"waiting\"\n ? `alchemy: ${seconds}s waiting for the auth lock '${lockPath}' (${label}). ` +\n `Another alchemy process holds it; if none is running, delete that directory.`\n : `alchemy: ${label} has been running for ${seconds}s while holding the auth lock ` +\n `'${lockPath}'. Re-run with --log-level debug for detail.`);\n });\n // `Effect.schedule` (unlike `Effect.repeat`) consults the schedule\n // before the first run, and `Schedule.fixed`'s first recurrence comes\n // after one full interval — so notices fire at interval, 2*interval, …\n // on true wall-clock boundaries.\n yield* Effect.schedule(notice, Schedule.fixed(interval));\n});\n/**\n * Serialise execution of `effect` for the same `key`, both within this\n * process (a semaphore) and across processes on the same machine (an atomic\n * lock directory whose mtime is refreshed while held so another process can\n * recover it after a crash).\n *\n * Failure to create or acquire the lock is fatal. Authentication writes its\n * profile state beneath the same root, so continuing without a writable lock\n * cannot produce a valid deployment and would permit concurrent corruption.\n */\nexport const withLock = (key, effect, options) => {\n const safeKey = sanitizeLockKey(key);\n const label = options?.label ?? key;\n let semaphore = semaphores.get(safeKey);\n if (semaphore === undefined) {\n semaphore = Semaphore.makeUnsafe(1);\n semaphores.set(safeKey, semaphore);\n }\n return semaphore.withPermit(Effect.gen(function* () {\n const path = yield* Path.Path;\n const lockPath = path.join(rootDir(), \"lock\", `${safeKey}.lock`);\n const phase = { current: \"waiting\" };\n if (options?.watchdog !== false) {\n yield* Effect.forkScoped(stallNotice(lockPath, label, phase, options?.stallInterval ?? STALL_INTERVAL));\n }\n yield* Effect.logDebug(`auth lock: acquiring '${lockPath}' for ${label}`);\n yield* acquireFileLock(lockPath, options?.timeout ?? DEFAULT_TIMEOUT).pipe(Effect.orDie);\n phase.current = \"held\";\n yield* Effect.logDebug(`auth lock: acquired '${lockPath}' for ${label}`);\n return yield* effect.pipe(Effect.onExit(() => Effect.logDebug(`auth lock: releasing '${lockPath}' for ${label}`)));\n }).pipe(Effect.scoped));\n};\n/**\n * Serialize an operation with every credential mutation for a profile. The\n * lock key is shared by every credential operation for the profile,\n * including profile-wide rename and delete operations.\n */\nexport const withProfileCredentialsLock = (profileName, effect) => withLock(`profile-credentials-${profileName}`, effect);\n//# sourceMappingURL=Lock.js.map","import { cachedFunction } from \"../Util/cached-function.js\";\nimport * as Config from \"effect/Config\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport * as Path from \"effect/Path\";\nimport * as Schema from \"effect/Schema\";\nimport * as Semaphore from \"effect/Semaphore\";\nimport { Interaction } from \"../Interaction.js\";\nimport { UserFacingError } from \"../UserFacingError.js\";\nimport { withProfileCredentialsLock } from \"./Lock.js\";\n/**\n * Canonical web host for OAuth provider-agnostic landing pages\n * (`/auth/success`, `/auth/error`). The CLI's loopback server 302s the\n * browser to one of these after handling the OAuth callback. Centralized\n * here so the redirect target lives in exactly one place across all\n * provider OAuth clients.\n */\nexport const AUTH_LANDING_HOST = \"https://alchemy.run\";\nexport const AUTH_SUCCESS_URL = `${AUTH_LANDING_HOST}/auth/success`;\nexport const AUTH_ERROR_URL = `${AUTH_LANDING_HOST}/auth/error`;\n/**\n * Methods that may drive an interactive flow (prompts, browser-based\n * OAuth, etc.). A process-wide mutex serializes these across providers\n * so that, e.g., Cloudflare's `configure` finishes its prompt sequence\n * before Planetscale's begins — even when the two auth provider Layers\n * are built in parallel as part of a single `providers()` Layer.\n *\n * The interactive renderer enforces per-prompt serialization; this mutex\n * enforces per-flow serialization so the user sees one provider's prompts\n * grouped together rather than interleaved.\n */\nconst interactiveMutex = Semaphore.makeUnsafe(1);\nexport class AuthError extends Schema.TaggedError()(\"AuthError\", {\n message: Schema.String,\n cause: Schema.optional(Schema.Defect()),\n}) {\n [UserFacingError] = true;\n}\n/**\n * Stored credentials exist (or are expected) but cannot be used until the\n * user re-authenticates: missing values, an expired/rotated\n * token, or a session the provider can no longer refresh silently. The\n * profile UI renders this as \"needs re-login\" instead of a generic error,\n * and callers match it with `Effect.catchTag(\"NeedsReauth\", ...)` — never\n * by inspecting the message.\n */\nexport class NeedsReauth extends Schema.TaggedError()(\"NeedsReauth\", {\n provider: Schema.String,\n profile: Schema.String,\n message: Schema.String,\n cause: Schema.optional(Schema.Defect()),\n}) {\n [UserFacingError] = true;\n}\n/**\n * Standard remediation hint appended to stored-credential errors\n * (\"credentials not found\", \"refresh failed\", ...). Deliberately generic —\n * the explicit command is correct from any surface, including inside the\n * profile dashboard (where `r` is merely the shortcut for it). Centralized\n * so the phrasing lives in one place; surface-aware wording can layer on\n * top later without touching call sites.\n */\nexport const refreshHint = (provider, profileName) => `Run \\`alchemy profile refresh --profile ${profileName} --provider ${provider}\\`.`;\n/** {@link refreshHint}'s sibling for reconfiguration. */\nexport const reconfigureHint = (provider, profileName) => `Run \\`alchemy profile edit --profile ${profileName} --reconfigure ${provider}\\` to reconfigure.`;\nexport class AuthProviders extends Context.Service()(\"AuthProviders\") {\n}\n/**\n * Declares one environment variable a provider's {@link AuthProviderImpl.readEnvironment}\n * consumes. Profiles are not available in CI — environment variables are the\n * only CI credential source — so this metadata is the machine-readable\n * contract for \"what must CI set\": rendered in docs, surfaced by the CLI,\n * and available to tooling through the {@link AuthProviders} registry.\n */\nexport const EnvironmentVariable = Schema.Struct({\n /** Environment variable name, e.g. `CLOUDFLARE_API_TOKEN`. */\n name: Schema.String,\n /** What the variable configures and when it applies. */\n description: Schema.optional(Schema.String),\n /**\n * Whether credential resolution fails when neither this variable nor one\n * of its {@link alternatives} is set. Use `description` to explain\n * conditional requirements (e.g. \"required unless X is set\").\n */\n required: Schema.Boolean,\n /** Holds a secret — display surfaces must redact its value. */\n secret: Schema.optional(Schema.Boolean),\n /**\n * Alternative variable names that satisfy the same requirement, in\n * precedence order after {@link name} (e.g. `AWS_DEFAULT_REGION` for\n * `AWS_REGION`).\n */\n alternatives: Schema.optional(Schema.Array(Schema.String)),\n});\nconst EnvironmentVariables = Schema.Array(EnvironmentVariable);\n/** Render a one-line summary of a provider's environment contract. */\nexport const describeEnvironment = (environment) => environment\n .map((v) => {\n const names = [v.name, ...(v.alternatives ?? [])].join(\" | \");\n return v.required ? names : `[${names}]`;\n})\n .join(\", \");\n/**\n * The variable names a provider's environment resolution would consume, or\n * `undefined` when the declared contract is not fully satisfied (some\n * required variable has no non-empty value). Reads through the ambient\n * `ConfigProvider` — the process environment plus `.env` / `--env-file` —\n * so it sees exactly what `readEnvironment` will. Environment credentials\n * take precedence over any profile, CI or not; the returned names tell the\n * user exactly which keys won.\n */\nexport const presentEnvironment = (environment) => Effect.gen(function* () {\n const used = [];\n for (const variable of environment) {\n let found;\n for (const name of [variable.name, ...(variable.alternatives ?? [])]) {\n const value = yield* Config.option(Config.String(name));\n if (Option.isSome(value) && value.value !== \"\") {\n found = name;\n break;\n }\n }\n if (found !== undefined)\n used.push(found);\n else if (variable.required)\n return undefined;\n }\n return used.length > 0 ? used : undefined;\n});\nexport const AuthProvider = () => (name, impl) => Effect.gen(function* () {\n // FileSystem/Path back the cross-process credentials lock that wraps\n // `logout`/`read` below, so capture them with the impl's own services.\n //\n // `Effect.context()` snapshots the ENTIRE fiber context (the type\n // parameter only narrows the type), and `Effect.provideContext` makes\n // the provided side win — so an Interaction that happens to be\n // ambient at REGISTRATION would silently shadow whatever the caller\n // provides at call time, making the interactive methods' declared\n // `Interaction` requirement a dead letter. Omit it from the snapshot:\n // interactive flows resolve Interaction from the caller, exactly as\n // their signatures promise (a scripted test Interaction, a\n // browser-driven Alchemist login).\n // SAFETY: the assertion restores the pre-omit type — tsc cannot reduce\n // `Exclude<R, … Exclude<R, Interaction>>` over the generic R. It only\n // over-promises Interaction, which every registered method signature\n // re-declares as a requirement anyway, so no call site can rely on the\n // capture satisfying it.\n const ctx = Context.omit(Interaction)(yield* Effect.context());\n const providers = yield* AuthProviders;\n const service = yield* Effect.isEffect(impl)\n ? impl\n : Effect.succeed(impl);\n // Validate the declared environment contract at registration so a\n // malformed declaration fails at layer build (programmer error), not\n // when a CI run tries to render it.\n const environment = service.environment === undefined\n ? []\n : Schema.decodeUnknownSync(EnvironmentVariables)(service.environment);\n if (service.readEnvironment !== undefined && environment.length === 0) {\n return yield* Effect.die(`AuthProvider '${name}' implements readEnvironment but does not ` +\n \"declare its `environment` variables. Declare every variable \" +\n \"readEnvironment consumes so CI requirements are discoverable.\");\n }\n if (service.configureWith !== undefined &&\n (service.configureMethods === undefined ||\n service.configureMethods.length === 0)) {\n return yield* Effect.die(`AuthProvider '${name}' implements configureWith but does not ` +\n \"declare `configureMethods`. Declare each accepted --method and \" +\n \"its --set fields so the CLI can validate and document them.\");\n }\n const provider = {\n logEnvironmentCredentials: yield* cachedFunction((used) => Effect.logInfo(`${name}: using environment variables (${used.join(\", \")}) instead of the profile.`), { key: ([used]) => JSON.stringify(used.toSorted()) }),\n kind: \"AuthProvider\",\n name,\n // configure/login can wait minutes on a browser grant, so they hold\n // only the process-level interactive mutex — never the per-profile\n // credentials lock, which would starve every concurrent `read` (its\n // waiters time out at ~120s). Providers whose login path performs a\n // rotate-on-use silent refresh wrap that read-refresh-persist\n // section (and only it) in `withProfileCredentialsLock` themselves;\n // a post-browser persist is a benign whole-file swap where the last\n // grant wins.\n configure: (profileName, currentConfig) => Semaphore.withPermits(interactiveMutex, 1)(service\n .configure(profileName, currentConfig)\n .pipe(Effect.provideContext(ctx))),\n login: (profileName, config, updateConfig) => Semaphore.withPermits(interactiveMutex, 1)(service\n .login(profileName, config, updateConfig)\n .pipe(Effect.provideContext(ctx))),\n logout: (profileName, config) => withProfileCredentialsLock(profileName, service.logout(profileName, config)).pipe(Effect.provideContext(ctx)),\n details: (profileName, config, updateConfig) => withProfileCredentialsLock(profileName, service.details(profileName, config, updateConfig)).pipe(Effect.provideContext(ctx)),\n ...(service.configureWith === undefined\n ? {}\n : {\n configureWith: (profileName, input) => service.configureWith(profileName, input).pipe(Effect.provideContext(ctx)),\n configureMethods: service.configureMethods,\n }),\n read: (profileName, config, updateConfig) => withProfileCredentialsLock(profileName, service.read(profileName, config, updateConfig)).pipe(Effect.provideContext(ctx)),\n readEnvironment: service.readEnvironment?.pipe(Effect.provideContext(ctx)),\n environment,\n configSchema: service.configSchema,\n decodeConfig: (profileName, config) => Effect.gen(function* () {\n return yield* Schema.decodeUnknownEffect(service.configSchema)(config).pipe(Effect.mapError((cause) => new AuthError({\n message: `Stored ${name} configuration in profile '${profileName}' is not valid ` +\n `for this version of alchemy. ` +\n `${reconfigureHint(name, profileName)}`,\n cause,\n })));\n }),\n };\n providers[name] = provider;\n});\n/**\n * Build a Layer that registers an AuthProvider into the {@link AuthProviders}\n * registry when its parent layer is built. Use this from a provider's\n * top-level `providers()` Layer so that the alchemy CLI can discover the\n * provider via the registry without forcing credential resolution.\n */\nexport const AuthProviderLayer = () => (name, impl) => Layer.effectDiscard(AuthProvider()(name, impl));\n/**\n * Look up a registered {@link AuthProvider} by name. Fails with\n * {@link AuthError} if the provider hasn't been registered (typically because\n * its layer hasn't been built).\n */\nexport const getAuthProvider = (name) => AuthProviders.use((registry) => registry[name] == null\n ? Effect.fail(new AuthError({\n message: `AuthProvider '${name}' is not registered. Make sure its layer has been provided.`,\n }))\n : Effect.succeed(\n // SAFETY: registration erases provider-specific generic parameters;\n // callers restore the contract associated with the requested name.\n registry[name]));\n//# sourceMappingURL=AuthProvider.js.map","import * as Effect from \"effect/Effect\";\n/**\n * Write `contents` to `filePath` via a same-directory temp file + rename.\n *\n * A plain `writeFileString` truncates the target before writing, so a crash\n * mid-write (or a concurrent reader — another CLI process, the RPC sidecar)\n * can observe empty/partial JSON. rename(2) is atomic on the same\n * filesystem, so readers see either the old contents or the new, never a\n * torn write. When `mode` is given it is applied to the temp file *before*\n * the rename, so a secret is never visible at its final path with default\n * permissions. The temp file is removed on failure.\n *\n * Used for `~/.alchemy/profiles.json`, the per-provider credential files,\n * and local state files.\n */\nexport const writeFileAtomic = (fs, filePath, contents, mode) => Effect.suspend(() => {\n const tmp = `${filePath}.${process.pid}.${Math.random()\n .toString(36)\n .slice(2)}.tmp`;\n return fs.writeFileString(tmp, contents).pipe(Effect.flatMap(() => mode === undefined ? Effect.void : fs.chmod(tmp, mode)), Effect.flatMap(() => fs.rename(tmp, filePath)), Effect.tapError(() => fs.remove(tmp).pipe(Effect.ignore)));\n});\n//# sourceMappingURL=AtomicFile.js.map","import * as Effect from \"effect/Effect\";\n/**\n * Returns true when the current process looks like it's being driven by a\n * coding agent, CI runner, test runner, or anything else that won't render an\n * interactive TUI / prompt well.\n *\n * This is the process-level source of truth used by CliKit capability\n * detection, auth configuration guards, and spawned-command stdin policy.\n *\n * Kept in `Util` (rather than `Cli`) so `Auth` can depend on it without\n * pulling in the CLI layer.\n */\n// An explicit CLI flag beats every env-based heuristic. Checked via argv\n// because capability detection runs while the CLI's service layers are\n// built, before the command parser has produced flag values. Only scan up\n// to a `--` separator so a positional argument that happens to be the\n// literal text \"--no-input\" is not mistaken for the flag.\nconst hasNoInputFlag = () => {\n const separator = process.argv.indexOf(\"--\");\n const flagArgs = separator === -1 ? process.argv : process.argv.slice(0, separator);\n return flagArgs.includes(\"--no-input\");\n};\n// Known coding-agent env vars, ported from unjs/std-env (src/agents.ts).\n// Best-effort — the isTTY checks at the call sites already catch most cases\n// since agents typically pipe stdin/stdout. std-env's kiro check\n// (TERM_PROGRAM=kiro gated on no-TTY) is deliberately omitted: both call\n// sites only reach this function when stdin/stdout ARE a TTY, where that\n// check would never match.\nconst isAgentEnv = (env) => !!(\n// explicit override supported by std-env\nenv.AI_AGENT ||\n // claude\n env.CLAUDECODE ||\n env.CLAUDE_CODE ||\n env.CLAUDE_CODE_ENTRYPOINT ||\n // replit\n env.REPL_ID ||\n // gemini\n env.GEMINI_CLI ||\n // codex\n env.CODEX_SANDBOX ||\n env.CODEX_THREAD_ID ||\n env.CODEX_CLI ||\n // opencode\n env.OPENCODE ||\n // auggie\n env.AUGMENT_AGENT ||\n // goose\n env.GOOSE_PROVIDER ||\n // junie\n env.JUNIE_DATA ||\n env.JUNIE_SHIM_PATH ||\n // aider\n env.AIDER_MODEL ||\n // pi\n /\\.pi[\\\\/]agent/.test(env.PATH ?? \"\") ||\n // devin\n /devin/.test(env.EDITOR ?? \"\") ||\n // cursor\n env.CURSOR_AGENT);\nexport const isNonInteractive = () => {\n const env = process.env;\n if (hasNoInputFlag())\n return true;\n if (env.ALCHEMY_PLAIN === \"1\" || env.ALCHEMY_NO_TUI === \"1\")\n return true;\n if (env.ALCHEMY_TUI === \"1\")\n return false;\n if (!process.stdin.isTTY || !process.stdout.isTTY)\n return true;\n if (env.CI)\n return true;\n if (isAgentEnv(env))\n return true;\n return false;\n};\n/**\n * Whether a plain line-based prompt can still read an answer from stdin.\n *\n * Distinct from {@link isNonInteractive}: `ALCHEMY_PLAIN` / `ALCHEMY_NO_TUI`\n * turn off the TUI *rendering*, not input — a human running plain mode in a\n * terminal can still answer a `[y/n]` question. Agents and CI pipe stdin\n * (or set their env markers) and land `false`.\n */\nexport const canPromptOnStdin = () => {\n const env = process.env;\n if (hasNoInputFlag())\n return false;\n if (!process.stdin.isTTY || !process.stdout.isTTY)\n return false;\n if (env.CI)\n return false;\n if (isAgentEnv(env))\n return false;\n return true;\n};\n/** Process capabilities as an Effect so callers can replace them in tests. */\nexport const processInteractionCapabilities = Effect.sync(() => ({ input: !isNonInteractive() }));\n/** Select user-facing copy from an injected capability Effect. */\nexport const messageForCapabilities = (capabilities, interactive, nonInteractive) => Effect.map(capabilities, ({ input }) => input ? interactive : nonInteractive);\n/** Prefer the profile dashboard when this process can own a TUI screen. */\nexport const profileCommandHint = (nonInteractiveCommand) => messageForCapabilities(processInteractionCapabilities, \"alchemy profile\", nonInteractiveCommand);\n//# sourceMappingURL=interactive.js.map","import * as Config from \"effect/Config\";\nimport * as Context from \"effect/Context\";\nimport * as DateTime from \"effect/DateTime\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport * as Path from \"effect/Path\";\nimport * as Result from \"effect/Result\";\nimport * as Schema from \"effect/Schema\";\nimport { UserFacingError } from \"../UserFacingError.js\";\nimport { writeFileAtomic } from \"../Util/AtomicFile.js\";\nimport { profileCommandHint } from \"../Util/interactive.js\";\nimport { AuthError } from \"./AuthProvider.js\";\nimport { withLock } from \"./Lock.js\";\nimport { configFilePath, credentialsDirPath, profileCredentialsDirPath, profileDirPath, profileProviderFilePath, profilesDirPath, rootDir, } from \"./Paths.js\";\nexport { configFilePath, credentialsDirPath, profileCredentialsDirPath, profileDirPath, profileProviderFilePath, profilesDirPath, rootDir, } from \"./Paths.js\";\n/** Config key selecting a directory under `~/.alchemy/profiles`. */\nexport const ALCHEMY_PROFILE = Config.String(\"ALCHEMY_PROFILE\");\n/** Version of the synthesized in-memory manifest returned by readManifest. */\nexport const PROFILE_MANIFEST_VERSION = 3;\n/** Stable format identifier for an individual provider profile document. */\nexport const PROFILE_FORMAT = \"alchemy.profile/v1\";\nexport const DEFAULT_PROFILE_NAME = \"default\";\nexport const DEFAULT_PROFILE_ID = \"default\";\n/**\n * The minimum contract shared by provider-owned values. Providers refine this\n * with their own Effect Schema codec. The method is deliberately an open\n * string: adding an auth method never changes Alchemy's storage schema.\n */\nexport const ProviderConfigSchema = Schema.Record(Schema.String, Schema.Unknown);\n/** User-facing, non-secret annotations. Provider schemas may refine it. */\nexport const ProfileMetadataSchema = Schema.Record(Schema.String, Schema.Unknown);\n/**\n * Base on-disk schema. Only this envelope is owned by Alchemy core; the\n * selected AuthProvider decodes `metadata` and `values` with its own schemas.\n */\nexport const ProviderProfileFileSchema = Schema.StructWithRest(Schema.Struct({\n format: Schema.Literal(PROFILE_FORMAT),\n provider: Schema.String,\n metadata: ProfileMetadataSchema,\n values: ProviderConfigSchema,\n}), [Schema.Record(Schema.String, Schema.Unknown)]);\n/** Compose the base envelope with a custom provider's typed schemas. */\nexport const makeProviderProfileSchema = (provider, metadata, values) => Schema.Struct({\n format: Schema.Literal(PROFILE_FORMAT),\n provider: Schema.Literal(provider),\n metadata,\n values,\n});\n/** Only the released v0 centralized layout is migrated. */\nconst V0ManifestSchema = Schema.StructWithRest(Schema.Struct({\n version: Schema.Literal(0),\n profiles: Schema.Record(Schema.String, Schema.Unknown),\n}), [Schema.Record(Schema.String, Schema.Unknown)]);\nconst LEGACY_CREDENTIAL_KEYS = {\n AWS: \"aws-stored\",\n Axiom: \"axiom-stored\",\n Cloudflare: \"cloudflare-stored\",\n Fly: \"fly-stored\",\n GitHub: \"github-stored\",\n Hetzner: \"hetzner-stored\",\n Neon: \"neon-stored\",\n Planetscale: {\n stored: \"planetscale-stored\",\n oauth: \"planetscale-oauth\",\n },\n Prisma: \"prisma-stored\",\n Railway: {\n stored: \"railway-stored\",\n oauth: \"railway-oauth\",\n },\n};\nexport class ProfileError extends Schema.TaggedError()(\"ProfileError\", {\n message: Schema.String,\n cause: Schema.optional(Schema.Defect()),\n}) {\n [UserFacingError] = true;\n}\nexport class MissingProviderConfig extends Schema.TaggedError()(\"MissingProviderConfig\", {\n provider: Schema.String,\n profileName: Schema.String,\n message: Schema.String,\n}) {\n}\nexport const SuppressMissingProviderConfig = Context.Reference(\"Auth/SuppressMissingProviderConfig\", { defaultValue: () => false });\nconst emptyManifest = () => ({\n version: PROFILE_MANIFEST_VERSION,\n profiles: {\n [DEFAULT_PROFILE_NAME]: { id: DEFAULT_PROFILE_ID, providers: {} },\n },\n});\nexport const createProfileHint = (name) => Effect.map(profileCommandHint(`alchemy profile create ${name ?? \"<name>\"}`), (command) => `Run \\`${command}\\`.`);\nconst profileNotFound = Effect.fn(function* (name) {\n return new ProfileError({\n message: `Profile '${name}' does not exist. ${yield* createProfileHint(name)}`,\n });\n});\nexport const cannotDeleteDefaultProfile = () => new ProfileError({\n message: `Cannot delete the built-in '${DEFAULT_PROFILE_NAME}' profile.`,\n});\nexport const cannotRenameDefaultProfile = () => new ProfileError({\n message: `Cannot rename the built-in '${DEFAULT_PROFILE_NAME}' profile.`,\n});\nconst PROFILE_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;\nexport const validateProfileName = (name) => PROFILE_NAME_PATTERN.test(name)\n ? Effect.succeed(name)\n : Effect.fail(new ProfileError({\n message: `Invalid profile name '${name}'. Profile names must start with an ASCII letter or number, ` +\n \"contain only letters, numbers, '.', '_' or '-', and be at most 64 characters.\",\n }));\nconst validateProviderName = (name) => PROFILE_NAME_PATTERN.test(name)\n ? Effect.succeed(name)\n : Effect.fail(new ProfileError({\n message: `Invalid provider id '${name}'. Provider ids must be safe as filenames.`,\n }));\nexport class ProfileStore extends Context.Service()(\"Alchemy::ProfileStore\") {\n}\nexport const ProfileStoreLive = Layer.effect(ProfileStore, Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const pathService = yield* Path.Path;\n yield* fs.makeDirectory(profileDirPath(DEFAULT_PROFILE_NAME), {\n recursive: true,\n });\n yield* fs.chmod(profileDirPath(DEFAULT_PROFILE_NAME), 0o700);\n const provideLockServices = (effect) => effect.pipe(Effect.provideService(FileSystem.FileSystem, fs), Effect.provideService(Path.Path, pathService));\n const decodeJson = (file) => fs.readFileString(file).pipe(Effect.flatMap(Schema.decodeUnknownEffect(Schema.fromJsonString(Schema.Unknown))), Effect.mapError((cause) => new ProfileError({\n message: `Could not parse '${file}'.`,\n cause,\n })));\n const backupInvalidProfileFile = (file, reason) => provideLockServices(withLock(\"profiles-invalid\", Effect.gen(function* () {\n if (!(yield* fs.exists(file)))\n return undefined;\n const stamp = DateTime.formatIso(yield* DateTime.now)\n .replaceAll(\":\", \"-\")\n .replaceAll(\".\", \"-\");\n const backup = `${file}.invalid-${stamp}.bak`;\n yield* fs.rename(file, backup);\n yield* Effect.logWarning(`Invalid profile file '${file}' was backed up to '${backup}' and skipped.`, reason);\n return backup;\n })));\n const writeProviderFile = (profile, provider, values, previous) => Effect.gen(function* () {\n yield* validateProfileName(profile);\n yield* validateProviderName(provider);\n const dir = profileDirPath(profile);\n yield* fs.makeDirectory(dir, { recursive: true });\n yield* fs.chmod(dir, 0o700);\n const document = {\n format: PROFILE_FORMAT,\n provider,\n metadata: previous?.metadata ?? {},\n values,\n };\n yield* writeFileAtomic(fs, profileProviderFilePath(profile, provider), JSON.stringify(document, null, 2), 0o600);\n });\n const readLegacyProviderValues = (profile, provider, values) => Effect.gen(function* () {\n // Cloudflare's released OAuth grant is obsolete, but its stored API\n // token and global API key formats still map exactly to the new\n // provider-owned values schema.\n if (provider === \"Cloudflare\" && values.method !== \"stored\") {\n return { method: \"oauth\" };\n }\n const configuredKey = LEGACY_CREDENTIAL_KEYS[provider];\n const key = typeof configuredKey === \"string\"\n ? configuredKey\n : values.method === undefined\n ? undefined\n : configuredKey?.[values.method];\n if (key === undefined)\n return values;\n const candidates = [key];\n // The earliest GitHub sidecar used this shorter filename.\n if (provider === \"GitHub\")\n candidates.push(\"gh-stored\");\n // The earliest Cloudflare sidecar used this shorter filename.\n if (provider === \"Cloudflare\")\n candidates.push(\"cf-stored\");\n let credentialFile;\n for (const candidate of candidates) {\n const file = pathService.join(profileCredentialsDirPath(profile), `${candidate}.json`);\n if (yield* fs.exists(file)) {\n credentialFile = file;\n break;\n }\n }\n if (credentialFile === undefined) {\n return provider === \"Cloudflare\" ? {} : values;\n }\n const decoded = yield* Effect.result(decodeJson(credentialFile).pipe(Effect.flatMap(Schema.decodeUnknownEffect(ProviderConfigSchema))));\n if (Result.isFailure(decoded)) {\n yield* Effect.logWarning(`Could not decode legacy credentials from '${credentialFile}'; migrating the manifest values and preserving the sidecar in the v0 backup.`, decoded.failure);\n return provider === \"Cloudflare\" ? {} : values;\n }\n const credential = decoded.success;\n const { type: _type, ...inline } = credential;\n const normalizedInline = provider === \"Axiom\" && inline.apiToken !== undefined\n ? (({ apiToken, ...rest }) => ({ ...rest, token: apiToken }))(inline)\n : inline;\n const { storageKey: _storageKey, ...manifestValues } = values;\n const migrated = {\n ...manifestValues,\n ...normalizedInline,\n };\n if (provider !== \"Cloudflare\")\n return migrated;\n return migrated.credentialType === \"apiKey\" &&\n typeof migrated.apiKey === \"string\" &&\n typeof migrated.email === \"string\" &&\n typeof migrated.accountId === \"string\"\n ? migrated\n : migrated.credentialType === \"apiToken\" &&\n typeof migrated.apiToken === \"string\" &&\n typeof migrated.accountId === \"string\"\n ? migrated\n : {};\n });\n /** Expand the released v0 store and preserve every original file. */\n const migrateCentralManifest = provideLockServices(withLock(\"profiles-migrate\", Effect.gen(function* () {\n const legacy = configFilePath();\n if (!(yield* fs.exists(legacy)))\n return;\n const jsonResult = yield* Effect.result(decodeJson(legacy));\n if (Result.isFailure(jsonResult)) {\n yield* backupInvalidProfileFile(legacy, jsonResult.failure);\n return;\n }\n const header = Schema.decodeUnknownOption(Schema.Struct({ version: Schema.Number }))(jsonResult.success);\n // The short-lived centralized versions were never released and do\n // not need a compatibility path. Leave them untouched.\n if (Option.isSome(header) && header.value.version !== 0)\n return;\n const storedResult = yield* Effect.result(Schema.decodeUnknownEffect(V0ManifestSchema)(jsonResult.success));\n if (Result.isFailure(storedResult)) {\n yield* backupInvalidProfileFile(legacy, storedResult.failure);\n return;\n }\n const stored = storedResult.success;\n for (const [name, entry] of Object.entries(stored.profiles)) {\n const validName = yield* Effect.result(validateProfileName(name));\n if (Result.isFailure(validName)) {\n yield* Effect.logWarning(`Skipping invalid v0 profile name '${name}'. It remains available in the v0 backup.`);\n continue;\n }\n const providersResult = yield* Effect.result(Schema.decodeUnknownEffect(Schema.Record(Schema.String, Schema.Unknown))(entry));\n if (Result.isFailure(providersResult)) {\n yield* Effect.logWarning(`Skipping invalid v0 profile '${name}'. It remains available in the v0 backup.`, providersResult.failure);\n continue;\n }\n yield* fs.makeDirectory(profileDirPath(name), { recursive: true });\n yield* fs.chmod(profileDirPath(name), 0o700);\n for (const [provider, rawValues] of Object.entries(providersResult.success)) {\n const validProvider = yield* Effect.result(validateProviderName(provider));\n if (Result.isFailure(validProvider)) {\n yield* Effect.logWarning(`Skipping invalid v0 provider name '${provider}' in profile '${name}'. It remains available in the v0 backup.`);\n continue;\n }\n const valuesResult = yield* Effect.result(Schema.decodeUnknownEffect(ProviderConfigSchema)(rawValues));\n if (Result.isFailure(valuesResult)) {\n if (provider === \"Cloudflare\") {\n const target = profileProviderFilePath(name, provider);\n if (!(yield* fs.exists(target))) {\n yield* writeProviderFile(name, provider, {});\n }\n continue;\n }\n yield* Effect.logWarning(`Skipping invalid v0 provider '${provider}' in profile '${name}'. It remains available in the v0 backup.`, valuesResult.failure);\n continue;\n }\n const values = valuesResult.success;\n if (values.method === \"env\")\n continue;\n // Known legacy sidecars become inline provider values.\n const migratedValues = yield* readLegacyProviderValues(name, provider, values);\n const target = profileProviderFilePath(name, provider);\n if (!(yield* fs.exists(target))) {\n yield* writeProviderFile(name, provider, migratedValues);\n }\n }\n }\n const stamp = DateTime.formatIso(yield* DateTime.now)\n .replaceAll(\":\", \"-\")\n .replaceAll(\".\", \"-\");\n const backup = pathService.join(rootDir(), `.profiles-v0-${stamp}`);\n yield* fs.makeDirectory(backup, { recursive: true });\n yield* fs.chmod(backup, 0o700);\n yield* fs.rename(legacy, pathService.join(backup, \"profiles.json\"));\n const credentials = credentialsDirPath();\n if (yield* fs.exists(credentials)) {\n yield* fs.rename(credentials, pathService.join(backup, \"credentials\"));\n }\n })));\n const readProviderFile = (profile, file) => Effect.gen(function* () {\n const fullPath = pathService.join(profileDirPath(profile), file);\n const json = yield* decodeJson(fullPath);\n const document = yield* Schema.decodeUnknownEffect(ProviderProfileFileSchema)(json).pipe(Effect.mapError((cause) => new ProfileError({\n message: `Invalid provider profile at '${fullPath}'.`,\n cause,\n })));\n const filenameProvider = file.slice(0, -\".json\".length);\n if (document.provider.toLowerCase() !== filenameProvider) {\n return yield* Effect.fail(new ProfileError({\n message: `Provider '${document.provider}' in '${fullPath}' does not match lowercase filename '${filenameProvider}'.`,\n }));\n }\n return document;\n });\n const readManifest = Effect.gen(function* () {\n yield* migrateCentralManifest;\n const manifest = emptyManifest();\n const names = yield* fs\n .readDirectory(profilesDirPath())\n .pipe(Effect.catchReason(\"PlatformError\", \"NotFound\", () => Effect.succeed([])));\n for (const name of names) {\n if (!PROFILE_NAME_PATTERN.test(name))\n continue;\n const info = yield* fs.stat(profileDirPath(name));\n if (info.type !== \"Directory\")\n continue;\n const providers = {};\n const files = yield* fs.readDirectory(profileDirPath(name));\n for (const file of files.sort()) {\n if (!file.endsWith(\".json\"))\n continue;\n const read = yield* Effect.result(readProviderFile(name, file));\n if (Result.isFailure(read)) {\n yield* backupInvalidProfileFile(pathService.join(profileDirPath(name), file), read.failure);\n continue;\n }\n providers[read.success.provider] = read.success.values;\n }\n manifest.profiles[name] = { id: name, providers };\n }\n return manifest;\n });\n const getProfile = (name) => validateProfileName(name).pipe(Effect.flatMap(() => readManifest), Effect.map((manifest) => manifest.profiles[name]));\n const ensureProfile = (name) => getProfile(name).pipe(Effect.flatMap((profile) => profile === undefined\n ? Effect.flatMap(profileNotFound(name), Effect.fail)\n : Effect.succeed(profile)));\n const createProfile = (name) => validateProfileName(name).pipe(Effect.flatMap(() => provideLockServices(withLock(\"profiles\", Effect.gen(function* () {\n const existing = (yield* readManifest).profiles[name];\n if (existing !== undefined) {\n return yield* Effect.fail(new ProfileError({\n message: `Profile '${name}' already exists.`,\n }));\n }\n yield* fs.makeDirectory(profileDirPath(name), {\n recursive: true,\n });\n yield* fs.chmod(profileDirPath(name), 0o700);\n })))));\n const renameProfile = (name, newName) => Effect.gen(function* () {\n if (name === DEFAULT_PROFILE_NAME) {\n return yield* Effect.fail(cannotRenameDefaultProfile());\n }\n yield* validateProfileName(name);\n yield* validateProfileName(newName);\n yield* provideLockServices(withLock(\"profiles\", Effect.gen(function* () {\n const manifest = yield* readManifest;\n if (manifest.profiles[name] === undefined) {\n return yield* Effect.fail(new ProfileError({\n message: `Profile '${name}' does not exist.`,\n }));\n }\n if (manifest.profiles[newName] !== undefined) {\n return yield* Effect.fail(new ProfileError({\n message: `Profile '${newName}' already exists.`,\n }));\n }\n yield* fs.rename(profileDirPath(name), profileDirPath(newName));\n const oldCredentials = profileCredentialsDirPath(name);\n if (yield* fs.exists(oldCredentials)) {\n yield* fs.rename(oldCredentials, profileCredentialsDirPath(newName));\n }\n })));\n });\n const current = Effect.gen(function* () {\n const configured = yield* Config.option(ALCHEMY_PROFILE).pipe(Effect.mapError((cause) => new ProfileError({\n message: \"Could not resolve ALCHEMY_PROFILE.\",\n cause,\n })));\n if (Option.isSome(configured)) {\n return {\n name: yield* validateProfileName(configured.value),\n source: \"configuration\",\n };\n }\n return { name: DEFAULT_PROFILE_NAME, source: \"default\" };\n });\n const setProviderConfig = (profile, provider, values) => Effect.gen(function* () {\n yield* validateProfileName(profile);\n yield* validateProviderName(provider);\n yield* provideLockServices(withLock(\"profiles\", Effect.gen(function* () {\n if ((yield* readManifest).profiles[profile] === undefined) {\n return yield* Effect.flatMap(profileNotFound(profile), Effect.fail);\n }\n const file = profileProviderFilePath(profile, provider);\n let previous;\n if (yield* fs.exists(file)) {\n const read = yield* Effect.result(readProviderFile(profile, `${provider.toLowerCase()}.json`));\n if (Result.isFailure(read)) {\n yield* backupInvalidProfileFile(file, read.failure);\n }\n else {\n previous = read.success;\n }\n }\n yield* writeProviderFile(profile, provider, values, previous);\n })));\n });\n const deleteProviderConfig = (profile, provider) => Effect.gen(function* () {\n yield* validateProfileName(profile);\n yield* validateProviderName(provider);\n return yield* provideLockServices(withLock(\"profiles\", Effect.gen(function* () {\n const file = profileProviderFilePath(profile, provider);\n if (!(yield* fs.exists(file)))\n return false;\n yield* fs.remove(file);\n return true;\n })));\n });\n const deleteProfile = (name) => Effect.gen(function* () {\n yield* validateProfileName(name);\n if (name === DEFAULT_PROFILE_NAME) {\n return yield* Effect.fail(cannotDeleteDefaultProfile());\n }\n return yield* provideLockServices(withLock(\"profiles\", Effect.gen(function* () {\n const dir = profileDirPath(name);\n if (!(yield* fs.exists(dir)))\n return false;\n yield* fs.remove(dir, { recursive: true });\n const credentials = profileCredentialsDirPath(name);\n if (yield* fs.exists(credentials)) {\n yield* fs.remove(credentials, { recursive: true });\n }\n return true;\n })));\n });\n const loadProviderConfig = (auth, profileName) => Effect.gen(function* () {\n const existing = yield* ensureProfile(profileName);\n const stored = existing.providers[auth.name];\n if (stored !== undefined) {\n return yield* auth.decodeConfig(profileName, stored);\n }\n if (yield* SuppressMissingProviderConfig) {\n return yield* Effect.fail(new MissingProviderConfig({\n provider: auth.name,\n profileName,\n message: `Provider '${auth.name}' is not configured in profile '${profileName}'.`,\n }));\n }\n const command = yield* profileCommandHint(`alchemy profile edit --profile ${profileName} --add ${auth.name}`);\n return yield* Effect.fail(new AuthError({\n message: `Provider '${auth.name}' is not configured in profile '${profileName}'. Run \\`${command}\\`.`,\n }));\n });\n return {\n readManifest,\n getProfile,\n ensureProfile,\n createProfile,\n renameProfile,\n current,\n setProviderConfig,\n deleteProviderConfig,\n deleteProfile,\n loadProviderConfig,\n };\n}));\n/** The name of the currently selected profile. */\nexport const currentProfileName = ProfileStore.use((store) => store.current).pipe(Effect.map((selection) => selection.name));\n//# sourceMappingURL=Profile.js.map","import * as ConfigProvider from \"effect/ConfigProvider\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Option from \"effect/Option\";\nexport const loadConfigProvider = (envFile) => {\n if (Option.isSome(envFile)) {\n return ConfigProvider.fromDotEnv({ path: envFile.value }).pipe(Effect.map((dotEnv) => ConfigProvider.orElse(dotEnv, ConfigProvider.fromEnv())));\n }\n return Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const exists = yield* fs.exists(\".env\");\n if (!exists) {\n return ConfigProvider.fromEnv();\n }\n return ConfigProvider.orElse(ConfigProvider.fromEnv(), yield* ConfigProvider.fromDotEnv({ path: \".env\" }));\n });\n};\n//# sourceMappingURL=ConfigProvider.js.map","import * as Config from \"effect/Config\";\nimport * as ConfigProvider from \"effect/ConfigProvider\";\nimport * as Effect from \"effect/Effect\";\nimport * as Option from \"effect/Option\";\nimport { AuthError, getAuthProvider, presentEnvironment, } from \"./AuthProvider.js\";\nimport { ALCHEMY_PROFILE, DEFAULT_PROFILE_NAME, ProfileError, ProfileStore, SuppressMissingProviderConfig, } from \"./Profile.js\";\nimport { loadConfigProvider } from \"../Util/ConfigProvider.js\";\n/**\n * Resolve the selected Alchemy profile after the command's dotenv provider is\n * known. An omitted explicit override remains absent so it does not shadow\n * `ALCHEMY_PROFILE` from `.env` / `--env-file`.\n */\nexport const resolveProfileSelection = Effect.fn(function* (envFile, override) {\n const base = yield* loadConfigProvider(envFile);\n const profiles = yield* ProfileStore;\n const selected = yield* profiles.current.pipe(Effect.provideService(ConfigProvider.ConfigProvider, withProfileOverride(base, override)));\n return {\n ...selected,\n source: override === undefined ? selected.source : \"command-line\",\n };\n});\nexport const resolveProfileName = Effect.fn(function* (envFile, override) {\n return (yield* resolveProfileSelection(envFile, override)).name;\n});\n/**\n * The shared preamble of every per-cloud `fromAuthProvider` /\n * `fromEnvironment` layer. Precedence: environment credentials (process\n * environment plus `.env` / `--env-file`) whenever the provider's declared\n * contract is fully present — CI or not, selected profile or not — then, in\n * CI, the provider's environment resolution alone (profiles do not exist\n * there), otherwise the selected profile.\n */\nexport const resolveProviderConfig = (providerName) => Effect.gen(function* () {\n const auth = yield* getAuthProvider(providerName);\n if (auth.readEnvironment !== undefined) {\n const used = yield* presentEnvironment(auth.environment);\n if (used !== undefined) {\n if (!(yield* SuppressMissingProviderConfig)) {\n yield* auth.logEnvironmentCredentials(used);\n }\n return {\n auth,\n profileName: undefined,\n config: undefined,\n resolve: auth.readEnvironment,\n source: \"environment\",\n };\n }\n }\n const ci = yield* Config.Boolean(\"CI\").pipe(Config.withDefault(false));\n if (ci) {\n if (auth.readEnvironment === undefined) {\n return yield* Effect.fail(new AuthError({\n message: `Auth provider '${providerName}' does not support environment credentials in CI.`,\n }));\n }\n return {\n auth,\n profileName: undefined,\n config: undefined,\n resolve: auth.readEnvironment,\n source: \"environment\",\n };\n }\n const profile = yield* ProfileStore;\n const selection = yield* profile.current;\n const profileName = selection.name;\n const config = yield* profile.loadProviderConfig(auth, profileName);\n return {\n auth,\n profileName,\n config,\n resolve: auth.read(profileName, config, (updated) => profile.setProviderConfig(profileName, providerName, updated).pipe(Effect.mapError((cause) => new AuthError({\n message: `${providerName}: could not persist refreshed credentials for profile '${profileName}'.`,\n cause,\n })))),\n source: \"profile\",\n };\n});\n/** Let an explicit profile override configured selection without disturbing other keys. */\nexport const withProfileOverride = (base, profile) => {\n if (profile === undefined)\n return base;\n const overrides = { ALCHEMY_PROFILE: profile };\n const overrideProvider = ConfigProvider.make((path) => Effect.succeed(path.length === 1 && typeof path[0] === \"string\" && path[0] in overrides\n ? ConfigProvider.makeValue(overrides[path[0]])\n : undefined));\n return ConfigProvider.orElse(base)(overrideProvider);\n};\n//# sourceMappingURL=Resolve.js.map","import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as Schema from \"effect/Schema\";\nimport path from \"pathe\";\nimport { writeFileAtomic } from \"../Util/AtomicFile.js\";\nimport { profileCommandHint } from \"../Util/interactive.js\";\nimport { AuthError } from \"./AuthProvider.js\";\nimport { profileCredentialsDirPath } from \"./Paths.js\";\nimport { validateProfileName } from \"./Profile.js\";\nexport const credentialsFilePath = (profile, provider) => path.join(profileCredentialsDirPath(profile), `${provider}.json`);\nexport class CredentialsStore extends Context.Service()(\"Alchemy::CredentialsStore\") {\n}\nexport const CredentialsStoreLive = Layer.effect(CredentialsStore, Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const read = (profile, provider, schema) => Effect.gen(function* () {\n const filePath = yield* validateCredentialPath(profile, provider);\n const data = yield* fs.readFileString(filePath).pipe(Effect.catchReason(\"PlatformError\", \"NotFound\", () => Effect.succeed(undefined)), Effect.mapError((cause) => new AuthError({\n message: `Could not read credentials at '${filePath}'.`,\n cause,\n })));\n if (data === undefined)\n return undefined;\n const json = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(Schema.Unknown))(data).pipe(Effect.mapError((cause) => new AuthError({\n message: `Stored credentials at '${filePath}' contain invalid JSON.`,\n cause,\n })));\n const command = yield* profileCommandHint(`alchemy profile edit --profile ${profile} --reconfigure ${provider}`);\n return yield* Schema.decodeUnknownEffect(schema)(json).pipe(Effect.mapError((cause) => new AuthError({\n message: `Stored credentials at '${filePath}' do not match the expected shape. ` +\n `Run \\`${command}\\` to replace them.`,\n cause,\n })));\n });\n const write = (profile, provider, schema, credentials) => Effect.gen(function* () {\n const filePath = yield* validateCredentialPath(profile, provider);\n const encoded = yield* Schema.encodeEffect(schema)(credentials).pipe(Effect.mapError((cause) => new AuthError({\n message: `Credentials for '${provider}' do not match the declared schema.`,\n cause,\n })));\n yield* Effect.gen(function* () {\n const directory = path.dirname(filePath);\n yield* fs.makeDirectory(directory, { recursive: true });\n yield* fs.chmod(directory, 0o700);\n yield* writeFileAtomic(fs, filePath, JSON.stringify(encoded, null, 2), 0o600);\n }).pipe(Effect.mapError((cause) => new AuthError({\n message: `Could not write credentials at '${filePath}'.`,\n cause,\n })));\n });\n const remove_ = (profile, provider) => validateCredentialPath(profile, provider).pipe(Effect.flatMap((filePath) => fs.remove(filePath).pipe(Effect.catchReason(\"PlatformError\", \"NotFound\", () => Effect.void), Effect.mapError((cause) => new AuthError({\n message: `Could not delete credentials at '${filePath}'.`,\n cause,\n })))));\n const deleteProfile = (profile) => Effect.gen(function* () {\n yield* validateProfileName(profile).pipe(Effect.mapError((cause) => new AuthError({ message: cause.message, cause })));\n yield* fs\n .remove(profileCredentialsDirPath(profile), { recursive: true })\n .pipe(Effect.catchReason(\"PlatformError\", \"NotFound\", () => Effect.void), Effect.mapError((cause) => new AuthError({\n message: `Could not delete credentials for profile '${profile}'.`,\n cause,\n })));\n });\n return {\n read,\n write,\n delete: remove_,\n deleteProfile,\n };\n}));\nconst CREDENTIAL_KEY_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;\nconst validateCredentialPath = (profile, provider) => Effect.gen(function* () {\n yield* validateProfileName(profile).pipe(Effect.mapError((cause) => new AuthError({ message: cause.message, cause })));\n if (!CREDENTIAL_KEY_PATTERN.test(provider)) {\n return yield* new AuthError({\n message: `Invalid credential key '${provider}'.`,\n });\n }\n return credentialsFilePath(profile, provider);\n});\nexport function displayRedacted(r, visibleChars = 4) {\n const raw = Redacted.value(r);\n if (raw.length <= visibleChars)\n return \"****\";\n return `${raw.slice(0, visibleChars)}****`;\n}\n//# sourceMappingURL=Credentials.js.map","import * as Config from \"effect/Config\";\nimport * as Effect from \"effect/Effect\";\nimport * as Option from \"effect/Option\";\nimport * as Interaction from \"../Interaction.js\";\nimport { AuthError } from \"./AuthProvider.js\";\nexport const getEnv = (key) => Config.option(Config.String(key)).pipe(Effect.map(Option.getOrUndefined), Effect.mapError((cause) => new AuthError({\n message: `Could not read optional env: ${key}`,\n cause,\n})));\nexport const getEnvRequired = (key) => Config.String(key).pipe(Effect.mapError((cause) => new AuthError({ message: `Missing required env: ${key}`, cause })));\nexport const getEnvRedacted = (key) => Config.option(Config.Redacted(key)).pipe(Effect.map(Option.getOrUndefined), Effect.mapError((cause) => new AuthError({\n message: `Could not read optional env: ${key}`,\n cause,\n})));\nexport const getEnvRedactedRequired = (key) => Config.Redacted(key).pipe(Effect.mapError((cause) => new AuthError({ message: `Missing required env: ${key}`, cause })));\nexport const mapPromptCancellation = (self) => self.pipe(Effect.mapError((cause) => new AuthError({\n message: cause._tag === \"TerminalCancelled\"\n ? \"User cancelled prompt\"\n : cause.message,\n cause,\n})));\n//# sourceMappingURL=Env.js.map","import * as Effect from \"effect/Effect\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as Schema from \"effect/Schema\";\nimport * as Interaction from \"../Interaction.js\";\nimport { AuthError, AuthProviderLayer, } from \"./AuthProvider.js\";\nimport { displayRedacted } from \"./Credentials.js\";\nimport { mapPromptCancellation } from \"./Env.js\";\n/** Reveal a collected value only at a validation or I/O boundary. */\nexport const storedValueText = (value) => value === undefined\n ? undefined\n : Redacted.isRedacted(value)\n ? Redacted.value(value)\n : value;\n/** Preserve or introduce redaction for a collected secret. */\nexport const storedSecret = (value) => value === undefined\n ? undefined\n : Redacted.isRedacted(value)\n ? value\n : Redacted.make(value);\n/**\n * Validate flag-provided values against the field specs: unknown keys,\n * missing required fields, and per-field validators all fail with an\n * actionable {@link AuthError}.\n */\nexport const validateFieldValues = (provider, fields, values) => Effect.gen(function* () {\n const known = new Set(fields.map((field) => field.name));\n for (const key of Object.keys(values)) {\n if (!known.has(key)) {\n return yield* Effect.fail(new AuthError({\n message: `${provider}: unknown field '${key}'. ` +\n `Valid fields: ${[...known].join(\", \")}.`,\n }));\n }\n }\n const collected = {};\n for (const field of fields) {\n const raw = values[field.name] ?? field.defaultValue;\n if (raw === undefined || raw.length === 0) {\n if (field.optional)\n continue;\n return yield* Effect.fail(new AuthError({\n message: `${provider}: missing required field '${field.name}' (${field.label}). Pass it with --set ${field.name}=<value>.`,\n }));\n }\n const invalid = field.validate?.(raw);\n if (invalid !== undefined) {\n return yield* Effect.fail(new AuthError({\n message: `${provider}: invalid '${field.name}': ${invalid}`,\n }));\n }\n collected[field.name] = field.secret ? Redacted.make(raw) : raw;\n }\n return collected;\n});\n/**\n * Prompt for each field in order (secret fields masked, optional fields\n * skippable with an empty answer). Shared by the factory's interactive\n * `configure` and by hand-rolled multi-method providers that want the same\n * behavior for their token method.\n */\nexport const collectFieldValues = (fields) => Effect.gen(function* () {\n const interaction = yield* Interaction.Interaction;\n const values = {};\n for (const field of fields) {\n const description = [\n field.description,\n field.optional ? \"Optional — press Enter to skip.\" : undefined,\n ]\n .filter((part) => part !== undefined)\n .join(\" \");\n const validate = (value) => {\n if (value.length === 0)\n return field.optional ? undefined : \"Required\";\n return field.validate?.(value);\n };\n const request = field.secret\n ? interaction.prompt.password({\n message: field.label,\n description: description || undefined,\n placeholder: field.placeholder,\n validate,\n })\n : interaction.prompt.text({\n message: field.label,\n description: description || undefined,\n placeholder: field.placeholder,\n defaultValue: field.defaultValue,\n validate,\n });\n const answer = yield* request.pipe(mapPromptCancellation);\n if (answer.length === 0 && field.optional)\n continue;\n values[field.name] = field.secret ? Redacted.make(answer) : answer;\n }\n return values;\n});\n/**\n * Build a registration Layer (plus the derived inline-values schema)\n * for a single-method stored-credential provider.\n *\n * ```ts\n * export const { layer: NeonAuth, storedSchema: NeonStoredCredentials } =\n * makeStoredAuthProvider({\n * provider: \"Neon\",\n * fields: [{ name: \"apiKey\", label: \"Neon API Key\", secret: true }],\n * toResolved: (values, source) => ({ ... }),\n * readEnvironment: ...,\n * environment: [...],\n * });\n * ```\n */\nexport const makeStoredAuthProvider = (config) => {\n const { provider, fields } = config;\n const fieldSchemas = Object.fromEntries(fields.map((field) => [\n field.name,\n field.optional ? Schema.optional(Schema.String) : Schema.String,\n ]));\n const storedSchema = Schema.Struct(fieldSchemas);\n const configSchema = Schema.Struct({\n method: Schema.Literal(\"stored\"),\n ...fieldSchemas,\n });\n const layer = AuthProviderLayer()(provider, Effect.gen(function* () {\n const interaction = Interaction.accessors;\n const persist = (_profileName, values) => Effect.gen(function* () {\n const complete = config.complete?.(values) ?? Effect.succeed(values);\n const completed = yield* complete;\n yield* interaction.output.success(`${provider}: credentials saved.`);\n return {\n method: \"stored\",\n ...Object.fromEntries(Object.entries(completed).map(([key, value]) => [\n key,\n storedValueText(value),\n ])),\n };\n });\n const configure = (profileName) => collectFieldValues(fields).pipe(Effect.flatMap((values) => persist(profileName, values)));\n const configureWith = (profileName, input) => input.method === \"stored\"\n ? validateFieldValues(provider, fields, input.values).pipe(Effect.flatMap((values) => persist(profileName, values)))\n : Effect.fail(new AuthError({\n message: `${provider}: unknown method '${input.method}'. Valid methods: stored.`,\n }));\n const read = (_profileName, values) => Effect.succeed(config.toResolved(values, \"stored\"));\n const login = (_profileName, values) => Effect.succeed(values);\n const logout = (_profileName, _config) => Effect.void;\n const details = (_profileName, values) => Effect.succeed({\n lines: fields.flatMap((field) => {\n const value = values[field.name];\n if (value === undefined)\n return [];\n return [\n {\n key: field.name,\n value: field.secret\n ? displayRedacted(storedSecret(value) ?? Redacted.make(\"\"))\n : (storedValueText(value) ?? \"\"),\n },\n ];\n }),\n });\n const configureMethods = [\n { method: \"stored\", fields },\n ];\n return {\n configSchema,\n configure,\n configureWith,\n configureMethods,\n login,\n logout,\n details,\n read,\n readEnvironment: config.readEnvironment,\n environment: config.environment,\n };\n }));\n return { layer, storedSchema };\n};\n//# sourceMappingURL=StoredAuthProvider.js.map","import * as Config from \"effect/Config\";\nimport * as Context from \"effect/Context\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport { resolveProviderConfig } from \"../Auth/Resolve.js\";\nimport { AWS_AUTH_PROVIDER_NAME, LOCAL_ACCOUNT_ID, } from \"./AuthProvider.js\";\nexport const AWS_PROFILE = Config.String(\"AWS_PROFILE\").pipe(Config.withDefault(\"default\"));\nexport const AWS_REGION = Config.String(\"AWS_REGION\");\nexport const AWS_ACCOUNT_ID = Config.String(\"AWS_ACCOUNT_ID\");\nexport const AWS_ACCESS_KEY_ID = Config.String(\"AWS_ACCESS_KEY_ID\");\nexport const AWS_SECRET_ACCESS_KEY = Config.Redacted(\"AWS_SECRET_ACCESS_KEY\");\nexport const AWS_SESSION_TOKEN = Config.Redacted(\"AWS_SESSION_TOKEN\");\nexport class FailedToGetAccount extends Data.TaggedError(\"AWS::Environment::FailedToGetAccount\") {\n}\nexport class AWSEnvironment extends Context.Service()(\"AWS::Environment\") {\n static current = AWSEnvironment.use((env) => env);\n /**\n * Whether this environment is the floci emulator\n * (dummy account {@link LOCAL_ACCOUNT_ID}). A set `endpoint` is not\n * enough: `AWS_ENDPOINT_URL` and explicit endpoint overrides also\n * populate it on real-account credentials.\n */\n static isLocalEmulator = Effect.map(AWSEnvironment.current, (env) => env.accountId === LOCAL_ACCOUNT_ID);\n kind = \"Environment\";\n}\n/** @see {@link AWSEnvironment.isLocalEmulator} */\nexport const isLocalEmulator = AWSEnvironment.isLocalEmulator;\nexport const Default = Layer.effect(AWSEnvironment, Effect.gen(function* () {\n // Provider layers are built on every run — before any profile may be\n // configured — so nothing may resolve at construction. A dev run with\n // zero AWS credentials builds this layer too (the ambient environment\n // is the emulator; only `Alchemy.remote()` rows ever need it), so the\n // profile/CI precedence is captured here and evaluated on first use,\n // exactly once.\n const resolve = resolveProviderConfig(AWS_AUTH_PROVIDER_NAME).pipe(Effect.flatMap(({ resolve }) => resolve));\n const context = yield* Effect.context();\n return yield* resolve.pipe(Effect.provideContext(context), Effect.orDie, Effect.cached);\n})).pipe(Layer.orDie);\n//# sourceMappingURL=Environment.js.map","import { Endpoint } from \"@distilled.cloud/aws\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport { AWSEnvironment } from \"./Environment.js\";\nexport const of = (endpoint) => Layer.succeed(Endpoint.Endpoint, Effect.succeed(endpoint));\n/**\n * Derive a custom endpoint (if any) from the surrounding\n * {@link AWSEnvironment}. If the environment has no `endpoint` set, this\n * Layer is empty (the SDK uses its default endpoint resolver).\n */\nexport const fromEnvironment = Layer.effect(Endpoint.Endpoint, Effect.gen(function* () {\n return Effect.map(yield* AWSEnvironment, (env) => env.endpoint ?? undefined);\n}));\n/**\n * Explicitly \"no custom endpoint\" — the SDK falls back to its default\n * endpoint resolver.\n *\n * Use this (never `Layer.empty`) when an AWS call is made from *inside*\n * the construction of {@link AWSEnvironment}: leaving `Endpoint`\n * unprovided lets the call fall through to {@link fromEnvironment},\n * whose service Effect re-enters the in-flight `AWSEnvironment` cache and\n * deadlocks the fiber with no I/O and no timer pending.\n */\nexport const none = Layer.succeed(Endpoint.Endpoint, Effect.succeed(undefined));\n//# sourceMappingURL=Endpoint.js.map","import * as Region from \"@distilled.cloud/aws/Region\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport { AWSEnvironment } from \"./Environment.js\";\nexport { AWS_REGION } from \"./Environment.js\";\nexport { Region } from \"@distilled.cloud/aws/Region\";\nexport const of = (region) => Layer.succeed(Region.Region, Effect.succeed(region));\nexport const fromEnvOrElse = (region) => Layer.succeed(Region.Region, Effect.succeed(process.env.AWS_REGION ?? region));\n// Deferred with `Effect.suspend` so it does not dereference `AWSEnvironment`\n// during module evaluation. `Region.ts` and `Environment.ts` are part of an\n// import cycle (AuthProvider → Region → Environment → AuthProvider); touching\n// `AWSEnvironment` eagerly at top level hits a temporal-dead-zone error when\n// this module is evaluated mid-cycle.\nexport const CurrentRegion = Effect.suspend(() => AWSEnvironment.use((env) => Effect.flatMap(env, ({ region }) => Effect.succeed(region))));\n/**\n * Derive the AWS region from the surrounding {@link AWSEnvironment}.\n */\nexport const fromEnvironment = Layer.effect(Region.Region, Effect.gen(function* () {\n const env = yield* AWSEnvironment;\n return Effect.map(env, (env) => env.region);\n}));\n//# sourceMappingURL=Region.js.map","import * as Floci from \"@alchemy.run/floci\";\nimport * as DistilledAuth from \"@distilled.cloud/aws/Auth\";\nimport { Credentials, ExpiredSSOToken, InvalidSSOToken, } from \"@distilled.cloud/aws/Credentials\";\nimport * as STS from \"@distilled.cloud/aws/sts\";\nimport * as EffectConsole from \"effect/Console\";\nimport * as Deferred from \"effect/Deferred\";\nimport * as Effect from \"effect/Effect\";\nimport * as Fiber from \"effect/Fiber\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Match from \"effect/Match\";\nimport * as Option from \"effect/Option\";\nimport * as Path from \"effect/Path\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as Ref from \"effect/Ref\";\nimport * as Schema from \"effect/Schema\";\nimport * as Stream from \"effect/Stream\";\nimport { ChildProcess } from \"effect/unstable/process\";\nimport * as NodeCrypto from \"node:crypto\";\nimport * as NodeOs from \"node:os\";\nimport { AuthError, AuthProviderLayer, NeedsReauth, reconfigureHint, refreshHint, } from \"../Auth/AuthProvider.js\";\nimport { displayRedacted } from \"../Auth/Credentials.js\";\nimport { getEnv, getEnvRedacted, getEnvRedactedRequired, getEnvRequired, mapPromptCancellation, } from \"../Auth/Env.js\";\nimport { storedSecret, storedValueText, validateFieldValues, } from \"../Auth/StoredAuthProvider.js\";\nimport * as Interaction from \"../Interaction.js\";\nimport * as Endpoint from \"./Endpoint.js\";\nimport * as Region from \"./Region.js\";\nexport const AWS_AUTH_PROVIDER_NAME = \"AWS\";\nexport const DEFAULT_LOCAL_ENDPOINT = `http://localhost:${Floci.DEFAULT_FLOCI_PORT}`;\n/**\n * Dummy account stamped on every floci environment.\n * A custom `AWS_ENDPOINT_URL` on env/sso credentials does NOT use this —\n * those keep the real account from STS / `AWS_ACCOUNT_ID`.\n */\nexport const LOCAL_ACCOUNT_ID = \"000000000000\";\n/**\n * distilled's SSO credential loader `Console.log`s its expired-token\n * diagnostic in addition to failing with the typed `ExpiredSSOToken`. The\n * typed error already carries the same message (and the profile UI surfaces\n * it as a reauth diagnostic), so the raw console write only smears over the\n * Interaction renderer. Provide this no-op Console on every distilled\n * `loadProfileCredentials` call so distilled has nowhere to print.\n */\nconst noop = () => { };\nexport const silentConsole = {\n assert: noop,\n clear: noop,\n count: noop,\n countReset: noop,\n debug: noop,\n dir: noop,\n dirxml: noop,\n error: noop,\n group: noop,\n groupCollapsed: noop,\n groupEnd: noop,\n info: noop,\n log: noop,\n table: noop,\n time: noop,\n timeEnd: noop,\n timeLog: noop,\n trace: noop,\n warn: noop,\n};\n/** Typed values stored in an AWS provider profile document. */\nexport const AwsAuthConfigSchema = Schema.Union([\n Schema.Struct({\n method: Schema.Literal(\"sso\"),\n ssoProfile: Schema.String,\n authorizationMethod: Schema.optional(Schema.Union([Schema.Literal(\"oauth\"), Schema.Literal(\"device\")])),\n }),\n Schema.Struct({\n method: Schema.Literal(\"stored\"),\n accountId: Schema.optional(Schema.String),\n accessKeyId: Schema.String,\n secretAccessKey: Schema.String,\n sessionToken: Schema.optional(Schema.String),\n region: Schema.String,\n }),\n]);\nconst options = [\n {\n value: \"sso\",\n label: \"SSO\",\n description: \"sign in with an AWS IAM Identity Center profile\",\n },\n {\n value: \"stored\",\n label: \"Access Keys\",\n description: \"enter an access key and secret directly\",\n },\n];\n/** `--set` fields for `--method stored` (static access keys, persisted). */\nconst keysFields = [\n { name: \"accessKeyId\", label: \"AWS Access Key ID\" },\n { name: \"secretAccessKey\", label: \"AWS Secret Access Key\", secret: true },\n {\n name: \"sessionToken\",\n label: \"AWS Session Token\",\n secret: true,\n optional: true,\n },\n { name: \"region\", label: \"AWS Region\", placeholder: \"us-east-1\" },\n];\n/** `--set` fields for `--method sso` (nothing persisted; profile validated). */\nconst ssoFields = [\n { name: \"ssoProfile\", label: \"AWS profile name (from ~/.aws/config)\" },\n];\nconst configureMethods = [\n { method: \"stored\", fields: keysFields },\n { method: \"sso\", fields: ssoFields },\n];\n/**\n * An explicitly-set `AWS_REGION` env var wins over the region recorded in an\n * SSO profile (`~/.aws/config`) or in stored credentials. `AWS_DEFAULT_REGION`\n * deliberately does NOT override — it is a *default* for when no region is\n * configured anywhere, and the profile's region is explicit configuration.\n */\nexport const applyEnvRegionOverride = (creds) => getEnv(\"AWS_REGION\").pipe(Effect.map((envRegion) => envRegion ? { ...creds, region: envRegion } : creds));\n/**\n * Layer that registers the AWS {@link AuthProvider} into the\n * {@link AuthProviders} registry when built. Include this in the AWS\n * `providers()` layer so the alchemy CLI can discover it.\n */\nexport const AwsAuth = AuthProviderLayer()(AWS_AUTH_PROVIDER_NAME, Effect.gen(function* () {\n const interaction = Interaction.accessors;\n const getAccountId = ({ accessKeyId, secretAccessKey, sessionToken, region, }) => STS.getCallerIdentity({}).pipe(Effect.provide(Layer.mergeAll(Layer.succeed(Credentials, Effect.succeed({\n accessKeyId,\n secretAccessKey,\n sessionToken,\n region,\n })), \n // Provide Region directly from the resolved inputs. Relying on the\n // ambient Region provider (Region.fromEnvironment) here would\n // deadlock: it derives the region from AWSEnvironment, which is the\n // very service still being constructed by this STS call.\n Region.of(region), \n // Provide `Endpoint.none` rather than leaving it unset: falling\n // through to the ambient `Endpoint.fromEnvironment` reads it off\n // AWSEnvironment — the very service this STS call is\n // constructing — and deadlocks the fiber on its own in-flight\n // cache (no I/O, no timer, no output). Same reason as\n // `Region.of` above.\n Endpoint.none)), Effect.flatMap((self) => self.Account\n ? Effect.succeed(self.Account)\n : Effect.die(new Error(\"No account ID found\"))));\n const loginStored = Effect.fn(function* (profileName) {\n const accessKeyId = yield* interaction.prompt\n .text({\n message: \"AWS Access Key ID\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n })\n .pipe(mapPromptCancellation);\n const secretAccessKey = yield* interaction.prompt\n .password({\n message: \"AWS Secret Access Key\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n })\n .pipe(mapPromptCancellation);\n const sessionToken = yield* interaction.prompt\n .password({\n message: \"AWS Session Token (optional; press Enter to skip)\",\n placeholder: \"(none)\",\n })\n .pipe(mapPromptCancellation);\n const region = yield* interaction.prompt\n .text({\n message: \"AWS Region\",\n placeholder: \"us-east-1\",\n defaultValue: \"us-east-1\",\n })\n .pipe(mapPromptCancellation);\n const accountId = yield* getAccountId({\n accessKeyId: Redacted.make(accessKeyId),\n secretAccessKey: Redacted.make(secretAccessKey),\n sessionToken: sessionToken ? Redacted.make(sessionToken) : undefined,\n region,\n });\n yield* interaction.output.success(\"AWS credentials saved.\");\n return {\n method: \"stored\",\n accountId,\n accessKeyId,\n secretAccessKey,\n sessionToken: sessionToken || undefined,\n region,\n };\n });\n const configureInteractive = (profileName) => interaction.prompt\n .select({\n message: \"AWS authentication method\",\n options,\n })\n .pipe(Effect.flatMap((method) => Match.value(method).pipe(Match.when(\"sso\", () => Effect.gen(function* () {\n const ssoProfile = yield* interaction.prompt.text({\n message: \"AWS profile name (from ~/.aws/config)\",\n placeholder: \"default\",\n defaultValue: \"default\",\n });\n const authorizationMethod = yield* interaction.prompt.select({\n message: \"AWS SSO authorization method\",\n options: [\n {\n value: \"oauth\",\n label: \"Browser OAuth\",\n description: \"authorize in this device's browser\",\n },\n {\n value: \"device\",\n label: \"Device code\",\n description: \"authorize with a short code on any device\",\n },\n ],\n });\n const config = {\n method: \"sso\",\n ssoProfile: ssoProfile ?? \"default\",\n authorizationMethod,\n };\n yield* loginSSO(config, authorizationMethod);\n return config;\n })), Match.when(\"stored\", () => loginStored(profileName)), Match.exhaustive)));\n // The declared requirements are the union of the interactive path\n // (ChildProcessSpawner for `aws sso login`) and `configureWith`'s\n // (FileSystem/Path for ~/.aws/config probing) — the contract shares one\n // ConfigureReq type parameter between the two entry points.\n const configureCredentials = (profileName) => configureInteractive(profileName).pipe(Effect.mapError((e) => e instanceof AuthError\n ? e\n : new AuthError({\n message: \"failed to configure credentials\",\n cause: e,\n })));\n const configureWith = (profileName, input) => Match.value(input.method).pipe(Match.when(\"stored\", () => Effect.gen(function* () {\n const values = yield* validateFieldValues(AWS_AUTH_PROVIDER_NAME, keysFields, input.values);\n // validateFieldValues guarantees the required fields are present.\n const accessKeyId = storedSecret(values.accessKeyId);\n const secretAccessKey = storedSecret(values.secretAccessKey);\n const sessionToken = storedSecret(values.sessionToken);\n const region = storedValueText(values.region) ?? \"\";\n if (accessKeyId === undefined || secretAccessKey === undefined) {\n return yield* Effect.fail(new AuthError({\n message: \"AWS: required key fields are missing.\",\n }));\n }\n const accountId = yield* getAccountId({\n accessKeyId,\n secretAccessKey,\n sessionToken,\n region,\n }).pipe(Effect.mapError((cause) => new AuthError({\n message: \"AWS: failed to verify credentials via STS GetCallerIdentity.\",\n cause,\n })));\n return {\n method: \"stored\",\n accountId,\n accessKeyId: Redacted.value(accessKeyId),\n secretAccessKey: Redacted.value(secretAccessKey),\n sessionToken: sessionToken === undefined\n ? undefined\n : Redacted.value(sessionToken),\n region,\n };\n })), Match.when(\"sso\", () => Effect.gen(function* () {\n const values = yield* validateFieldValues(AWS_AUTH_PROVIDER_NAME, ssoFields, input.values);\n const ssoProfile = storedValueText(values.ssoProfile) ?? \"\";\n const auth = yield* DistilledAuth.Default;\n const profile = yield* auth\n .loadProfile(ssoProfile)\n .pipe(Effect.catch(() => Effect.succeed(undefined)));\n if (profile == null) {\n return yield* Effect.fail(new AuthError({\n message: `AWS SSO profile '${ssoProfile}' was not found in ~/.aws/config. Configure it with \\`aws configure sso\\` first, then log in. ${refreshHint(AWS_AUTH_PROVIDER_NAME, profileName)}`,\n }));\n }\n // Nothing is persisted for SSO — credentials come from the AWS\n // SSO cache. `aws sso login` is interactive, so it is NOT run\n // here; the user runs `alchemy profile refresh` afterwards.\n return { method: \"sso\", ssoProfile };\n })), Match.orElse(() => Effect.fail(new AuthError({\n message: `AWS: unknown method '${input.method}'. Valid methods: stored, sso.`,\n }))));\n const resolveCredentials = (profileName, config, updateConfig) => Effect.gen(function* () {\n const reauth = refreshHint(AWS_AUTH_PROVIDER_NAME, profileName);\n return yield* Match.value(config)\n .pipe(Match.when({ method: \"stored\" }, (config) => Effect.gen(function* () {\n const credentials = {\n accessKeyId: Redacted.make(config.accessKeyId),\n secretAccessKey: Redacted.make(config.secretAccessKey),\n sessionToken: config.sessionToken === undefined\n ? undefined\n : Redacted.make(config.sessionToken),\n region: config.region,\n };\n const accountId = config.accountId ?? (yield* getAccountId(credentials));\n if (config.accountId === undefined &&\n updateConfig !== undefined) {\n yield* updateConfig({ ...config, accountId });\n }\n return {\n accountId,\n credentials: Effect.succeed(credentials),\n region: config.region,\n source: { type: \"stored\" },\n };\n })), Match.when({ method: \"sso\" }, (config) => Effect.gen(function* () {\n const auth = yield* DistilledAuth.Default;\n const profile = yield* auth\n .loadProfile(config.ssoProfile)\n .pipe(Effect.catch(() => Effect.succeed(undefined)));\n if (profile?.sso_account_id == null) {\n const reconfigure = reconfigureHint(AWS_AUTH_PROVIDER_NAME, profileName);\n return yield* Effect.fail(new AuthError({\n message: profile == null\n ? `AWS SSO profile '${config.ssoProfile}' was not found in ~/.aws/config. Configure it with \\`aws configure sso\\`. ${reconfigure}`\n : `AWS SSO profile '${config.ssoProfile}' has no sso_account_id in ~/.aws/config. Add it. ${reconfigure}`,\n }));\n }\n // `applyEnvRegionOverride` below only overrides an existing\n // region, so an env-provided region must be consulted here for\n // profiles that don't record one.\n const region = profile.region ?? (yield* getEnv(\"AWS_REGION\"));\n if (!region) {\n return yield* Effect.fail(new AuthError({\n message: `AWS SSO profile '${config.ssoProfile}' has no region in ~/.aws/config and AWS_REGION is not set.`,\n }));\n }\n return {\n accountId: profile.sso_account_id,\n // Rewrite the message of an expired/invalid SSO token to the\n // alchemy refresh hint, but PRESERVE the error tags: the inner\n // effect must stay a `CredentialsError` for downstream\n // consumers (AWSEnvironment), while `details` and other\n // in-provider consumers match these tags to surface a typed\n // `NeedsReauth` instead of a generic failure.\n credentials: auth\n .loadProfileCredentials(config.ssoProfile)\n .pipe(Effect.provideService(EffectConsole.Console, silentConsole), Effect.mapError((error) => {\n if (error._tag === \"Alchemy::AWS::ExpiredSSOToken\") {\n return new ExpiredSSOToken({\n message: `AWS SSO credentials need to be refreshed. ${reauth}`,\n profile: error.profile,\n });\n }\n if (error._tag === \"Alchemy::AWS::InvalidSSOToken\") {\n return new InvalidSSOToken({\n message: `AWS SSO credentials need to be refreshed. ${reauth}`,\n sso_session: error.sso_session,\n });\n }\n return error;\n })),\n region,\n source: { type: \"sso\", details: config.ssoProfile },\n };\n })), Match.exhaustive)\n .pipe(\n // Pass diagnosable failures through untouched: NeedsReauth (stored\n // credentials missing) and the specific AuthErrors raised above\n // (missing SSO profile / sso_account_id / region) carry the real\n // diagnosis. Only genuinely unexpected failures (store I/O, the\n // STS accountId backfill) get wrapped.\n Effect.mapError((e) => e._tag === \"AuthError\"\n ? e\n : new AuthError({\n message: \"failed to resolve AWS credentials\",\n cause: e,\n })), Effect.flatMap(applyEnvRegionOverride), Effect.map((creds) => ({\n ...creds,\n credentials: creds.credentials.pipe(Effect.map((credentials) => ({\n ...credentials,\n region: creds.region,\n }))),\n })));\n });\n const details = (profileName, config, updateConfig) => Effect.gen(function* () {\n const creds = yield* resolveCredentials(profileName, config, updateConfig);\n const reauth = refreshHint(AWS_AUTH_PROVIDER_NAME, profileName);\n // Resolve the live credentials. An expired/invalid SSO token only\n // surfaces here (the inner effect is lazy), so convert those tags\n // into a typed NeedsReauth instead of a generic error line.\n const { accessKeyId, secretAccessKey, sessionToken } = yield* creds.credentials.pipe(Effect.mapError((error) => error._tag === \"Alchemy::AWS::ExpiredSSOToken\" ||\n error._tag === \"Alchemy::AWS::InvalidSSOToken\"\n ? new NeedsReauth({\n provider: AWS_AUTH_PROVIDER_NAME,\n profile: profileName,\n message: `AWS SSO credentials need to be refreshed. ${reauth}`,\n cause: error,\n })\n : new AuthError({\n message: \"failed to load AWS credentials\",\n cause: error,\n })));\n const lines = [\n { key: \"accessKeyId\", value: displayRedacted(accessKeyId) },\n { key: \"secretAccessKey\", value: displayRedacted(secretAccessKey) },\n ];\n if (sessionToken) {\n lines.push({\n key: \"sessionToken\",\n value: displayRedacted(sessionToken),\n });\n }\n if (creds.region) {\n lines.push({ key: \"region\", value: creds.region });\n }\n const source = creds.source;\n lines.push({\n key: \"source\",\n value: \"details\" in source\n ? `${source.type} - ${source.details}`\n : source.type,\n });\n return { lines };\n });\n const logout = (_profileName, config) => Match.value(config).pipe(Match.when({ method: \"sso\" }, (config) => interaction.output\n .info(`AWS: running 'aws sso logout --profile ${config.ssoProfile}'...`)\n .pipe(Effect.zip(runSsoCommand(\"logout\", config.ssoProfile)), Effect.zip(clearDistilledSsoCache(config.ssoProfile)), Effect.match({\n onSuccess: () => interaction.output.success(\"AWS: SSO logout complete\"),\n onFailure: (e) => interaction.output.warning(`AWS: SSO logout failed: \\`${e.message}\\``),\n }))), Match.when({ method: \"stored\" }, () => Effect.void), Match.exhaustive);\n const login = (profileName, config) => Match.value(config)\n .pipe(Match.when({ method: \"sso\" }, (config) => loginSSO(config, config.authorizationMethod ?? \"oauth\")), Match.when({ method: \"stored\" }, (config) => Effect.succeed(config)), Match.exhaustive)\n .pipe(Effect.mapError((e) => new AuthError({ message: \"login failed\", cause: e })));\n const readEnvironment = Effect.gen(function* () {\n const accessKeyId = yield* getEnvRedactedRequired(\"AWS_ACCESS_KEY_ID\");\n const secretAccessKey = yield* getEnvRedactedRequired(\"AWS_SECRET_ACCESS_KEY\");\n const sessionToken = yield* getEnvRedacted(\"AWS_SESSION_TOKEN\");\n const region = yield* getEnv(\"AWS_REGION\").pipe(Effect.flatMap((value) => value ? Effect.succeed(value) : getEnv(\"AWS_DEFAULT_REGION\")));\n if (!region) {\n return yield* new AuthError({\n message: \"AWS CI region not found. Set AWS_REGION or AWS_DEFAULT_REGION.\",\n });\n }\n const accountId = yield* getEnvRequired(\"AWS_ACCOUNT_ID\").pipe(Effect.catch(() => getAccountId({\n accessKeyId,\n secretAccessKey,\n sessionToken,\n region,\n })));\n return {\n accountId,\n credentials: Effect.succeed({\n accessKeyId,\n secretAccessKey,\n sessionToken,\n region,\n }),\n region,\n source: { type: \"env\" },\n };\n }).pipe(Effect.mapError((cause) => cause instanceof AuthError\n ? cause\n : new AuthError({\n message: \"Failed to resolve AWS credentials from the CI environment.\",\n cause,\n })));\n return {\n configSchema: AwsAuthConfigSchema,\n configure: configureCredentials,\n configureWith,\n configureMethods,\n login,\n logout,\n details,\n read: resolveCredentials,\n readEnvironment,\n environment: [\n {\n name: \"AWS_ACCESS_KEY_ID\",\n required: true,\n secret: true,\n },\n {\n name: \"AWS_SECRET_ACCESS_KEY\",\n required: true,\n secret: true,\n },\n {\n name: \"AWS_SESSION_TOKEN\",\n required: false,\n secret: true,\n description: \"Required when the access key is a temporary STS key.\",\n },\n {\n name: \"AWS_REGION\",\n required: true,\n alternatives: [\"AWS_DEFAULT_REGION\"],\n description: \"Region the stack deploys into.\",\n },\n {\n name: \"AWS_ACCOUNT_ID\",\n required: false,\n description: \"Derived via STS GetCallerIdentity when unset.\",\n },\n ],\n };\n}));\nconst runSsoCommand = (command, ssoProfile) => Effect.gen(function* () {\n const handle = yield* ChildProcess.make(\"aws\", [\"sso\", command, \"--profile\", ssoProfile], {\n shell: false,\n stdin: \"inherit\",\n stdout: \"inherit\",\n stderr: \"inherit\",\n });\n const exit = yield* handle.exitCode;\n if (exit !== 0) {\n return yield* new AuthError({\n message: `aws sso ${command} exited with code ${exit}`,\n });\n }\n}).pipe(Effect.scoped);\nconst AwsSsoLoginOutput = Schema.Struct({\n url: Schema.optional(Schema.String),\n authUrl: Schema.optional(Schema.String),\n authorizationUrl: Schema.optional(Schema.String),\n verificationUri: Schema.optional(Schema.String),\n verificationUriComplete: Schema.optional(Schema.String),\n code: Schema.optional(Schema.String),\n userCode: Schema.optional(Schema.String),\n});\nexport const parseAwsSsoLoginOutput = (output) => {\n try {\n const decoded = Schema.decodeUnknownOption(AwsSsoLoginOutput)(JSON.parse(output));\n if (Option.isSome(decoded)) {\n const event = decoded.value;\n return {\n url: event.authorizationUrl ??\n event.authUrl ??\n event.verificationUriComplete ??\n event.verificationUri ??\n event.url,\n code: event.userCode ?? event.code,\n };\n }\n }\n catch {\n // `sso login` accepts the global `--output json` option but current AWS\n // CLI releases still render this custom command's authorization prompt as\n // text. Keep accepting structured output if AWS starts honoring the flag.\n }\n return {\n url: output.match(/https?:\\/\\/[^\\s]+/)?.[0],\n code: output.match(/Then enter the code:\\s*([A-Z0-9-]+)/i)?.[1],\n };\n};\nconst loginSSO = (config, authorizationMethod = \"oauth\") => Effect.scoped(Effect.gen(function* () {\n const interaction = yield* Interaction.Interaction;\n const services = yield* Effect.context();\n const runOpenUrl = Effect.runPromiseWith(services);\n const authorizationUrl = yield* Deferred.make();\n const deviceCode = yield* Deferred.make();\n const stdout = yield* Ref.make(\"\");\n const stderr = yield* Ref.make(\"\");\n const handle = yield* ChildProcess.make(\"aws\", [\n \"sso\",\n \"login\",\n \"--profile\",\n config.ssoProfile,\n \"--no-browser\",\n \"--output\",\n \"json\",\n ...(authorizationMethod === \"device\" ? [\"--use-device-code\"] : []),\n ], {\n shell: false,\n stdin: \"ignore\",\n stdout: \"pipe\",\n stderr: \"pipe\",\n });\n const collectStdout = handle.stdout.pipe(Stream.decodeText(), Stream.runForEach((chunk) => Effect.gen(function* () {\n const combined = yield* Ref.updateAndGet(stdout, (current) => current + chunk);\n const { url, code } = parseAwsSsoLoginOutput(combined);\n if (url !== undefined) {\n yield* Deferred.succeed(authorizationUrl, url);\n }\n if (code !== undefined) {\n yield* Deferred.succeed(deviceCode, code);\n }\n })));\n const collectStderr = handle.stderr.pipe(Stream.decodeText(), Stream.runForEach((chunk) => Ref.update(stderr, (current) => current + chunk)));\n const process = Effect.gen(function* () {\n const [exitCode] = yield* Effect.all([handle.exitCode, collectStdout, collectStderr], { concurrency: 3 });\n if (exitCode !== 0) {\n const detail = (yield* Ref.get(stderr)).trim();\n return yield* Effect.fail(new AuthError({\n message: `aws sso login exited with code ${exitCode}${detail === \"\" ? \"\" : `: ${detail}`}`,\n }));\n }\n });\n const processFiber = yield* Effect.forkScoped(process);\n const url = yield* Deferred.await(authorizationUrl).pipe(Effect.raceFirst(Fiber.join(processFiber).pipe(Effect.flatMap(() => Effect.fail(new AuthError({\n message: \"AWS SSO login completed without providing an authorization URL.\",\n }))))));\n const code = authorizationMethod === \"device\"\n ? yield* Deferred.await(deviceCode).pipe(Effect.raceFirst(Fiber.join(processFiber).pipe(Effect.flatMap(() => Effect.fail(new AuthError({\n message: \"AWS SSO device login completed without providing an authorization code.\",\n }))))))\n : undefined;\n const openFailed = yield* Interaction.openUrl(url).pipe(Effect.as(false), Effect.catch(() => Effect.succeed(true)));\n yield* Fiber.join(processFiber).pipe(Effect.raceFirst(interaction.prompt\n .awaitExternal({\n message: \"AWS authorization\",\n waitingLabel: authorizationMethod === \"device\"\n ? \"waiting for device authorization (up to 5 minutes)…\"\n : \"waiting for browser authorization (up to 5 minutes)…\",\n url,\n code,\n openFailed,\n onOpen: () => runOpenUrl(Interaction.openUrl(url)),\n allowManualInput: false,\n })\n .pipe(Effect.asVoid)));\n yield* interaction.output.success(\"AWS SSO: login complete\");\n}));\n/**\n * `aws sso logout` only clears AWS CLI's own caches — it does not know about the\n * `<sha1(sso_session)>.credentials.json` file that `@distilled.cloud/aws`\n * writes alongside the SSO token. Without this cleanup, `loadProfileCredentials`\n * short-circuits on the stale distilled cache file after logout and appears to\n * stay logged in until the role creds hit their TTL.\n */\nconst clearDistilledSsoCache = (ssoProfile) => Effect.gen(function* () {\n const auth = yield* DistilledAuth.Default;\n const profile = yield* auth.loadProfile(ssoProfile);\n const ssoSession = profile.sso_session;\n if (!ssoSession)\n return;\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const hash = NodeCrypto.createHash(\"sha1\").update(ssoSession).digest(\"hex\");\n const cacheFile = path.join(NodeOs.homedir(), \".aws\", \"sso\", \"cache\", `${hash}.credentials.json`);\n yield* fs.remove(cacheFile).pipe(Effect.catch(() => Effect.void));\n}).pipe(Effect.catch(() => Effect.void));\n//# sourceMappingURL=AuthProvider.js.map","import { DEFAULT_API_BASE_URL } from \"@distilled.cloud/axiom/Credentials\";\nimport * as Effect from \"effect/Effect\";\nimport * as Redacted from \"effect/Redacted\";\nimport { AuthError } from \"../Auth/AuthProvider.js\";\nimport { getEnv, getEnvRedacted } from \"../Auth/Env.js\";\nimport { makeStoredAuthProvider, storedSecret, storedValueText, } from \"../Auth/StoredAuthProvider.js\";\nexport const AXIOM_AUTH_PROVIDER_NAME = \"Axiom\";\nconst readEnvironment = Effect.gen(function* () {\n const apiToken = (yield* getEnvRedacted(\"AXIOM_TOKEN\")) ??\n (yield* getEnvRedacted(\"AXIOM_API_KEY\"));\n if (!apiToken) {\n return yield* new AuthError({\n message: \"Axiom CI credentials not found. Set AXIOM_TOKEN or AXIOM_API_KEY.\",\n });\n }\n const apiBaseUrl = (yield* getEnv(\"AXIOM_URL\")) ?? DEFAULT_API_BASE_URL;\n const orgId = yield* getEnv(\"AXIOM_ORG_ID\");\n return orgId\n ? {\n type: \"pat\",\n apiToken,\n apiBaseUrl,\n orgId,\n source: { type: \"env\" },\n }\n : {\n type: \"apiToken\",\n apiToken,\n apiBaseUrl,\n source: { type: \"env\" },\n };\n});\nconst axiomAuth = makeStoredAuthProvider({\n provider: AXIOM_AUTH_PROVIDER_NAME,\n fields: [\n {\n name: \"token\",\n label: \"Axiom API Token or Personal Access Token\",\n secret: true,\n },\n {\n name: \"orgId\",\n label: \"Axiom Org ID (required for personal access tokens)\",\n optional: true,\n },\n {\n name: \"apiBaseUrl\",\n label: \"Axiom API Base URL\",\n optional: true,\n placeholder: DEFAULT_API_BASE_URL,\n },\n ],\n toResolved: (values, source) => {\n const apiToken = storedSecret(values.token) ?? Redacted.make(\"\");\n const apiBaseUrl = storedValueText(values.apiBaseUrl) ?? DEFAULT_API_BASE_URL;\n return values.orgId !== undefined\n ? {\n type: \"pat\",\n apiToken,\n apiBaseUrl,\n orgId: storedValueText(values.orgId) ?? \"\",\n source: { type: source },\n }\n : {\n type: \"apiToken\",\n apiToken,\n apiBaseUrl,\n source: { type: source },\n };\n },\n readEnvironment,\n environment: [\n {\n name: \"AXIOM_TOKEN\",\n required: true,\n secret: true,\n alternatives: [\"AXIOM_API_KEY\"],\n description: \"Personal access token or API token.\",\n },\n {\n name: \"AXIOM_URL\",\n required: false,\n description: \"API base URL for self-hosted or regional deployments.\",\n },\n {\n name: \"AXIOM_ORG_ID\",\n required: false,\n description: \"Organization id; required when the token is a personal access token.\",\n },\n ],\n});\n/**\n * Layer that registers the Axiom {@link AuthProvider} into the\n * {@link AuthProviders} registry when built. Include this in the Axiom\n * `providers()` layer so the alchemy CLI can discover it.\n */\nexport const AxiomAuth = axiomAuth.layer;\n/** Schema of Axiom's inline static-token values. */\nexport const AxiomStoredCredentials = axiomAuth.storedSchema;\n//# sourceMappingURL=AuthProvider.js.map","import * as Data from \"effect/Data\";\nimport * as Clock from \"effect/Clock\";\nimport * as Crypto from \"effect/Crypto\";\nimport * as Encoding from \"effect/Encoding\";\nimport * as Effect from \"effect/Effect\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as Schema from \"effect/Schema\";\nimport http from \"node:http\";\nimport * as HttpClient from \"effect/unstable/http/HttpClient\";\nimport * as HttpClientRequest from \"effect/unstable/http/HttpClientRequest\";\nimport * as HttpClientResponse from \"effect/unstable/http/HttpClientResponse\";\nimport { AUTH_ERROR_URL, AUTH_SUCCESS_URL } from \"./AuthProvider.js\";\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\";\nexport class OAuthError extends Data.TaggedError(\"OAuthError\") {\n}\n/**\n * The local loopback callback server could not start (typically the port is\n * already taken). Distinct from {@link OAuthError} so callers can fall back to\n * manual code entry instead of failing the whole flow.\n */\nexport class CallbackServerStartError extends Data.TaggedError(\"CallbackServerStartError\") {\n}\n/**\n * On-disk shape of OAuth credentials persisted under\n * `~/.alchemy/credentials/{profile}/<provider>-oauth.json`.\n *\n * `clientId` is optional because files written before the client id was\n * recorded must still parse — {@link OAuthClient.usesCurrentClient} treats a\n * missing id as \"issued to a previous client\", which triggers a clean\n * re-login.\n */\nexport const OAuthCredentials = Schema.Struct({\n type: Schema.Literal(\"oauth\"),\n clientId: Schema.optional(Schema.String),\n access: Schema.RedactedFromValue(Schema.String),\n refresh: Schema.RedactedFromValue(Schema.String),\n expires: Schema.Number,\n scopes: Schema.mutable(Schema.Array(Schema.String)),\n});\nconst randomText = Effect.fn(function* (length) {\n const crypto = yield* Crypto.Crypto;\n const bytes = yield* crypto.randomBytes(length).pipe(Effect.mapError((cause) => new OAuthError({\n error: \"crypto_error\",\n errorDescription: `Secure random generation failed: ${cause}`,\n })));\n return Encoding.encodeBase64Url(bytes);\n});\nconst generatePKCE = Effect.fn(function* (length = 96) {\n const crypto = yield* Crypto.Crypto;\n const verifier = yield* randomText(length);\n const challenge = yield* crypto\n .digest(\"SHA-256\", new TextEncoder().encode(verifier))\n .pipe(Effect.mapError((cause) => new OAuthError({\n error: \"crypto_error\",\n errorDescription: `PKCE digest failed: ${cause}`,\n })));\n return { verifier, challenge: Encoding.encodeBase64Url(challenge) };\n});\nconst TokenResponse = Schema.Struct({\n access_token: Schema.String,\n refresh_token: Schema.optional(Schema.String),\n expires_in: Schema.Number,\n scope: Schema.optional(Schema.String),\n});\nconst TokenErrorResponse = Schema.Struct({\n error: Schema.String,\n error_description: Schema.optional(Schema.String),\n});\nexport const makeOAuthClient = (spec) => {\n const provideHttp = (effect) => effect.pipe(Effect.provide(FetchHttpClient.layer));\n const clientAuthParams = () => spec.auth.kind === \"clientSecret\"\n ? { client_secret: Redacted.value(spec.auth.clientSecret) }\n : {};\n const extractCredentials = (json, previous) => {\n const refresh = json.refresh_token === undefined\n ? previous?.refresh\n : Redacted.make(json.refresh_token);\n if (!refresh) {\n return Effect.fail(new OAuthError({\n error: \"invalid_token_response\",\n errorDescription: \"The provider did not return a refresh token for this authorization.\",\n }));\n }\n return Effect.gen(function* () {\n const now = yield* Clock.currentTimeMillis;\n return {\n type: \"oauth\",\n clientId: spec.clientId,\n access: Redacted.make(json.access_token),\n refresh,\n expires: now + json.expires_in * 1000,\n scopes: json.scope?.split(\" \") ?? previous?.scopes ?? [],\n };\n });\n };\n const tokenRequest = Effect.fn(function* (params, previous) {\n const client = yield* HttpClient.HttpClient;\n const transport = spec.tokenTransport ?? \"body\";\n const request = HttpClientRequest.post(spec.endpoints.token).pipe(HttpClientRequest.setHeader(\"Accept\", \"application/json\"), transport === \"query\"\n ? HttpClientRequest.setUrlParams(params)\n : HttpClientRequest.bodyUrlParams(params));\n const response = yield* client.execute(request).pipe(Effect.mapError((cause) => new OAuthError({\n error: \"network_error\",\n errorDescription: `Token request failed: ${cause}`,\n })));\n if (response.status < 200 || response.status >= 300) {\n const json = yield* HttpClientResponse.schemaBodyJson(TokenErrorResponse)(response).pipe(Effect.mapError(() => new OAuthError({\n error: \"parse_error\",\n errorDescription: `Token endpoint returned ${response.status}`,\n })));\n return yield* new OAuthError({\n error: json.error,\n errorDescription: json.error_description ??\n `Token endpoint returned ${response.status}`,\n });\n }\n const json = yield* HttpClientResponse.schemaBodyJson(TokenResponse)(response).pipe(Effect.mapError(() => new OAuthError({\n error: \"parse_error\",\n errorDescription: \"Failed to parse token response\",\n })));\n return yield* extractCredentials(json, previous);\n });\n const authorize = Effect.fn(function* (scopes) {\n const state = yield* randomText(32);\n const url = new URL(spec.endpoints.authorize);\n url.searchParams.set(\"client_id\", spec.clientId);\n url.searchParams.set(\"redirect_uri\", spec.redirectUri);\n url.searchParams.set(\"response_type\", \"code\");\n if (scopes !== undefined) {\n url.searchParams.set(\"scope\", scopes.join(\" \"));\n }\n url.searchParams.set(\"state\", state);\n if (spec.auth.kind === \"pkce\") {\n const pkce = yield* generatePKCE();\n url.searchParams.set(\"code_challenge\", pkce.challenge);\n url.searchParams.set(\"code_challenge_method\", \"S256\");\n return { url: url.toString(), state, verifier: pkce.verifier };\n }\n return { url: url.toString(), state };\n });\n const exchange = Effect.fn(function (code, authorization) {\n return tokenRequest({\n grant_type: \"authorization_code\",\n code,\n client_id: spec.clientId,\n redirect_uri: spec.redirectUri,\n ...clientAuthParams(),\n ...(authorization?.verifier === undefined\n ? {}\n : { code_verifier: authorization.verifier }),\n });\n });\n const refresh = Effect.fn(function (credentials) {\n return tokenRequest({\n grant_type: \"refresh_token\",\n refresh_token: Redacted.value(credentials.refresh),\n client_id: spec.clientId,\n ...clientAuthParams(),\n }, credentials);\n });\n const revoke = Effect.fn(function* (credentials) {\n const endpoint = spec.endpoints.revoke;\n if (endpoint === undefined)\n return;\n const client = yield* HttpClient.HttpClient;\n const request = HttpClientRequest.post(endpoint).pipe(HttpClientRequest.setHeader(\"Accept\", \"application/json\"), HttpClientRequest.bodyUrlParams({\n token: Redacted.value(credentials.refresh),\n token_type_hint: \"refresh_token\",\n client_id: spec.clientId,\n ...clientAuthParams(),\n }));\n yield* client.execute(request).pipe(Effect.mapError((cause) => new OAuthError({\n error: \"network_error\",\n errorDescription: `Revoke request failed: ${cause}`,\n })), Effect.asVoid);\n });\n const exchangeCallbackInput = Effect.fn(function* (input, authorization) {\n const value = input.trim();\n let code = value;\n let state = null;\n try {\n const url = new URL(value);\n code = url.searchParams.get(\"code\") ?? \"\";\n state = url.searchParams.get(\"state\");\n }\n catch {\n const separator = value.lastIndexOf(\"#\");\n if (separator >= 0) {\n code = value.slice(0, separator);\n state = value.slice(separator + 1);\n }\n }\n if (!code) {\n return yield* new OAuthError({\n error: \"invalid_request\",\n errorDescription: \"The authorization code is missing.\",\n });\n }\n if (state !== null && state !== authorization.state) {\n return yield* new OAuthError({\n error: \"invalid_request\",\n errorDescription: \"The authorization state does not match.\",\n });\n }\n return yield* exchange(code, authorization);\n });\n const callback = Effect.fn(function* (authorization) {\n const { pathname, port, protocol } = new URL(spec.localCallbackUri);\n const listenPort = port === \"\" ? (protocol === \"https:\" ? 443 : 80) : Number(port);\n const listen = Effect.callback((resume) => {\n // The handler can run more than once (browser retries, extra tabs);\n // resume exactly once and ignore everything after.\n let settled = false;\n const resolveOnce = (effect) => {\n if (settled)\n return;\n settled = true;\n resume(effect);\n };\n const server = http.createServer((req, res) => {\n const url = new URL(req.url ?? \"/\", `http://${req.headers.host}`);\n if (url.pathname === \"/auth/ping\") {\n res.writeHead(req.method === \"OPTIONS\" ? 204 : 200, {\n \"Access-Control-Allow-Origin\": new URL(spec.redirectUri).origin,\n \"Access-Control-Allow-Methods\": \"GET, OPTIONS\",\n \"Access-Control-Allow-Private-Network\": \"true\",\n \"Cache-Control\": \"no-store\",\n });\n res.end();\n return;\n }\n if (url.pathname !== pathname) {\n res.statusCode = 404;\n res.end(\"Not Found\");\n return;\n }\n const error = url.searchParams.get(\"error\");\n const errorDescription = url.searchParams.get(\"error_description\");\n if (error) {\n res.writeHead(302, { Location: AUTH_ERROR_URL });\n res.end();\n resolveOnce(Effect.fail(new OAuthError({\n error,\n errorDescription: errorDescription ?? \"An unknown error occurred.\",\n })));\n return;\n }\n const code = url.searchParams.get(\"code\");\n const state = url.searchParams.get(\"state\");\n if (!code || !state) {\n res.writeHead(302, { Location: AUTH_ERROR_URL });\n res.end();\n resolveOnce(Effect.fail(new OAuthError({\n error: \"invalid_request\",\n errorDescription: \"Missing code or state\",\n })));\n return;\n }\n if (state !== authorization.state) {\n res.writeHead(302, { Location: AUTH_ERROR_URL });\n res.end();\n resolveOnce(Effect.fail(new OAuthError({\n error: \"invalid_request\",\n errorDescription: \"Invalid state\",\n })));\n return;\n }\n resolveOnce(exchange(code, authorization).pipe(Effect.tap(() => Effect.sync(() => {\n res.writeHead(302, { Location: AUTH_SUCCESS_URL });\n res.end();\n })), Effect.tapError(() => Effect.sync(() => {\n res.writeHead(302, { Location: AUTH_ERROR_URL });\n res.end();\n }))));\n });\n server.on(\"error\", (err) => {\n resolveOnce(Effect.fail(server.listening\n ? new OAuthError({\n error: \"server_error\",\n errorDescription: `Callback server failed: ${err.message}`,\n })\n : new CallbackServerStartError({\n message: `Failed to start callback server: ${err.message}`,\n })));\n });\n server.listen(listenPort, \"127.0.0.1\");\n return Effect.sync(() => {\n server.close();\n // `close` only stops new connections — a keep-alive browser\n // connection would otherwise hold the process open until its\n // socket timeout after login completes.\n server.closeAllConnections();\n });\n });\n return yield* listen.pipe(Effect.timeoutOrElse({\n duration: \"5 minutes\",\n orElse: () => Effect.fail(new OAuthError({\n error: \"timeout\",\n errorDescription: \"The authorization process timed out.\",\n })),\n }));\n });\n return {\n clientId: spec.clientId,\n usesCurrentClient: (credentials) => credentials.clientId === spec.clientId,\n authorize,\n exchange: (...args) => provideHttp(exchange(...args)),\n exchangeCallbackInput: (...args) => provideHttp(exchangeCallbackInput(...args)),\n callback: (authorization) => provideHttp(callback(authorization)),\n refresh: (credentials) => provideHttp(refresh(credentials)),\n revoke: (credentials) => provideHttp(revoke(credentials)),\n };\n};\n//# sourceMappingURL=OAuthFlow.js.map","/**\n * Shared browser-OAuth ceremony for auth providers: open the authorization\n * URL, then race the provider's local callback listener against the branded\n * \"waiting for browser\" prompt (spinner + compact URL; Enter switches to\n * manual code entry, `o` opens the browser again, and `c` copies the URL).\n *\n * Built-in providers (Cloudflare, Planetscale) and custom stack-provided\n * auth providers should all route their browser flows through this so the\n * login UX stays uniform.\n */\nimport * as Effect from \"effect/Effect\";\nimport * as Interaction from \"../Interaction.js\";\nimport { CallbackServerStartError } from \"./OAuthFlow.js\";\nexport const browserOAuth = Effect.fn(function* (options) {\n const services = yield* Effect.context();\n // This runner is invoked later by React's keyboard event boundary, not\n // while the surrounding Effect is executing.\n const openUrl = Effect.runPromiseWith(services);\n const openFailed = yield* Interaction.openUrl(options.url).pipe(Effect.as(false), Effect.catch(() => Effect.succeed(true)));\n return yield* Effect.raceFirst(\n // A callback server that cannot start (e.g. the port is taken) must not\n // fail the race — warn and hang so manual code entry stays available.\n // Genuine OAuth failures delivered via the callback still fail fast.\n options.callback.pipe(Effect.catch((e) => e instanceof CallbackServerStartError\n ? Interaction.accessors.output\n .warning(`${e.message} — paste the authorization code instead.`)\n .pipe(Effect.andThen(Effect.never))\n : Effect.fail(e))), (yield* Interaction.Interaction).prompt\n .awaitExternal({\n message: `${options.provider} authorization`,\n waitingLabel: options.waitingLabel ??\n \"waiting for browser authorization (up to 5 minutes)…\",\n url: options.url,\n openFailed,\n onOpen: () => openUrl(Interaction.openUrl(options.url)),\n inputLabel: \"Paste the authorization code or callback URL\",\n validate: (value) => value.trim().length > 0 ? undefined : \"Paste a code or URL\",\n })\n .pipe(Effect.flatMap(options.exchange)));\n});\n//# sourceMappingURL=BrowserOAuth.js.map","import * as Schema from \"effect/Schema\";\n/**\n * Filename (under `~/.alchemy/credentials/{profile}/`) used to cache the\n * Cloudflare-deployed HTTP state store's endpoint + bearer token.\n *\n * Kept in this leaf module (rather than `StateStore/State.ts`) so the\n * Cloudflare auth provider can invalidate the cache on\n * `profile edit` / provider logout without importing the heavy state-store\n * module and creating an import cycle\n * (`StateStore/State.ts` -> `Providers.ts` -> `Auth/AuthProvider.ts`).\n */\nexport const CREDENTIALS_FILE = \"cloudflare-state-store\";\n/**\n * On-disk shape of the cached Cloudflare state-store credentials.\n *\n * Extends the generic `HttpStateStoreCredentials` (`{ url, authToken }`)\n * with the `accountId` the credentials were minted against. The `url` already\n * encodes the account (via the `*.workers.dev` subdomain), so a cache written\n * while logged into account A keeps pointing at account A's state store even\n * after the user re-authenticates against account B. Persisting `accountId`\n * lets `state()` detect that mismatch and re-derive.\n *\n * `accountId` is optional so legacy files written before this field existed\n * still parse — they are treated as stale (see\n * {@link isStateStoreCredentialsStale}) and re-derived on next use.\n */\nexport const StoredStateStoreCredentials = Schema.Struct({\n url: Schema.String,\n /** Bearer token used to authenticate every request. */\n authToken: Schema.String,\n /** Cloudflare account ID the `url`/`authToken` were minted against. */\n accountId: Schema.optional(Schema.String),\n});\n/**\n * `true` when cached state-store credentials must not be trusted for the\n * current account:\n *\n * - the file predates the `accountId` field (legacy cache — exactly the\n * artifact that caused deploys to silently target the wrong account), or\n * - it was minted against a different account than the one now in use.\n *\n * A stale cache is discarded and re-derived from the current account.\n */\nexport const isStateStoreCredentialsStale = (credentials, currentAccountId) => credentials.accountId == null || credentials.accountId !== currentAccountId;\n//# sourceMappingURL=CredentialsFile.js.map","import { makeOAuthClient } from \"../../Auth/OAuthFlow.js\";\n/**\n * Alchemy's public Cloudflare OAuth client registration. The client is\n * public (PKCE, no secret); rotating it invalidates previously stored\n * credentials, which {@link usesCurrentClient} detects for a clean\n * re-login.\n */\nexport const OAUTH_CLIENT_ID = \"e7e25ec474419def6ba38d2d2638b122\";\nexport const OAUTH_REDIRECT_URI = \"https://alchemy.run/auth/callback\";\nexport const OAUTH_LOCAL_CALLBACK_URI = \"http://localhost:9976/auth/callback\";\nexport const OAUTH_ENDPOINTS = {\n authorize: \"https://dash.cloudflare.com/oauth2/auth\",\n token: \"https://dash.cloudflare.com/oauth2/token\",\n revoke: \"https://dash.cloudflare.com/oauth2/revoke\",\n};\nexport { OAuthCredentials, OAuthError, } from \"../../Auth/OAuthFlow.js\";\n/**\n * Cloudflare's browser OAuth client: a public client using PKCE, with\n * per-authorization scopes and a revocation endpoint. All flow mechanics\n * live in the shared {@link makeOAuthClient} kit — this module only\n * supplies Cloudflare's registration facts.\n */\nconst client = makeOAuthClient({\n clientId: OAUTH_CLIENT_ID,\n endpoints: OAUTH_ENDPOINTS,\n redirectUri: OAUTH_REDIRECT_URI,\n localCallbackUri: OAUTH_LOCAL_CALLBACK_URI,\n auth: { kind: \"pkce\" },\n});\nexport const { authorize, callback, exchange, exchangeCallbackInput, refresh, revoke, usesCurrentClient, } = client;\n//# sourceMappingURL=OAuthClient.js.map","import * as Effect from \"effect/Effect\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as Schema from \"effect/Schema\";\nimport { AuthError } from \"../../Auth/AuthProvider.js\";\nimport { profileCommandHint } from \"../../Util/interactive.js\";\n/** Typed values stored in a Cloudflare provider profile document. */\nexport const CloudflareAuthConfigSchema = Schema.Union([\n Schema.Struct({\n method: Schema.Literal(\"stored\"),\n credentialType: Schema.Literal(\"apiToken\"),\n apiToken: Schema.String,\n accountId: Schema.String,\n }),\n Schema.Struct({\n method: Schema.Literal(\"stored\"),\n credentialType: Schema.Literal(\"apiKey\"),\n apiKey: Schema.String,\n email: Schema.String,\n accountId: Schema.String,\n }),\n Schema.Struct({\n method: Schema.Literal(\"oauth\"),\n scopes: Schema.mutable(Schema.Array(Schema.String)),\n accountId: Schema.String,\n clientId: Schema.optional(Schema.String),\n access: Schema.String,\n refresh: Schema.String,\n expires: Schema.Number,\n }),\n // Released v0 OAuth grants cannot be reused, but retaining the method lets\n // `profile refresh` restart OAuth at scope selection.\n Schema.Struct({\n method: Schema.Literal(\"oauth\"),\n }),\n]);\nexport const CLOUDFLARE_AUTH_PROVIDER_NAME = \"Cloudflare\";\n/**\n * Cloudflare account IDs are 32 lowercase hex characters. Placeholder\n * values (\"\", \"-\", \"dummy\", …) end up interpolated into API paths and\n * surface as baffling `InvalidRoute: Could not route to\n * /accounts/<value>/...` errors, so reject them up front with an\n * actionable message instead.\n */\nconst ACCOUNT_ID_PATTERN = /^[0-9a-f]{32}$/i;\nexport const validateAccountId = (accountId, source) => Effect.gen(function* () {\n const trimmed = accountId?.trim() ?? \"\";\n const command = yield* profileCommandHint(\"alchemy profile edit --reconfigure Cloudflare\");\n if (trimmed.length === 0) {\n return yield* Effect.fail(new AuthError({\n message: `Cloudflare account ID is missing (${source}). ` +\n `Re-run \\`${command}\\` and provide your account ID ` +\n \"(found in the Cloudflare dashboard under Workers & Pages → Account details).\",\n }));\n }\n if (!ACCOUNT_ID_PATTERN.test(trimmed)) {\n return yield* Effect.fail(new AuthError({\n message: `'${trimmed}' is not a valid Cloudflare account ID (${source}) — expected 32 hex characters. ` +\n \"Copy the account ID from the Cloudflare dashboard (Workers & Pages → Account details) \" +\n `and re-run \\`${command}\\`.`,\n }));\n }\n return trimmed.toLowerCase();\n});\n/** Field-level validator reusing {@link ACCOUNT_ID_PATTERN}. */\nexport const validateAccountIdField = (v) => ACCOUNT_ID_PATTERN.test(v.trim())\n ? undefined\n : \"Expected a 32-character hex account ID (Workers & Pages → Account details)\";\n//# sourceMappingURL=AuthConfig.js.map","/** Scopes enabled on Alchemy's public Cloudflare OAuth client. */\nexport const OAUTH_SCOPE_GROUPS = [\n {\n id: \"developer-platform\",\n label: \"Developer Platform\",\n scopes: [\n \"agent-memory.write\",\n \"browser-rendering.read\",\n \"browser-rendering.write\",\n \"cf-agents.read\",\n \"cf-agents.write\",\n \"cloud-connector.read\",\n \"cloud-connector.write\",\n \"cloudchamber.read\",\n \"cloudchamber.write\",\n \"constellation.read\",\n \"constellation.write\",\n \"d1.read\",\n \"d1.write\",\n \"flagship.evaluate\",\n \"flagship.read\",\n \"flagship.write\",\n \"query-cache.read\",\n \"query-cache.write\",\n \"mcp-portals.read\",\n \"mcp-portals.write\",\n \"messaging.edit\",\n \"messaging.read\",\n \"page.read\",\n \"page.write\",\n \"pipelines.read\",\n \"pipelines.send\",\n \"pipelines.write\",\n \"pubsub.read\",\n \"pubsub.write\",\n \"queues.read\",\n \"queues.write\",\n \"realtime.admin\",\n \"realtime.read\",\n \"realtime.write\",\n \"secrets-store.read\",\n \"secrets-store.write\",\n \"vectorize.read\",\n \"vectorize.write\",\n \"workers-ci.read\",\n \"workers-ci.write\",\n \"containers.read\",\n \"containers.write\",\n \"workers-scripts.edit\",\n \"workers-kv-storage.read\",\n \"workers-kv-storage.write\",\n \"workers-observability.read\",\n \"workers-observability-telemetry.write\",\n \"workers-observability.write\",\n \"r2-catalog.read\",\n \"r2-catalog.write\",\n \"r2-catalog-sql.read\",\n \"workers-r2-bucket-item.read\",\n \"workers-r2-bucket-item.write\",\n \"workers-r2.read\",\n \"workers-r2.write\",\n \"workers-routes.read\",\n \"workers-routes.write\",\n \"workers-scripts.bind\",\n \"workers-scripts.read\",\n \"workers-scripts.write\",\n \"workers-tail.read\",\n ],\n },\n {\n id: \"ai-machine-learning\",\n label: \"AI & Machine Learning\",\n scopes: [\n \"aiaudit.read\",\n \"aiaudit.write\",\n \"aig.read\",\n \"aig.run\",\n \"aig.write\",\n \"ai-search.index\",\n \"ai-search.read\",\n \"ai-search.run\",\n \"ai-search.write\",\n \"agw.read\",\n \"agw.run\",\n \"agw.write\",\n \"rag.read\",\n \"rag.run\",\n \"rag.write\",\n \"firewall-for-ai.read\",\n \"firewall-for-ai.write\",\n \"websearch.read\",\n \"websearch.run\",\n \"websearch.write\",\n \"ai.read\",\n \"ai.write\",\n ],\n },\n {\n id: \"dns-zones\",\n label: \"DNS & Zones\",\n scopes: [\n \"account-dns-settings.read\",\n \"account-dns-settings.write\",\n \"dns-firewall.read\",\n \"dns-firewall.write\",\n \"dns.read\",\n \"dns-view.read\",\n \"dns-view.write\",\n \"dns.write\",\n \"registrar-domains.admin\",\n \"registrar-domains.read\",\n \"registrar-sandbox-domains.admin\",\n \"registrar-sandbox-domains.read\",\n \"zone-custom-asset.read\",\n \"zone-custom-asset.write\",\n \"zone-dns-settings.read\",\n \"zone-dns-settings.write\",\n \"zone.read\",\n \"zone-settings.read\",\n \"zone-settings.write\",\n \"zone-versioning.read\",\n \"zone-versioning.write\",\n \"zone.write\",\n ],\n },\n {\n id: \"app-security\",\n label: \"App Security\",\n scopes: [\n \"fraud-detection-pii.read\",\n \"account-firewall-access-rules.read\",\n \"account-firewall-access-rules.write\",\n \"account-security-center-insights.read\",\n \"account-security-center-insights.write\",\n \"account-waf.read\",\n \"account-waf.write\",\n \"request-tracer.read\",\n \"reports-application-security-report.read\",\n \"bot-management-feedback.read\",\n \"bot-management-feedback.write\",\n \"bot-management.read\",\n \"bot-management.write\",\n \"cloudforce-one.read\",\n \"cloudforce-one.write\",\n \"ddos-botnet-feed.read\",\n \"ddos-botnet-feed.write\",\n \"ddos-protection.read\",\n \"ddos-protection.write\",\n \"api-gateway.read\",\n \"api-gateway.write\",\n \"domain-page.shield\",\n \"domain-page-shield.read\",\n \"field-extractor.read\",\n \"field-extractor.write\",\n \"firewall-services.read\",\n \"firewall-services.write\",\n \"fraud-detection.read\",\n \"fraud-detection.write\",\n \"fraud-events.write\",\n \"fraud-feedback.read\",\n \"fraud-feedback.write\",\n \"http-applications.read\",\n \"http-applications.write\",\n \"http-ddos-managed-ruleset.read\",\n \"http-ddos-managed-ruleset.write\",\n \"iot.read\",\n \"iot.write\",\n \"l4-ddos-managed-ruleset.read\",\n \"l4-ddos-managed-ruleset.write\",\n \"page-rules.read\",\n \"page-rules.write\",\n \"page.shield\",\n \"page-shield.read\",\n \"precursor.read\",\n \"precursor.write\",\n \"sanitize.read\",\n \"sanitize.write\",\n \"tag.read\",\n \"tag.write\",\n \"trust-and-safety.read\",\n \"trust-and-safety.write\",\n \"challenge-widgets.read\",\n \"challenge-widgets.write\",\n \"url-scanner.read\",\n \"url-scanner.write\",\n \"zaraz.edit\",\n \"zaraz.read\",\n \"zaraz.write\",\n \"zone-security-center-insights.read\",\n \"zone-security-center-insights.write\",\n \"zone-waf.read\",\n \"zone-waf.write\",\n ],\n },\n {\n id: \"rules-configuration\",\n label: \"Rules & Configuration\",\n scopes: [\n \"account-custom-error-rules.read\",\n \"account-custom-error-rules.write\",\n \"account-custom-pages.read\",\n \"account-custom-pages.write\",\n \"account-rule-lists.read\",\n \"account-rule-lists.write\",\n \"account-rulesets.read\",\n \"account-rulesets.write\",\n \"config-settings.read\",\n \"config-settings.write\",\n \"custom-errors.read\",\n \"custom-errors.write\",\n \"custom-pages.read\",\n \"custom-pages.write\",\n \"dynamic-redirect.read\",\n \"dynamic-redirect.write\",\n \"managed-headers.read\",\n \"managed-headers.write\",\n \"mass-url-redirects.read\",\n \"mass-url-redirects.write\",\n \"origin.read\",\n \"origin.write\",\n \"payments-gateway.read\",\n \"payments-gateway.write\",\n \"response-compression.read\",\n \"response-compression.write\",\n \"select-configuration.read\",\n \"select-configuration.write\",\n \"snippets.read\",\n \"snippets.write\",\n \"transform-rules.read\",\n \"transform-rules.write\",\n \"zone-transform-rules.read\",\n \"zone-transform-rules.write\",\n ],\n },\n {\n id: \"zero-trust\",\n label: \"Cloudflare One / Zero Trust\",\n scopes: [\n \"access-app.read\",\n \"access-app.revoke\",\n \"access-app.write\",\n \"access.read\",\n \"zone-access.read\",\n \"access.revoke\",\n \"zone-access.revoke\",\n \"access.write\",\n \"zone-access.write\",\n \"access-audit-log.read\",\n \"access-custom-page.read\",\n \"access-custom-page.write\",\n \"access-device-posture.read\",\n \"access-device-posture.write\",\n \"access-group.read\",\n \"access-group.write\",\n \"access-idp.read\",\n \"access-idp.write\",\n \"access-key.read\",\n \"access-key.write\",\n \"access-certificate.read\",\n \"access-certificate.write\",\n \"access-org.read\",\n \"access-org.revoke\",\n \"access-org.write\",\n \"access-acct.read\",\n \"access-acct.revoke\",\n \"access-acct.write\",\n \"access-policy.read\",\n \"access-policy.write\",\n \"access-policy-test.read\",\n \"access-policy-test.write\",\n \"access-population.read\",\n \"access-population.write\",\n \"access-saml-certificate.read\",\n \"access-saml-certificate.write\",\n \"access-scim-log.read\",\n \"access-ssh-auditing.read\",\n \"access-ssh-auditing.write\",\n \"access-service-token.read\",\n \"access-service-token.write\",\n \"access-tag.read\",\n \"access-tag.write\",\n \"access-users.read\",\n \"access-users.write\",\n \"casb.read\",\n \"casb.write\",\n \"teams-cds-compute-account.read\",\n \"teams-cds-compute-account.write\",\n \"teams-dex.read\",\n \"teams-dex.write\",\n \"teams-connector-cloudflared.monitoring\",\n \"teams-connector-warp.read\",\n \"teams-connector-warp.write\",\n \"teams-connector-cloudflared.read\",\n \"teams-connector-cloudflared.write\",\n \"teams-connectors.read\",\n \"teams-connectors.write\",\n \"teams-networks.read\",\n \"teams-networks.write\",\n \"argotunnel.read\",\n \"argotunnel.write\",\n \"teams-secure.location\",\n \"dls.read\",\n \"dls.write\",\n \"teams.read\",\n \"teams.report\",\n \"teams-resilience.read\",\n \"teams-resilience.write\",\n \"teams.write\",\n \"teams-pii.read\",\n \"access-seats.write\",\n ],\n },\n {\n id: \"analytics-logs\",\n label: \"Analytics & Logs\",\n scopes: [\n \"account-analytics.read\",\n \"analytics.read\",\n \"intel.read\",\n \"intel.write\",\n \"account-logs.read\",\n \"account-logs.write\",\n \"logs.read\",\n \"logs.write\",\n \"radar.read\",\n ],\n },\n {\n id: \"network-services\",\n label: \"Network Services\",\n scopes: [\n \"account-waiting-rooms.read\",\n \"address-maps.read\",\n \"address-maps.write\",\n \"chinanetwork-steering.read\",\n \"chinanetwork-steering.write\",\n \"connectivity-directory.admin\",\n \"connectivity-directory.bind\",\n \"connectivity-directory.read\",\n \"healthcheck.read\",\n \"healthcheck.write\",\n \"ip-prefix-bgp-on-demand.read\",\n \"ip-prefix-bgp-on-demand.write\",\n \"ip-prefix.read\",\n \"ip-prefix.write\",\n \"load-balancers-account.read\",\n \"load-balancers-account.write\",\n \"load-balancers.read\",\n \"load-balancers.write\",\n \"load-balancing-monitors-and-pools.read\",\n \"load-balancing-monitors-and-pools.write\",\n \"pcaps-api.read\",\n \"pcaps-api.write\",\n \"magic-firewall.read\",\n \"magic-firewall.write\",\n \"fbm.admin\",\n \"fbm.read\",\n \"fbm.write\",\n \"magic-transit.read\",\n \"magic-transit.write\",\n \"magic-wan.read\",\n \"magic-wan.write\",\n \"waiting-rooms.read\",\n \"waiting-rooms.write\",\n \"web3-hostnames.read\",\n \"web3-hostnames.write\",\n ],\n },\n {\n id: \"media\",\n label: \"Media\",\n scopes: [\n \"calls.read\",\n \"calls.write\",\n \"images.read\",\n \"images.write\",\n \"moq.read\",\n \"moq.write\",\n \"stream.read\",\n \"stream.write\",\n ],\n },\n {\n id: \"email-messaging\",\n label: \"Email & Messaging\",\n scopes: [\n \"cloud-email-security.read\",\n \"cloud-email-security.write\",\n \"email-routing-account-rule.read\",\n \"email-routing-address.read\",\n \"email-routing-address.write\",\n \"email-routing-rule.read\",\n \"email-routing-rule.write\",\n \"email-routing-suppression.read\",\n \"email-routing-suppression.write\",\n \"email-security-dmarcreports.read\",\n \"email-security-dmarcreports.write\",\n \"email-sending.read\",\n \"email-sending.write\",\n ],\n },\n {\n id: \"cache-performance\",\n label: \"Cache & Performance\",\n scopes: [\n \"account-ssl-and-certificates.read\",\n \"account-ssl-and-certificates.write\",\n \"cache.purge\",\n \"cache-settings.read\",\n \"cache-settings.write\",\n \"account-disable-esc.read\",\n \"account-disable-esc.write\",\n \"zone-disable-esc.read\",\n \"zone-disable-esc.write\",\n \"ssl-and-certificates.read\",\n \"ssl-and-certificates.write\",\n ],\n },\n {\n id: \"account-billing\",\n label: \"Account & Billing\",\n scopes: [\n \"account-api-gateway.read\",\n \"account-api-gateway.write\",\n \"account-custom-asset.read\",\n \"account-custom-asset.write\",\n \"account-settings.read\",\n \"account-settings.write\",\n \"apps.write\",\n \"integration.write\",\n \"memberships.read\",\n \"memberships.write\",\n \"notifications.read\",\n \"notifications.write\",\n \"scim-provisioning.write\",\n \"user-details.read\",\n \"user-details.write\",\n ],\n },\n {\n id: \"other\",\n label: \"Other\",\n scopes: [\n \"artifacts.read\",\n \"artifacts.write\",\n \"resource-library.read\",\n \"resource-library.write\",\n \"resource-sharing.read\",\n ],\n },\n];\n/** Human-readable names from Cloudflare's OAuth scope catalog. */\nexport const OAUTH_SCOPE_NAMES = {\n \"agent-memory.write\": \"Agent Memory Write\",\n \"browser-rendering.read\": \"Browser Run Read\",\n \"browser-rendering.write\": \"Browser Run Write\",\n \"cf-agents.read\": \"CF Agents Read\",\n \"cf-agents.write\": \"CF Agents Write\",\n \"cloud-connector.read\": \"Cloud Connector Read\",\n \"cloud-connector.write\": \"Cloud Connector Write\",\n \"cloudchamber.read\": \"Cloudchamber Read\",\n \"cloudchamber.write\": \"Cloudchamber Write\",\n \"constellation.read\": \"Constellation Read\",\n \"constellation.write\": \"Constellation Write\",\n \"d1.read\": \"D1 Read\",\n \"d1.write\": \"D1 Write\",\n \"flagship.evaluate\": \"Flagship Evaluate\",\n \"flagship.read\": \"Flagship Read\",\n \"flagship.write\": \"Flagship Write\",\n \"query-cache.read\": \"Hyperdrive Read\",\n \"query-cache.write\": \"Hyperdrive Write\",\n \"mcp-portals.read\": \"MCP Portals Read\",\n \"mcp-portals.write\": \"MCP Portals Write\",\n \"messaging.edit\": \"Messaging Edit\",\n \"messaging.read\": \"Messaging Read\",\n \"page.read\": \"Pages Read\",\n \"page.write\": \"Pages Write\",\n \"pipelines.read\": \"Pipelines Read\",\n \"pipelines.send\": \"Pipelines Send\",\n \"pipelines.write\": \"Pipelines Write\",\n \"pubsub.read\": \"Pubsub Configuration Read\",\n \"pubsub.write\": \"Pubsub Configuration Write\",\n \"queues.read\": \"Queues Read\",\n \"queues.write\": \"Queues Write\",\n \"realtime.write\": \"Realtime\",\n \"realtime.admin\": \"Realtime Admin\",\n \"realtime.read\": \"Realtime Read\",\n \"secrets-store.read\": \"Secrets Store Read\",\n \"secrets-store.write\": \"Secrets Store Write\",\n \"vectorize.read\": \"Vectorize Read\",\n \"vectorize.write\": \"Vectorize Write\",\n \"workers-ci.read\": \"Workers CI Read\",\n \"workers-ci.write\": \"Workers CI Write\",\n \"containers.read\": \"Workers Containers Read\",\n \"containers.write\": \"Workers Containers Write\",\n \"workers-scripts.edit\": \"Workers Editor\",\n \"workers-kv-storage.read\": \"Workers KV Storage Read\",\n \"workers-kv-storage.write\": \"Workers KV Storage Write\",\n \"workers-observability.read\": \"Workers Observability Read\",\n \"workers-observability-telemetry.write\": \"Workers Observability Telemetry Write\",\n \"workers-observability.write\": \"Workers Observability Write\",\n \"r2-catalog.read\": \"Workers R2 Data Catalog Read\",\n \"r2-catalog.write\": \"Workers R2 Data Catalog Write\",\n \"r2-catalog-sql.read\": \"Workers R2 SQL Read\",\n \"workers-r2-bucket-item.read\": \"Workers R2 Storage Bucket Item Read\",\n \"workers-r2-bucket-item.write\": \"Workers R2 Storage Bucket Item Write\",\n \"workers-r2.read\": \"Workers R2 Storage Read\",\n \"workers-r2.write\": \"Workers R2 Storage Write\",\n \"workers-routes.read\": \"Workers Routes Read\",\n \"workers-routes.write\": \"Workers Routes Write\",\n \"workers-scripts.bind\": \"Workers Scripts Bind\",\n \"workers-scripts.read\": \"Workers Scripts Read\",\n \"workers-scripts.write\": \"Workers Scripts Write\",\n \"workers-tail.read\": \"Workers Tail Read\",\n \"aiaudit.read\": \"AI Audit Read\",\n \"aiaudit.write\": \"AI Audit Write\",\n \"aig.read\": \"AI Gateway Read\",\n \"aig.run\": \"AI Gateway Run\",\n \"aig.write\": \"AI Gateway Write\",\n \"ai-search.index\": \"AI Search Index Engine\",\n \"ai-search.read\": \"AI Search Read\",\n \"ai-search.run\": \"AI Search Run\",\n \"ai-search.write\": \"AI Search Write\",\n \"agw.read\": \"Agents Gateway Read\",\n \"agw.run\": \"Agents Gateway Run\",\n \"agw.write\": \"Agents Gateway Write\",\n \"rag.read\": \"Auto Rag Read\",\n \"rag.write\": \"Auto Rag Write\",\n \"rag.run\": \"Auto Rag Write Run Engine\",\n \"firewall-for-ai.read\": \"Firewall for AI Read\",\n \"firewall-for-ai.write\": \"Firewall for AI Write\",\n \"websearch.read\": \"Websearch Read\",\n \"websearch.run\": \"Websearch Run\",\n \"websearch.write\": \"Websearch Write\",\n \"ai.read\": \"Workers AI Read\",\n \"ai.write\": \"Workers AI Write\",\n \"account-dns-settings.read\": \"Account DNS Settings Read\",\n \"account-dns-settings.write\": \"Account DNS Settings Write\",\n \"dns-firewall.read\": \"DNS Firewall Read\",\n \"dns-firewall.write\": \"DNS Firewall Write\",\n \"dns.read\": \"DNS Read\",\n \"dns-view.read\": \"DNS View Read\",\n \"dns-view.write\": \"DNS View Write\",\n \"dns.write\": \"DNS Write\",\n \"registrar-domains.admin\": \"Registrar Domains Admin\",\n \"registrar-domains.read\": \"Registrar Domains Read\",\n \"registrar-sandbox-domains.admin\": \"Registrar Sandbox Domains Admin\",\n \"registrar-sandbox-domains.read\": \"Registrar Sandbox Domains Read\",\n \"zone-custom-asset.read\": \"Zone Custom Asset Read\",\n \"zone-custom-asset.write\": \"Zone Custom Asset Write\",\n \"zone-dns-settings.read\": \"Zone DNS Settings Read\",\n \"zone-dns-settings.write\": \"Zone DNS Settings Write\",\n \"zone.read\": \"Zone Read\",\n \"zone-settings.read\": \"Zone Settings Read\",\n \"zone-settings.write\": \"Zone Settings Write\",\n \"zone-versioning.read\": \"Zone Versioning Read\",\n \"zone-versioning.write\": \"Zone Versioning Write\",\n \"zone.write\": \"Zone Write\",\n \"fraud-detection-pii.read\": \"Account Abuse Protection PII Read\",\n \"account-firewall-access-rules.read\": \"Account Firewall Access Rules Read\",\n \"account-firewall-access-rules.write\": \"Account Firewall Access Rules Write\",\n \"account-security-center-insights.read\": \"Account Security Center Insights Read\",\n \"account-security-center-insights.write\": \"Account Security Center Insights Write\",\n \"account-waf.read\": \"Account WAF Read\",\n \"account-waf.write\": \"Account WAF Write\",\n \"request-tracer.read\": \"Allow Request Tracer Read\",\n \"reports-application-security-report.read\": \"Application Security Reports Read\",\n \"bot-management-feedback.read\": \"Bot Management Feedback Report Read\",\n \"bot-management-feedback.write\": \"Bot Management Feedback Report Write\",\n \"bot-management.read\": \"Bot Management Read\",\n \"bot-management.write\": \"Bot Management Write\",\n \"cloudforce-one.read\": \"Cloudforce One Read\",\n \"cloudforce-one.write\": \"Cloudforce One Write\",\n \"ddos-botnet-feed.read\": \"DDoS Botnet Feed Read\",\n \"ddos-botnet-feed.write\": \"DDoS Botnet Feed Write\",\n \"ddos-protection.read\": \"DDoS Protection Read\",\n \"ddos-protection.write\": \"DDoS Protection Write\",\n \"api-gateway.write\": \"Domain API Gateway\",\n \"api-gateway.read\": \"Domain API Gateway Read\",\n \"domain-page.shield\": \"Domain Page Shield\",\n \"domain-page-shield.read\": \"Domain Page Shield Read\",\n \"field-extractor.read\": \"Field Extractors Read\",\n \"field-extractor.write\": \"Field Extractors Write\",\n \"firewall-services.read\": \"Firewall Services Read\",\n \"firewall-services.write\": \"Firewall Services Write\",\n \"fraud-detection.read\": \"Fraud Detection Read\",\n \"fraud-detection.write\": \"Fraud Detection Write\",\n \"fraud-events.write\": \"Fraud Events Write\",\n \"fraud-feedback.read\": \"Fraud Feedback Read\",\n \"fraud-feedback.write\": \"Fraud Feedback Write\",\n \"http-applications.read\": \"HTTP Applications Read\",\n \"http-applications.write\": \"HTTP Applications Write\",\n \"http-ddos-managed-ruleset.read\": \"HTTP DDoS Managed Ruleset Read\",\n \"http-ddos-managed-ruleset.write\": \"HTTP DDoS Managed Ruleset Write\",\n \"iot.read\": \"IOT Read\",\n \"iot.write\": \"IOT Write\",\n \"l4-ddos-managed-ruleset.read\": \"L4 DDoS Managed Ruleset Read\",\n \"l4-ddos-managed-ruleset.write\": \"L4 DDoS Managed Ruleset Write\",\n \"page-rules.read\": \"Page Rules Read\",\n \"page-rules.write\": \"Page Rules Write\",\n \"page.shield\": \"Page Shield\",\n \"page-shield.read\": \"Page Shield Read\",\n \"precursor.read\": \"Precursor Read\",\n \"precursor.write\": \"Precursor Write\",\n \"sanitize.read\": \"Sanitize Read\",\n \"sanitize.write\": \"Sanitize Write\",\n \"tag.read\": \"Tag Read\",\n \"tag.write\": \"Tag Write\",\n \"trust-and-safety.read\": \"Trust and Safety Read\",\n \"trust-and-safety.write\": \"Trust and Safety Write\",\n \"challenge-widgets.read\": \"Turnstile Sites Read\",\n \"challenge-widgets.write\": \"Turnstile Sites Write\",\n \"url-scanner.read\": \"URL Scanner Read\",\n \"url-scanner.write\": \"URL Scanner Write\",\n \"zaraz.write\": \"Zaraz Admin\",\n \"zaraz.edit\": \"Zaraz Edit\",\n \"zaraz.read\": \"Zaraz Read\",\n \"zone-security-center-insights.read\": \"Zone Security Center Insights Read\",\n \"zone-security-center-insights.write\": \"Zone Security Center Insights Write\",\n \"zone-waf.read\": \"Zone WAF Read\",\n \"zone-waf.write\": \"Zone WAF Write\",\n \"account-custom-error-rules.read\": \"Account Custom Error Rules Read\",\n \"account-custom-error-rules.write\": \"Account Custom Error Rules Write\",\n \"account-custom-pages.read\": \"Account Custom Pages Read\",\n \"account-custom-pages.write\": \"Account Custom Pages Write\",\n \"account-rule-lists.read\": \"Account Rule Lists Read\",\n \"account-rule-lists.write\": \"Account Rule Lists Write\",\n \"account-rulesets.read\": \"Account Rulesets Read\",\n \"account-rulesets.write\": \"Account Rulesets Write\",\n \"config-settings.read\": \"Config Settings Read\",\n \"config-settings.write\": \"Config Settings Write\",\n \"custom-errors.read\": \"Custom Errors Read\",\n \"custom-errors.write\": \"Custom Errors Write\",\n \"custom-pages.read\": \"Custom Pages Read\",\n \"custom-pages.write\": \"Custom Pages Write\",\n \"dynamic-redirect.read\": \"Dynamic URL Redirects Read\",\n \"dynamic-redirect.write\": \"Dynamic URL Redirects Write\",\n \"managed-headers.read\": \"Managed headers Read\",\n \"managed-headers.write\": \"Managed headers Write\",\n \"mass-url-redirects.read\": \"Mass URL Redirects Read\",\n \"mass-url-redirects.write\": \"Mass URL Redirects Write\",\n \"origin.read\": \"Origin Read\",\n \"origin.write\": \"Origin Write\",\n \"payments-gateway.read\": \"Payments Gateway Read\",\n \"payments-gateway.write\": \"Payments Gateway Write\",\n \"response-compression.read\": \"Response Compression Read\",\n \"response-compression.write\": \"Response Compression Write\",\n \"select-configuration.read\": \"Select Configuration Read\",\n \"select-configuration.write\": \"Select Configuration Write\",\n \"snippets.read\": \"Snippets Read\",\n \"snippets.write\": \"Snippets Write\",\n \"transform-rules.read\": \"Transform Rules Read\",\n \"transform-rules.write\": \"Transform Rules Write\",\n \"zone-transform-rules.read\": \"Zone Transform Rules Read\",\n \"zone-transform-rules.write\": \"Zone Transform Rules Write\",\n \"access-app.read\": \"Access: Apps Read\",\n \"access-app.revoke\": \"Access: Apps Revoke\",\n \"access-app.write\": \"Access: Apps Write\",\n \"access.read\": \"Access: Apps and Policies Read\",\n \"zone-access.read\": \"Access: Apps and Policies Read\",\n \"access.revoke\": \"Access: Apps and Policies Revoke\",\n \"zone-access.revoke\": \"Access: Apps and Policies Revoke\",\n \"access.write\": \"Access: Apps and Policies Write\",\n \"zone-access.write\": \"Access: Apps and Policies Write\",\n \"access-audit-log.read\": \"Access: Audit Logs Read\",\n \"access-custom-page.read\": \"Access: Custom Pages Read\",\n \"access-custom-page.write\": \"Access: Custom Pages Write\",\n \"access-device-posture.read\": \"Access: Device Posture Read\",\n \"access-device-posture.write\": \"Access: Device Posture Write\",\n \"access-group.read\": \"Access: Groups Read\",\n \"access-group.write\": \"Access: Groups Write\",\n \"access-idp.read\": \"Access: Identity Providers Read\",\n \"access-idp.write\": \"Access: Identity Providers Write\",\n \"access-key.read\": \"Access: Keys Read\",\n \"access-key.write\": \"Access: Keys Write\",\n \"access-certificate.read\": \"Access: Mutual TLS Certificates Read\",\n \"access-certificate.write\": \"Access: Mutual TLS Certificates Write\",\n \"access-org.read\": \"Access: Organizations Read\",\n \"access-org.revoke\": \"Access: Organizations Revoke\",\n \"access-org.write\": \"Access: Organizations Write\",\n \"access-acct.read\": \"Access: Organizations, Identity Providers, and Groups Read\",\n \"access-acct.revoke\": \"Access: Organizations, Identity Providers, and Groups Revoke\",\n \"access-acct.write\": \"Access: Organizations, Identity Providers, and Groups Write\",\n \"access-policy.read\": \"Access: Policies Read\",\n \"access-policy.write\": \"Access: Policies Write\",\n \"access-policy-test.read\": \"Access: Policy Test Read\",\n \"access-policy-test.write\": \"Access: Policy Test Write\",\n \"access-population.read\": \"Access: Population Read\",\n \"access-population.write\": \"Access: Population Write\",\n \"access-saml-certificate.read\": \"Access: SAML Certificates Read\",\n \"access-saml-certificate.write\": \"Access: SAML Certificates Write\",\n \"access-scim-log.read\": \"Access: SCIM Logs Read\",\n \"access-ssh-auditing.read\": \"Access: SSH Auditing Read\",\n \"access-ssh-auditing.write\": \"Access: SSH Auditing Write\",\n \"access-service-token.read\": \"Access: Service Tokens Read\",\n \"access-service-token.write\": \"Access: Service Tokens Write\",\n \"access-tag.read\": \"Access: Tags Read\",\n \"access-tag.write\": \"Access: Tags Write\",\n \"access-users.read\": \"Access: Users Read\",\n \"access-users.write\": \"Access: Users Write\",\n \"casb.read\": \"CASB Read\",\n \"casb.write\": \"CASB Write\",\n \"teams-cds-compute-account.read\": \"Cloudflare CDS Compute Account Read\",\n \"teams-cds-compute-account.write\": \"Cloudflare CDS Compute Account Write\",\n \"teams-dex.read\": \"Cloudflare DEX Read\",\n \"teams-dex.write\": \"Cloudflare DEX Write\",\n \"teams-connector-cloudflared.monitoring\": \"Cloudflare One Connector Monitoring: cloudflared\",\n \"teams-connector-warp.read\": \"Cloudflare One Connector: WARP Read\",\n \"teams-connector-warp.write\": \"Cloudflare One Connector: WARP Write\",\n \"teams-connector-cloudflared.read\": \"Cloudflare One Connector: cloudflared Read\",\n \"teams-connector-cloudflared.write\": \"Cloudflare One Connector: cloudflared Write\",\n \"teams-connectors.read\": \"Cloudflare One Connectors Read\",\n \"teams-connectors.write\": \"Cloudflare One Connectors Write\",\n \"teams-networks.read\": \"Cloudflare One Networks Read\",\n \"teams-networks.write\": \"Cloudflare One Networks Write\",\n \"argotunnel.read\": \"Cloudflare Tunnel Read\",\n \"argotunnel.write\": \"Cloudflare Tunnel Write\",\n \"teams-secure.location\": \"Cloudflare Zero Trust Secure DNS Locations Write\",\n \"dls.read\": \"DLS: Read\",\n \"dls.write\": \"DLS: Write\",\n \"teams.read\": \"Zero Trust Read\",\n \"teams.report\": \"Zero Trust Report\",\n \"teams-resilience.read\": \"Zero Trust Resilience Read\",\n \"teams-resilience.write\": \"Zero Trust Resilience Write\",\n \"teams.write\": \"Zero Trust Write\",\n \"teams-pii.read\": \"Zero Trust: PII Read\",\n \"access-seats.write\": \"Zero Trust: Seats Write\",\n \"account-analytics.read\": \"Account Analytics Read\",\n \"analytics.read\": \"Analytics Read\",\n \"intel.read\": \"Intel Read\",\n \"intel.write\": \"Intel Write\",\n \"account-logs.read\": \"Logs Read\",\n \"logs.read\": \"Logs Read\",\n \"account-logs.write\": \"Logs Write\",\n \"logs.write\": \"Logs Write\",\n \"radar.read\": \"Radar Read\",\n \"account-waiting-rooms.read\": \"Account Waiting Rooms Read\",\n \"address-maps.read\": \"Address Maps Read\",\n \"address-maps.write\": \"Address Maps Write\",\n \"chinanetwork-steering.read\": \"China Network Steering Read\",\n \"chinanetwork-steering.write\": \"China Network Steering Write\",\n \"connectivity-directory.admin\": \"Connectivity Directory Admin\",\n \"connectivity-directory.bind\": \"Connectivity Directory Bind\",\n \"connectivity-directory.read\": \"Connectivity Directory Read\",\n \"healthcheck.read\": \"Health Checks Read\",\n \"healthcheck.write\": \"Health Checks Write\",\n \"ip-prefix-bgp-on-demand.read\": \"IP Prefixes: BGP On Demand Read\",\n \"ip-prefix-bgp-on-demand.write\": \"IP Prefixes: BGP On Demand Write\",\n \"ip-prefix.read\": \"IP Prefixes: Read\",\n \"ip-prefix.write\": \"IP Prefixes: Write\",\n \"load-balancers-account.read\": \"Load Balancers Account Read\",\n \"load-balancers-account.write\": \"Load Balancers Account Write\",\n \"load-balancers.read\": \"Load Balancers Read\",\n \"load-balancers.write\": \"Load Balancers Write\",\n \"load-balancing-monitors-and-pools.read\": \"Load Balancing: Monitors and Pools Read\",\n \"load-balancing-monitors-and-pools.write\": \"Load Balancing: Monitors and Pools Write\",\n \"pcaps-api.read\": \"Magic Firewall Packet Captures - Read PCAPs API\",\n \"pcaps-api.write\": \"Magic Firewall Packet Captures - Write PCAPs API\",\n \"magic-firewall.read\": \"Magic Firewall Read\",\n \"magic-firewall.write\": \"Magic Firewall Write\",\n \"fbm.admin\": \"Magic Network Monitoring Admin\",\n \"fbm.read\": \"Magic Network Monitoring Config Read\",\n \"fbm.write\": \"Magic Network Monitoring Config Write\",\n \"magic-transit.read\": \"Magic Transit Read\",\n \"magic-transit.write\": \"Magic Transit Write\",\n \"magic-wan.read\": \"Magic WAN Read\",\n \"magic-wan.write\": \"Magic WAN Write\",\n \"waiting-rooms.read\": \"Waiting Rooms Read\",\n \"waiting-rooms.write\": \"Waiting Rooms Write\",\n \"web3-hostnames.read\": \"Web3 Hostnames Read\",\n \"web3-hostnames.write\": \"Web3 Hostnames Write\",\n \"calls.read\": \"Calls Read\",\n \"calls.write\": \"Calls Write\",\n \"images.read\": \"Images Read\",\n \"images.write\": \"Images Write\",\n \"moq.read\": \"MoQ Read\",\n \"moq.write\": \"MoQ Write\",\n \"stream.read\": \"Stream Read\",\n \"stream.write\": \"Stream Write\",\n \"cloud-email-security.read\": \"Cloud Email Security: Read\",\n \"cloud-email-security.write\": \"Cloud Email Security: Write\",\n \"email-routing-account-rule.read\": \"Email Routing Account Rules Read\",\n \"email-routing-address.read\": \"Email Routing Addresses Read\",\n \"email-routing-address.write\": \"Email Routing Addresses Write\",\n \"email-routing-rule.read\": \"Email Routing Rules Read\",\n \"email-routing-rule.write\": \"Email Routing Rules Write\",\n \"email-routing-suppression.read\": \"Email Routing Suppressions Read\",\n \"email-routing-suppression.write\": \"Email Routing Suppressions Write\",\n \"email-security-dmarcreports.read\": \"Email Security DMARC Reports Read\",\n \"email-security-dmarcreports.write\": \"Email Security DMARC Reports Write\",\n \"email-sending.read\": \"Email Sending Read\",\n \"email-sending.write\": \"Email Sending Write\",\n \"account-ssl-and-certificates.read\": \"Account: SSL and Certificates Read\",\n \"account-ssl-and-certificates.write\": \"Account: SSL and Certificates Write\",\n \"cache.purge\": \"Cache Purge\",\n \"cache-settings.read\": \"Cache Settings Read\",\n \"cache-settings.write\": \"Cache Settings Write\",\n \"account-disable-esc.read\": \"Disable ESC Read\",\n \"zone-disable-esc.read\": \"Disable ESC Read\",\n \"account-disable-esc.write\": \"Disable ESC Write\",\n \"zone-disable-esc.write\": \"Disable ESC Write\",\n \"ssl-and-certificates.read\": \"SSL and Certificates Read\",\n \"ssl-and-certificates.write\": \"SSL and Certificates Write\",\n \"account-api-gateway.write\": \"Account API Gateway\",\n \"account-api-gateway.read\": \"Account API Gateway Read\",\n \"account-custom-asset.read\": \"Account Custom Asset Read\",\n \"account-custom-asset.write\": \"Account Custom Asset Write\",\n \"account-settings.read\": \"Account Settings Read\",\n \"account-settings.write\": \"Account Settings Write\",\n \"apps.write\": \"Apps Write\",\n \"integration.write\": \"Integration Write\",\n \"memberships.read\": \"Memberships Read\",\n \"memberships.write\": \"Memberships Write\",\n \"notifications.read\": \"Notifications Read\",\n \"notifications.write\": \"Notifications Write\",\n \"scim-provisioning.write\": \"SCIM Provisioning\",\n \"user-details.read\": \"User Details Read\",\n \"user-details.write\": \"User Details Write\",\n \"artifacts.read\": \"Artifacts Read\",\n \"artifacts.write\": \"Artifacts Write\",\n \"resource-library.read\": \"Resource Library Read\",\n \"resource-library.write\": \"Resource Library Write\",\n \"resource-sharing.read\": \"Resource Sharing Read\",\n};\n/** Flat lookup retained for consumers that do not need grouping metadata. */\nexport const ALL_SCOPES = Object.fromEntries(OAUTH_SCOPE_GROUPS.flatMap((group) => group.scopes.map((scope) => [scope, group.label])));\n/** Every scope available to the public Alchemy OAuth client. */\nexport const ALL_SCOPE_IDS = OAUTH_SCOPE_GROUPS.flatMap((group) => group.scopes);\n/**\n * Split stored scopes into those the current OAuth client offers and those\n * it does not. Profiles configured against an older client (or scope\n * catalog) can hold scopes the current client rejects, and a single unknown\n * scope invalidates the entire authorize URL — sanitize with this before\n * building one.\n */\nexport const partitionOAuthScopes = (scopes) => {\n const known = new Set(ALL_SCOPE_IDS);\n return {\n valid: scopes.filter((scope) => known.has(scope)),\n dropped: scopes.filter((scope) => !known.has(scope)),\n };\n};\n/**\n * Initial selections for the custom-scope prompt. Reconfiguration restores\n * the existing OAuth grant while dropping scopes no longer offered by the\n * current client; first-time and stored-credential setup select every scope.\n */\nexport const customOAuthScopeDefaults = (currentConfig) => currentConfig?.method === \"oauth\" && currentConfig.scopes !== undefined\n ? partitionOAuthScopes(currentConfig.scopes).valid\n : [...ALL_SCOPE_IDS];\n/** Reusable scope bundles for common OAuth authorization flows. */\nexport const OAUTH_SCOPE_TEMPLATES = {\n basic: [\n \"memberships.read\",\n \"user-details.read\",\n \"account-settings.read\",\n \"ai-search.run\",\n \"ai-search.write\",\n \"ai.write\",\n \"aig.read\",\n \"aig.run\",\n \"aig.write\",\n \"cloudchamber.write\",\n \"connectivity-directory.admin\",\n \"containers.write\",\n \"d1.write\",\n \"page.write\",\n \"pipelines.send\",\n \"pipelines.write\",\n \"queues.write\",\n \"secrets-store.write\",\n \"account-ssl-and-certificates.write\",\n \"ssl-and-certificates.write\",\n \"vectorize.write\",\n \"workers-kv-storage.write\",\n \"workers-observability.read\",\n \"workers-observability.write\",\n \"workers-observability-telemetry.write\",\n \"workers-r2.write\",\n \"workers-routes.write\",\n \"workers-scripts.write\",\n \"workers-tail.read\",\n \"zone.read\",\n ],\n};\nexport const BASIC_SCOPES = OAUTH_SCOPE_TEMPLATES.basic;\n//# sourceMappingURL=OAuthScopes.js.map","import * as cfAccounts from \"@distilled.cloud/cloudflare/accounts\";\nimport * as cfMemberships from \"@distilled.cloud/cloudflare/memberships\";\nimport * as CfCredentialsModule from \"@distilled.cloud/cloudflare/Credentials\";\nimport * as Clock from \"effect/Clock\";\nimport * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Match from \"effect/Match\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as Schema from \"effect/Schema\";\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\";\nimport * as HttpClient from \"effect/unstable/http/HttpClient\";\nimport { AuthError, AuthProviderLayer, NeedsReauth, reconfigureHint, refreshHint, } from \"../../Auth/AuthProvider.js\";\nimport { storedSecret, storedValueText, validateFieldValues, } from \"../../Auth/StoredAuthProvider.js\";\nimport { CredentialsStore, displayRedacted } from \"../../Auth/Credentials.js\";\nimport { withProfileCredentialsLock } from \"../../Auth/Lock.js\";\nimport { getEnvRedacted, getEnvRequired, mapPromptCancellation, } from \"../../Auth/Env.js\";\nimport { browserOAuth } from \"../../Auth/BrowserOAuth.js\";\nimport * as Interaction from \"../../Interaction.js\";\nimport { CREDENTIALS_FILE as STATE_STORE_CREDENTIALS_FILE } from \"../StateStore/CredentialsFile.js\";\nimport * as OAuthClient from \"./OAuthClient.js\";\nimport { CLOUDFLARE_AUTH_PROVIDER_NAME, CloudflareAuthConfigSchema, validateAccountId, validateAccountIdField, } from \"./AuthConfig.js\";\nimport { ALL_SCOPE_IDS, BASIC_SCOPES, customOAuthScopeDefaults, OAUTH_SCOPE_GROUPS, OAUTH_SCOPE_NAMES, partitionOAuthScopes, } from \"./OAuthScopes.js\";\nconst options = [\n {\n value: \"oauth\",\n label: \"OAuth\",\n description: \"recommended — browser-based login with automatic token refresh\",\n },\n {\n value: \"stored\",\n label: \"API Token or API Key\",\n description: \"use an API token or global API key\",\n },\n];\nconst withOAuthCredentials = (accessToken, effect) => Effect.provide(effect, Layer.mergeAll(CfCredentialsModule.fromOAuth({\n load: Effect.succeed({ accessToken }),\n refresh: () => Effect.die(\"refresh not expected during account selection\"),\n}), FetchHttpClient.layer));\n/**\n * Accounts visible to a user-scoped OAuth token. `GET /accounts` returns an\n * EMPTY list for these tokens (it only lists accounts an account-scoped\n * credential can read), so memberships are the authoritative account list —\n * the same endpoint wrangler uses. `GET /accounts` remains as a fallback for\n * tokens authorized without `memberships.read` (custom scope selections).\n */\nconst listVisibleAccounts = Effect.gen(function* () {\n const listMemberships = yield* cfMemberships.listMemberships;\n const membershipAccounts = yield* listMemberships({}).pipe(Effect.map((response) => response.result.flatMap((membership) => membership.account != null &&\n (membership.status == null || membership.status === \"accepted\")\n ? [membership.account]\n : [])), Effect.catch((error) => Effect.logDebug(\"Cloudflare: listing memberships failed\", error).pipe(Effect.as([]))));\n if (membershipAccounts.length > 0)\n return membershipAccounts;\n const listAccounts = yield* cfAccounts.listAccounts;\n const response = yield* listAccounts({});\n yield* Effect.logDebug(`Cloudflare: memberships listed 0 accounts; /accounts listed ${response.result.length}`);\n return response.result;\n});\nconst selectAccount = (accessToken) => Effect.gen(function* () {\n const interaction = Interaction.accessors;\n const accounts = yield* listVisibleAccounts;\n if (accounts.length === 0) {\n return yield* new AuthError({\n message: \"No Cloudflare accounts are visible to this credential. \" +\n \"Ensure the authorized OAuth scopes include 'memberships.read'.\",\n });\n }\n const [account] = accounts;\n if (accounts.length === 1 && account !== undefined) {\n yield* interaction.output.info(`Using Cloudflare account ${account.name}.`);\n return account.id;\n }\n return yield* interaction.prompt\n .select({\n message: \"Select a Cloudflare account\",\n searchable: true,\n options: accounts.map((a) => ({\n value: a.id,\n label: a.name,\n description: a.id,\n })),\n })\n .pipe(mapPromptCancellation);\n}).pipe((e) => withOAuthCredentials(accessToken, e));\nconst promptAccountId = () => Effect.gen(function* () {\n const interaction = yield* Interaction.Interaction;\n return yield* interaction.prompt\n .text({\n message: \"Cloudflare Account ID\",\n validate: validateAccountIdField,\n })\n .pipe(mapPromptCancellation);\n});\nconst accountIdField = {\n name: \"accountId\",\n label: \"Cloudflare Account ID\",\n validate: validateAccountIdField,\n};\n/**\n * `--set` fields for `--method stored`. The persisted `credentialType` is\n * inferred from which secret is supplied: `apiToken` alone, or `apiKey`\n * together with `email`.\n */\nconst storedFields = [\n {\n name: \"apiToken\",\n label: \"Cloudflare API Token\",\n description: \"Pass either apiToken, or apiKey together with email.\",\n secret: true,\n optional: true,\n },\n { name: \"apiKey\", label: \"Cloudflare API Key\", secret: true, optional: true },\n { name: \"email\", label: \"Cloudflare Email\", optional: true },\n accountIdField,\n];\n/**\n * Flag-driven configuration methods. OAuth is deliberately absent — it is\n * interactive-only (browser grant).\n */\nconst configureMethods = [\n { method: \"stored\", fields: storedFields },\n];\nconst promptOAuthScopes = (currentConfig) => Effect.gen(function* () {\n const interaction = yield* Interaction.Interaction;\n const mode = yield* interaction.prompt\n .select({\n message: \"Cloudflare OAuth scopes\",\n initialValue: \"all\",\n options: [\n {\n value: \"all\",\n label: \"All Scopes\",\n description: \"authorize every available Cloudflare permission\",\n },\n {\n value: \"basic\",\n label: \"Basic Scopes\",\n description: \"covers typical Alchemy use cases\",\n },\n {\n value: \"custom\",\n label: \"Custom Scopes\",\n description: \"choose individual permissions\",\n },\n ],\n })\n .pipe(mapPromptCancellation);\n if (mode === \"basic\")\n return [...BASIC_SCOPES];\n if (mode === \"all\")\n return [...ALL_SCOPE_IDS];\n return yield* interaction.prompt\n .multiSelect({\n message: \"Select OAuth scopes\",\n initialValues: customOAuthScopeDefaults(currentConfig),\n searchable: true,\n descriptionPlacement: \"inline\",\n options: OAUTH_SCOPE_GROUPS.flatMap((group) => group.scopes.map((value) => ({\n value,\n label: OAUTH_SCOPE_NAMES[value],\n description: value,\n group: group.label,\n }))),\n required: true,\n })\n .pipe(mapPromptCancellation);\n});\n/**\n * Layer that registers the Cloudflare {@link AuthProvider} into the\n * {@link AuthProviders} registry when built. Include this in the Cloudflare\n * `providers()` layer so the alchemy CLI can discover it.\n */\nexport const CloudflareAuth = AuthProviderLayer()(CLOUDFLARE_AUTH_PROVIDER_NAME, Effect.gen(function* () {\n const interaction = Interaction.accessors;\n const store = yield* CredentialsStore;\n const oauthLogin = (_profileName, scopes) => Effect.gen(function* () {\n const authorization = yield* OAuthClient.authorize([\n ...scopes,\n \"offline_access\",\n ]);\n const credentials = yield* browserOAuth({\n provider: \"Cloudflare\",\n url: authorization.url,\n callback: OAuthClient.callback(authorization),\n exchange: (input) => OAuthClient.exchangeCallbackInput(input, authorization),\n });\n yield* interaction.output.success(\"Connected to Cloudflare with OAuth.\");\n return credentials;\n });\n const loginStored = Effect.fn(function* (profileName) {\n const credentialType = yield* interaction.prompt\n .select({\n message: \"Cloudflare credential type\",\n options: [\n {\n value: \"apiToken\",\n label: \"API Token\",\n description: \"recommended\",\n },\n { value: \"apiKey\", label: \"API Key + Email\" },\n ],\n })\n .pipe(mapPromptCancellation);\n return yield* Match.value(credentialType).pipe(Match.when(\"apiToken\", () => Effect.gen(function* () {\n const apiToken = yield* interaction.prompt\n .password({\n message: \"Cloudflare API Token\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n })\n .pipe(mapPromptCancellation, Effect.map(Redacted.make));\n const accountId = yield* promptAccountId();\n yield* interaction.output.success(\"Cloudflare: credentials saved.\");\n return {\n method: \"stored\",\n credentialType: \"apiToken\",\n apiToken: Redacted.value(apiToken),\n accountId,\n };\n })), Match.when(\"apiKey\", () => Effect.gen(function* () {\n const apiKey = yield* interaction.prompt\n .password({\n message: \"Cloudflare API Key\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n })\n .pipe(mapPromptCancellation, Effect.map(Redacted.make));\n const email = yield* interaction.prompt\n .text({\n message: \"Cloudflare Email\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n })\n .pipe(mapPromptCancellation, Effect.map(Redacted.make));\n const accountId = yield* promptAccountId();\n yield* interaction.output.success(\"Cloudflare: credentials saved.\");\n return {\n method: \"stored\",\n credentialType: \"apiKey\",\n apiKey: Redacted.value(apiKey),\n email: Redacted.value(email),\n accountId,\n };\n })), Match.exhaustive);\n });\n const configureOAuth = Effect.fn(function* (profileName, currentConfig) {\n const scopes = yield* promptOAuthScopes(currentConfig);\n const oauthCreds = yield* oauthLogin(profileName, [...scopes]);\n const accountId = yield* selectAccount(Redacted.value(oauthCreds.access)).pipe(\n // Keep AuthError messages intact — they carry the actionable\n // diagnosis (e.g. \"no accounts visible\"); only wrap raw API errors.\n Effect.mapError((e) => e instanceof AuthError\n ? e\n : new AuthError({\n message: \"Cloudflare: could not list accounts\",\n cause: e,\n })));\n return {\n method: \"oauth\",\n scopes: [...scopes],\n accountId,\n clientId: oauthCreds.clientId,\n access: Redacted.value(oauthCreds.access),\n refresh: Redacted.value(oauthCreds.refresh),\n expires: oauthCreds.expires,\n };\n });\n const configureInteractive = (profileName, currentConfig) => interaction.prompt\n .select({\n message: \"Cloudflare authentication method\",\n options,\n })\n .pipe(Effect.flatMap((method) => Match.value(method).pipe(Match.when(\"oauth\", () => configureOAuth(profileName, currentConfig)), Match.when(\"stored\", () => loginStored(profileName)), Match.exhaustive)));\n const configureCredentials = (profileName, currentConfig) => Effect.gen(function* () {\n const config = yield* configureInteractive(profileName, currentConfig);\n // Re-configuring auth may point this profile at a different\n // Cloudflare account. The cached state-store credentials\n // (`~/.alchemy/credentials/{profile}/cloudflare-state-store.json`)\n // are minted per-account, so drop them here; the next deploy\n // re-derives them against the freshly-configured account.\n yield* store\n .delete(profileName, STATE_STORE_CREDENTIALS_FILE)\n .pipe(Effect.ignore);\n return config;\n }).pipe(\n // AuthError messages are already user-facing; re-wrapping them in a\n // generic banner is what hid \"no accounts visible\" behind\n // \"failed to configure credentials\".\n Effect.mapError((e) => e instanceof AuthError\n ? e\n : new AuthError({\n message: \"failed to configure credentials\",\n cause: e,\n })));\n const resolveCredentials = (profileName, config, updateConfig) => Effect.gen(function* () {\n const reauth = refreshHint(CLOUDFLARE_AUTH_PROVIDER_NAME, profileName);\n return yield* Match.value(config).pipe(Match.when({ method: \"stored\", credentialType: \"apiToken\" }, (c) => validateAccountId(c.accountId, `stored for profile '${profileName}'`).pipe(Effect.map((accountId) => ({\n type: \"apiToken\",\n apiToken: Redacted.make(c.apiToken),\n accountId,\n source: { type: \"stored\" },\n })))), Match.when({ method: \"stored\", credentialType: \"apiKey\" }, (c) => validateAccountId(c.accountId, `stored for profile '${profileName}'`).pipe(Effect.map((accountId) => ({\n type: \"apiKey\",\n apiKey: Redacted.make(c.apiKey),\n email: Redacted.make(c.email),\n accountId,\n source: { type: \"stored\" },\n })))), Match.when({ method: \"oauth\" }, (cfg) => Effect.gen(function* () {\n if (!(\"scopes\" in cfg)) {\n return yield* Effect.fail(new NeedsReauth({\n provider: CLOUDFLARE_AUTH_PROVIDER_NAME,\n profile: profileName,\n message: `Cloudflare OAuth scopes need to be selected. ${reauth}`,\n }));\n }\n const accountId = yield* validateAccountId(cfg.accountId, `configured for profile '${profileName}'`);\n const creds = {\n type: \"oauth\",\n clientId: cfg.clientId,\n access: Redacted.make(cfg.access),\n refresh: Redacted.make(cfg.refresh),\n expires: cfg.expires,\n scopes: cfg.scopes,\n };\n if (!OAuthClient.usesCurrentClient(creds)) {\n return yield* Effect.fail(new NeedsReauth({\n provider: CLOUDFLARE_AUTH_PROVIDER_NAME,\n profile: profileName,\n message: `Cloudflare OAuth credentials for profile '${profileName}' were issued to an incompatible OAuth client and have been removed. ${reauth}`,\n }));\n }\n // Refresh proactively if the token has expired (or is within\n // 10s of expiring). Persist the refreshed creds so subsequent\n // resolves don't repeat the round-trip.\n const now = yield* Clock.currentTimeMillis;\n const fresh = creds.expires > now + 10_000\n ? creds\n : yield* OAuthClient.refresh(creds).pipe(Effect.mapError((e) => new NeedsReauth({\n provider: CLOUDFLARE_AUTH_PROVIDER_NAME,\n profile: profileName,\n message: `Cloudflare OAuth refresh failed. ${reauth}`,\n cause: e,\n })));\n if (fresh !== creds) {\n yield* (updateConfig?.({\n method: \"oauth\",\n accountId,\n clientId: fresh.clientId,\n access: Redacted.value(fresh.access),\n refresh: Redacted.value(fresh.refresh),\n expires: fresh.expires,\n scopes: fresh.scopes,\n }) ?? Effect.void);\n }\n return {\n type: \"oauth\",\n accessToken: fresh.access,\n expires: fresh.expires,\n accountId,\n source: { type: \"oauth\" },\n };\n })), Match.exhaustive);\n });\n const readEnvironment = Effect.gen(function* () {\n const accountId = yield* getEnvRequired(\"CLOUDFLARE_ACCOUNT_ID\").pipe(Effect.flatMap((id) => validateAccountId(id, \"from CLOUDFLARE_ACCOUNT_ID\")));\n const apiToken = yield* getEnvRedacted(\"CLOUDFLARE_API_TOKEN\");\n if (apiToken) {\n return {\n type: \"apiToken\",\n apiToken,\n accountId,\n source: { type: \"env\" },\n };\n }\n const apiKey = yield* getEnvRedacted(\"CLOUDFLARE_API_KEY\");\n const email = (yield* getEnvRedacted(\"CLOUDFLARE_EMAIL\")) ??\n (yield* getEnvRedacted(\"CLOUDFLARE_ACCOUNT_EMAIL\"));\n if (apiKey && email) {\n return {\n type: \"apiKey\",\n apiKey,\n email,\n accountId,\n source: { type: \"env\" },\n };\n }\n return yield* new AuthError({\n message: \"Cloudflare CI credentials not found. Set CLOUDFLARE_API_TOKEN, or CLOUDFLARE_API_KEY with CLOUDFLARE_EMAIL/CLOUDFLARE_ACCOUNT_EMAIL.\",\n });\n });\n const logout = (profileName, config) => Match.value(config)\n .pipe(Match.when({ method: \"stored\" }, () => Effect.void), Match.when({ method: \"oauth\" }, (config) => {\n if (!(\"scopes\" in config))\n return Effect.void;\n const credentials = {\n type: \"oauth\",\n clientId: config.clientId,\n access: Redacted.make(config.access),\n refresh: Redacted.make(config.refresh),\n expires: config.expires,\n scopes: config.scopes,\n };\n return OAuthClient.usesCurrentClient(credentials)\n ? OAuthClient.revoke(credentials).pipe(Effect.catchTag(\"OAuthError\", (err) => interaction.output.warning(`Cloudflare: could not revoke OAuth token: ${err.errorDescription}`)))\n : Effect.void;\n }), Match.exhaustive)\n // The cached state-store credentials are derived from the account we\n // just logged out of, so drop them regardless of auth method.\n .pipe(Effect.andThen(store\n .delete(profileName, STATE_STORE_CREDENTIALS_FILE)\n .pipe(Effect.ignore)));\n const login = (profileName, config, updateConfig) => Match.value(config)\n .pipe(Match.when({ method: \"stored\" }, (config) => Effect.succeed(config)), Match.when({ method: \"oauth\" }, (c) => \"scopes\" in c\n ? Effect.gen(function* () {\n const creds = {\n type: \"oauth\",\n clientId: c.clientId,\n access: Redacted.make(c.access),\n refresh: Redacted.make(c.refresh),\n expires: c.expires,\n scopes: c.scopes,\n };\n const reconfigure = reconfigureHint(CLOUDFLARE_AUTH_PROVIDER_NAME, profileName);\n // Any path that falls back to a full browser login rebuilds the\n // authorize URL from the profile's stored scopes. Those scopes\n // may predate the current OAuth client (or a catalog change), and\n // one unknown scope makes the whole authorize URL invalid — so\n // sanitize before generating a URL, never after it fails.\n const fullLogin = Effect.gen(function* () {\n const { valid, dropped } = partitionOAuthScopes(c.scopes);\n if (valid.length === 0) {\n return yield* Effect.fail(new AuthError({\n message: `The OAuth scopes stored for profile '${profileName}' are no longer offered by Alchemy's Cloudflare OAuth client. ` +\n `Scopes must be picked again. ${reconfigure}`,\n }));\n }\n const refreshed = yield* (dropped.length === 0\n ? Effect.void\n : interaction.output.warning(`Cloudflare: dropping ${dropped.length} stored scope${dropped.length === 1 ? \"\" : \"s\"} no longer offered by the current OAuth client (${dropped.join(\", \")}). ` +\n `Scopes must be picked again. ${reconfigure}`)).pipe(Effect.andThen(oauthLogin(profileName, valid)));\n return {\n ...c,\n scopes: valid,\n clientId: refreshed.clientId,\n access: Redacted.value(refreshed.access),\n refresh: Redacted.value(refreshed.refresh),\n expires: refreshed.expires,\n };\n });\n // The silent refresh rotates a single-use refresh token, so\n // its read-refresh-persist section runs under the profile\n // lock — a concurrent `read` refreshing the same token would\n // double-spend it. The lock is held only for this API\n // round-trip, never across the browser wait below.\n const outcome = creds.type === \"oauth\" &&\n OAuthClient.usesCurrentClient(creds)\n ? yield* withProfileCredentialsLock(profileName, interaction.output\n .info(\"Cloudflare: refreshing OAuth credentials...\")\n .pipe(Effect.andThen(OAuthClient.refresh(creds)), Effect.flatMap((credentials) => {\n const config = {\n ...c,\n clientId: credentials.clientId,\n access: Redacted.value(credentials.access),\n refresh: Redacted.value(credentials.refresh),\n expires: credentials.expires,\n scopes: credentials.scopes,\n };\n return (updateConfig?.(config) ?? Effect.void).pipe(Effect.as({\n type: \"refreshed\",\n config,\n }));\n }), Effect.tap(() => interaction.output.success(\"Cloudflare: OAuth credentials refreshed.\")), Effect.catchTag(\"OAuthError\", () => Effect.succeed({ type: \"browser\" }))))\n : yield* Effect.gen(function* () {\n if (creds.type === \"oauth\") {\n yield* interaction.output.warning(\"Cloudflare: removed OAuth credentials issued to the previous client.\");\n }\n return { type: \"browser\" };\n });\n if (outcome.type === \"browser\") {\n return yield* fullLogin;\n }\n return outcome.config;\n })\n : configureOAuth(profileName, c)), Match.exhaustive)\n .pipe(\n // A blanket mapError must never swallow the NeedsReauth tag —\n // the profile UI matches on it to render \"needs re-login\".\n Effect.mapError((e) => e instanceof NeedsReauth\n ? e\n : new AuthError({ message: \"login failed\", cause: e })));\n const details = (profileName, config, updateConfig) => Effect.all([\n resolveCredentials(profileName, config, updateConfig),\n Clock.currentTimeMillis,\n ]).pipe(Effect.map(([creds, now]) => {\n const source = {\n key: \"source\",\n value: \"details\" in creds.source && creds.source.details\n ? `${creds.source.type} - ${creds.source.details}`\n : creds.source.type,\n };\n return {\n lines: Match.value(creds).pipe(Match.when({ type: \"apiToken\" }, (c) => [\n { key: \"apiToken\", value: displayRedacted(c.apiToken, 9) },\n { key: \"accountId\", value: c.accountId },\n source,\n ]), Match.when({ type: \"apiKey\" }, (c) => [\n { key: \"apiKey\", value: displayRedacted(c.apiKey) },\n { key: \"email\", value: displayRedacted(c.email) },\n { key: \"accountId\", value: c.accountId },\n source,\n ]), Match.when({ type: \"oauth\" }, (c) => {\n const remainingMs = c.expires - now;\n const expiresAt = new Date(c.expires).toISOString();\n const expiresStr = remainingMs <= 0\n ? `expired (${expiresAt})`\n : `in ${Duration.format(Duration.millis(remainingMs))} (${expiresAt})`;\n return [\n { key: \"accessToken\", value: displayRedacted(c.accessToken) },\n { key: \"expires\", value: expiresStr },\n { key: \"accountId\", value: c.accountId },\n source,\n ];\n }), Match.exhaustive),\n };\n }));\n /**\n * Persist flag-provided stored credentials (`--method stored`). Writes\n * the same `cloudflare-stored` file the interactive stored path writes;\n * OAuth is interactive-only and not accepted here.\n */\n const configureWith = (profileName, input) => {\n const persist = (config) => store\n .delete(profileName, STATE_STORE_CREDENTIALS_FILE)\n .pipe(Effect.ignore, Effect.as(config));\n if (input.method !== \"stored\") {\n return Effect.fail(new AuthError({\n message: `Cloudflare: unknown method '${input.method}'. Valid methods: stored. (OAuth is interactive-only.)`,\n }));\n }\n return validateFieldValues(CLOUDFLARE_AUTH_PROVIDER_NAME, storedFields, input.values).pipe(Effect.flatMap((values) => {\n const accountId = (storedValueText(values.accountId) ?? \"\")\n .trim()\n .toLowerCase();\n const apiToken = storedSecret(values.apiToken);\n const apiKey = storedSecret(values.apiKey);\n const email = storedValueText(values.email);\n if (apiToken !== undefined &&\n apiKey === undefined &&\n email === undefined) {\n return persist({\n method: \"stored\",\n credentialType: \"apiToken\",\n apiToken: Redacted.value(apiToken),\n accountId,\n });\n }\n if (apiToken === undefined &&\n apiKey !== undefined &&\n email !== undefined) {\n return persist({\n method: \"stored\",\n credentialType: \"apiKey\",\n apiKey: Redacted.value(apiKey),\n email,\n accountId,\n });\n }\n return Effect.fail(new AuthError({\n message: \"Cloudflare: pass either --set apiToken=<token>, or both --set apiKey=<key> and --set email=<email>.\",\n }));\n }));\n };\n return {\n configSchema: CloudflareAuthConfigSchema,\n configure: configureCredentials,\n configureWith,\n configureMethods,\n logout,\n login,\n details,\n read: resolveCredentials,\n readEnvironment,\n environment: [\n {\n name: \"CLOUDFLARE_ACCOUNT_ID\",\n required: true,\n description: \"Account the stack deploys into.\",\n },\n {\n name: \"CLOUDFLARE_API_TOKEN\",\n required: true,\n secret: true,\n alternatives: [\"CLOUDFLARE_API_KEY\"],\n description: \"API token (preferred). Not consulted when unset and CLOUDFLARE_API_KEY + CLOUDFLARE_EMAIL are provided instead.\",\n },\n {\n name: \"CLOUDFLARE_API_KEY\",\n required: false,\n secret: true,\n description: \"Global API key; used with CLOUDFLARE_EMAIL when no API token is set.\",\n },\n {\n name: \"CLOUDFLARE_EMAIL\",\n required: false,\n alternatives: [\"CLOUDFLARE_ACCOUNT_EMAIL\"],\n description: \"Account email paired with CLOUDFLARE_API_KEY.\",\n },\n ],\n };\n}));\n//# sourceMappingURL=AuthProvider.js.map","import { DEFAULT_API_BASE_URL, normalizeApiBaseUrl, } from \"@distilled.cloud/fly-io\";\nimport * as Effect from \"effect/Effect\";\nimport * as Redacted from \"effect/Redacted\";\nimport { getEnv, getEnvRedactedRequired } from \"../Auth/Env.js\";\nimport { makeStoredAuthProvider, storedSecret, storedValueText, } from \"../Auth/StoredAuthProvider.js\";\nexport const FLY_AUTH_PROVIDER_NAME = \"Fly\";\nexport const FLY_API_TOKEN_ENV = \"FLY_API_TOKEN\";\nexport const FLY_API_HOSTNAME_ENV = \"FLY_API_HOSTNAME\";\nconst resolveApiBaseUrl = (explicit) => getEnv(FLY_API_HOSTNAME_ENV).pipe(Effect.map((fromEnv) => normalizeApiBaseUrl(explicit ?? fromEnv)));\nconst flyAuth = makeStoredAuthProvider({\n provider: FLY_AUTH_PROVIDER_NAME,\n fields: [\n { name: \"apiKey\", label: \"Fly.io API Token\", secret: true },\n {\n name: \"apiBaseUrl\",\n label: \"Fly API hostname\",\n placeholder: DEFAULT_API_BASE_URL,\n optional: true,\n },\n ],\n toResolved: (values) => ({\n type: \"token\",\n apiKey: storedSecret(values.apiKey) ?? Redacted.make(\"\"),\n apiBaseUrl: normalizeApiBaseUrl(storedValueText(values.apiBaseUrl)),\n source: { type: \"stored\" },\n }),\n readEnvironment: Effect.gen(function* () {\n const apiKey = yield* getEnvRedactedRequired(FLY_API_TOKEN_ENV);\n const apiBaseUrl = yield* resolveApiBaseUrl();\n return {\n type: \"token\",\n apiKey,\n apiBaseUrl,\n source: { type: \"env\", details: FLY_API_TOKEN_ENV },\n };\n }),\n environment: [\n { name: FLY_API_TOKEN_ENV, required: true, secret: true },\n { name: FLY_API_HOSTNAME_ENV, required: false },\n ],\n});\n/**\n * Layer that registers the Fly {@link AuthProvider} into the\n * {@link AuthProviders} registry. Fly uses a stored API token locally and\n * `FLY_API_TOKEN` in CI; `FLY_API_HOSTNAME` optionally overrides the API root.\n */\nexport const FlyAuth = flyAuth.layer;\n//# sourceMappingURL=AuthProvider.js.map","import * as Effect from \"effect/Effect\";\nimport { AuthError } from \"../Auth/AuthProvider.js\";\nimport { getEnv } from \"../Auth/Env.js\";\n/**\n * Normalize a user-supplied GitHub host or URL into the REST API base URL\n * Octokit expects, following the same conventions as the `gh` CLI and the\n * Terraform GitHub provider:\n *\n * - `github.com` / `api.github.com` → `undefined` (Octokit's default)\n * - GitHub Enterprise Cloud with data residency (`acme.ghe.com` or\n * `api.acme.ghe.com`) → `https://api.acme.ghe.com`\n * - GitHub Enterprise Server (`github.example.com`) → `https://github.example.com/api/v3`;\n * an explicit path (e.g. an already-complete `/api/v3` URL) is honored as-is.\n *\n * Accepts a bare hostname or a full URL.\n */\nexport const normalizeGitHubBaseUrl = (input) => Effect.try({\n try: () => {\n const trimmed = input.trim();\n const url = new URL(trimmed.includes(\"://\") ? trimmed : `https://${trimmed}`);\n const host = url.hostname.toLowerCase();\n if (host === \"github.com\" ||\n host === \"www.github.com\" ||\n host === \"api.github.com\") {\n return undefined;\n }\n if (host.endsWith(\".ghe.com\")) {\n return `https://${host.startsWith(\"api.\") ? host : `api.${host}`}`;\n }\n const path = url.pathname.replace(/\\/+$/, \"\");\n return `${url.protocol}//${url.host}${path === \"\" ? \"/api/v3\" : path}`;\n },\n catch: () => new AuthError({\n message: `Invalid GitHub base URL: '${input}'. Provide a hostname (github.example.com) or URL (https://github.example.com/api/v3).`,\n }),\n});\n/**\n * The hostname `gh auth token --hostname` expects for a normalized API base\n * URL — the plain host for GitHub Enterprise Server, and the `api.`-less\n * host for GitHub Enterprise Cloud with data residency.\n */\nexport const githubHostname = (baseUrl) => {\n const host = new URL(baseUrl).hostname;\n return host.startsWith(\"api.\") && host.endsWith(\".ghe.com\")\n ? host.slice(\"api.\".length)\n : host;\n};\n/**\n * Resolve the GitHub API base URL from the environment:\n * `GITHUB_BASE_URL` (Terraform convention), then `GITHUB_API_URL` (set by\n * GitHub Actions runners), then `GH_HOST` (gh CLI convention, a bare\n * hostname). Returns `undefined` when unset or when the value points at\n * github.com.\n */\nexport const resolveGitHubBaseUrlFromEnv = Effect.gen(function* () {\n for (const key of [\"GITHUB_BASE_URL\", \"GITHUB_API_URL\", \"GH_HOST\"]) {\n const value = yield* getEnv(key);\n if (value !== undefined && value.trim() !== \"\") {\n return yield* normalizeGitHubBaseUrl(value);\n }\n }\n return undefined;\n});\n//# sourceMappingURL=BaseUrl.js.map","import * as Effect from \"effect/Effect\";\nimport * as Match from \"effect/Match\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as Schema from \"effect/Schema\";\nimport * as Stream from \"effect/Stream\";\nimport * as ChildProcess from \"effect/unstable/process/ChildProcess\";\nimport { ChildProcessSpawner } from \"effect/unstable/process/ChildProcessSpawner\";\nimport { AuthError, AuthProviderLayer, NeedsReauth, refreshHint, } from \"../Auth/AuthProvider.js\";\nimport { displayRedacted } from \"../Auth/Credentials.js\";\nimport { getEnvRedacted, mapPromptCancellation } from \"../Auth/Env.js\";\nimport { storedSecret, storedValueText, validateFieldValues, } from \"../Auth/StoredAuthProvider.js\";\nimport * as Interaction from \"../Interaction.js\";\nimport { githubHostname, normalizeGitHubBaseUrl, resolveGitHubBaseUrlFromEnv, } from \"./BaseUrl.js\";\nconst options = [\n {\n value: \"gh-cli\",\n label: \"GitHub CLI\",\n description: \"delegate to `gh auth token` (run `gh auth login` first)\",\n },\n {\n value: \"stored\",\n label: \"Personal Access Token\",\n description: \"enter PAT interactively and store it in the profile\",\n },\n];\n/** Typed values stored in a GitHub provider profile document. */\nexport const GitHubAuthConfigSchema = Schema.Union([\n Schema.Struct({\n method: Schema.Literal(\"stored\"),\n token: Schema.String,\n baseUrl: Schema.optionalKey(Schema.String),\n }),\n Schema.Struct({\n method: Schema.Literal(\"gh-cli\"),\n // v0 delegated to `gh auth token` and therefore had no inline token.\n // Keep that migration state readable; the first credential resolution\n // captures the token inline through updateConfig.\n token: Schema.optionalKey(Schema.String),\n baseUrl: Schema.optionalKey(Schema.String),\n }),\n]);\nexport const GITHUB_AUTH_PROVIDER_NAME = \"GitHub\";\nclass GhCliError extends Error {\n _tag = \"GhCliError\";\n}\nconst readEnvTokenFor = (baseUrl) => Effect.gen(function* () {\n const candidates = baseUrl !== undefined\n ? [\n \"GH_ENTERPRISE_TOKEN\",\n \"GITHUB_ENTERPRISE_TOKEN\",\n \"GITHUB_ACCESS_TOKEN\",\n \"GITHUB_TOKEN\",\n ]\n : [\"GITHUB_ACCESS_TOKEN\", \"GITHUB_TOKEN\"];\n for (const key of candidates) {\n const token = yield* getEnvRedacted(key);\n if (token) {\n return {\n type: \"token\",\n token,\n baseUrl,\n source: { type: \"env\", details: key },\n };\n }\n }\n return yield* new AuthError({\n message: `GitHub env credentials not found. Set ${candidates.join(\", \")}.`,\n });\n});\n/** Resolve standalone GitHub credentials from environment variables. */\nexport const readEnvCredentials = (configBaseUrl) => Effect.gen(function* () {\n const baseUrl = configBaseUrl ?? (yield* resolveGitHubBaseUrlFromEnv);\n return yield* readEnvTokenFor(baseUrl);\n});\nexport const makeGitHubAuth = (authOptions) => AuthProviderLayer()(GITHUB_AUTH_PROVIDER_NAME, Effect.gen(function* () {\n // Deferred accessors, NOT `yield* Interaction.Interaction`: resolving the service\n // at impl build would put the terminal in the registration layer's\n // requirements, and child processes (which only ever call `read`) build\n // this layer with no interaction services at all.\n const interaction = Interaction.accessors;\n const cp = yield* ChildProcessSpawner;\n // Hard-coded host from `providers({ baseUrl })`, resolved once at layer\n // build. Kept as an object so \"no option\" (undefined) is distinct from\n // \"option normalized to the github.com default\" ({ baseUrl: undefined })\n // — both matter: the latter still pins the host and mutes the prompt.\n const fixed = authOptions?.baseUrl !== undefined\n ? {\n baseUrl: yield* normalizeGitHubBaseUrl(authOptions.baseUrl).pipe(Effect.orDie),\n }\n : undefined;\n // The host every method authenticates against: the hard-coded value\n // wins, then the profile's configured host, then the environment.\n const effectiveBaseUrl = (config) => fixed !== undefined\n ? Effect.succeed(fixed.baseUrl)\n : config.baseUrl !== undefined\n ? Effect.succeed(config.baseUrl)\n : resolveGitHubBaseUrlFromEnv;\n const ghCliToken = (hostname) => Effect.gen(function* () {\n const handle = yield* cp.spawn(ChildProcess.make(\"gh\", [\n \"auth\",\n \"token\",\n ...(hostname !== undefined ? [\"--hostname\", hostname] : []),\n ], { shell: false }));\n const [exitCode, stdout, stderr] = yield* Effect.all([\n handle.exitCode,\n Stream.mkString(Stream.decodeText(handle.stdout)),\n Stream.mkString(Stream.decodeText(handle.stderr)),\n ], { concurrency: 3 });\n if (exitCode !== 0) {\n return yield* Effect.fail(new GhCliError(`gh auth token exited with ${exitCode}: ${stderr.trim() || stdout.trim()}`));\n }\n const token = stdout.trim();\n if (!token) {\n return yield* Effect.fail(new GhCliError(\"gh auth token returned empty output\"));\n }\n return token;\n }).pipe(Effect.scoped, Effect.mapError((e) => e instanceof GhCliError\n ? new AuthError({ message: e.message, cause: e })\n : new AuthError({\n message: \"Could not invoke `gh`. Install GitHub CLI from https://cli.github.com/ and run `gh auth login`.\",\n cause: e,\n })));\n const loginStored = Effect.fn(function* (baseUrl) {\n const token = yield* interaction.prompt\n .password({\n message: \"GitHub Personal Access Token\",\n description: \"Requires `repo` scope and `workflow` for GitHub Actions.\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n })\n .pipe(mapPromptCancellation);\n yield* interaction.output.success(\"GitHub: credentials saved.\");\n return { method: \"stored\", token, baseUrl };\n });\n // Optional GitHub Enterprise host. Blank means github.com; anything else\n // is normalized into the REST API base URL (GHES gets `/api/v3`\n // appended, data-residency hosts get the `api.` prefix).\n const promptBaseUrl = interaction.prompt\n .text({\n message: \"GitHub host\",\n description: \"Leave blank for github.com; use a hostname such as github.example.com for GitHub Enterprise.\",\n placeholder: \"github.com\",\n defaultValue: \"\",\n })\n .pipe(mapPromptCancellation, Effect.flatMap((input) => {\n const trimmed = (input ?? \"\").trim();\n return trimmed === \"\"\n ? Effect.succeed(undefined)\n : normalizeGitHubBaseUrl(trimmed);\n }));\n const configureInteractive = (_profileName) => Effect.gen(function* () {\n const method = yield* interaction.prompt.select({\n message: \"GitHub authentication method\",\n options,\n });\n // The host prompt is skipped when providers({ baseUrl }) pinned it —\n // nothing is stored in the profile config; `read` re-applies the\n // pinned value from code on every resolution.\n const baseUrl = fixed !== undefined ? undefined : yield* promptBaseUrl;\n const verifyHost = fixed !== undefined ? fixed.baseUrl : baseUrl;\n return yield* Match.value(method).pipe(Match.when(\"gh-cli\", () => ghCliToken(verifyHost !== undefined\n ? githubHostname(verifyHost)\n : undefined).pipe(Effect.map((token) => ({\n method: \"gh-cli\",\n token,\n baseUrl,\n })), Effect.mapError((e) => new AuthError({\n message: `gh CLI not available: ${e.message}`,\n cause: e,\n })))), Match.when(\"stored\", () => loginStored(baseUrl)), Match.exhaustive);\n });\n const configureCredentials = (profileName) => configureInteractive(profileName).pipe(Effect.mapError((e) => new AuthError({\n message: \"failed to configure credentials\",\n cause: e,\n })));\n const resolveCredentials = (profileName, config, updateConfig) => Match.value(config).pipe(Match.when({ method: \"stored\" }, Effect.fn(function* (c) {\n const baseUrl = yield* effectiveBaseUrl(c);\n return {\n type: \"token\",\n token: Redacted.make(c.token),\n baseUrl,\n source: { type: \"stored\" },\n };\n })), Match.when({ method: \"gh-cli\" }, Effect.fn(function* (c) {\n const baseUrl = yield* effectiveBaseUrl(c);\n const token = c.token ??\n (yield* ghCliToken(baseUrl !== undefined ? githubHostname(baseUrl) : undefined).pipe(Effect.mapError((cause) => new NeedsReauth({\n provider: GITHUB_AUTH_PROVIDER_NAME,\n profile: profileName,\n message: `GitHub CLI credentials need to be refreshed. ${refreshHint(GITHUB_AUTH_PROVIDER_NAME, profileName)}`,\n cause,\n }))));\n if (c.token === undefined && updateConfig !== undefined) {\n yield* updateConfig({ ...c, token });\n }\n return {\n type: \"token\",\n token: Redacted.make(token),\n baseUrl,\n source: { type: \"gh-cli\" },\n };\n })), Match.exhaustive);\n const logout = (_profileName, config) => Match.value(config).pipe(Match.when({ method: \"gh-cli\" }, () => Effect.void), Match.when({ method: \"stored\" }, () => Effect.void), Match.exhaustive);\n const login = (_profileName, config) => Match.value(config)\n .pipe(Match.when({ method: \"gh-cli\" }, (c) => effectiveBaseUrl(c).pipe(Effect.flatMap((baseUrl) => ghCliToken(baseUrl !== undefined ? githubHostname(baseUrl) : undefined)), Effect.tap(() => interaction.output.success(\"GitHub: gh CLI authentication available.\")), Effect.map((token) => ({ ...c, token })))), Match.when({ method: \"stored\" }, (c) => Effect.succeed(c)), Match.exhaustive)\n .pipe(Effect.mapError((e) => new AuthError({ message: \"login failed\", cause: e })));\n const details = (profileName, config, updateConfig) => resolveCredentials(profileName, config, updateConfig).pipe(Effect.map((creds) => {\n const sourceStr = creds.source.details\n ? `${creds.source.type} - ${creds.source.details}`\n : creds.source.type;\n return {\n lines: [\n { key: \"token\", value: displayRedacted(creds.token, 6) },\n { key: \"source\", value: sourceStr },\n ...(creds.baseUrl !== undefined\n ? [{ key: \"baseUrl\", value: creds.baseUrl }]\n : []),\n ],\n };\n }));\n // Flag-driven configuration covers the \"stored\" (PAT) method only;\n // \"gh-cli\" requires an interactive `gh auth login` session and is\n // deliberately absent from configureMethods.\n const storedFields = [\n {\n name: \"token\",\n label: \"GitHub Personal Access Token\",\n description: \"Requires `repo` scope and `workflow` for GitHub Actions.\",\n secret: true,\n },\n {\n name: \"baseUrl\",\n label: \"GitHub host\",\n description: \"Leave blank for github.com; use a hostname such as github.example.com for GitHub Enterprise.\",\n optional: true,\n },\n ];\n const configureMethods = [\n { method: \"stored\", fields: storedFields },\n ];\n const configureWith = (_profileName, input) => input.method === \"stored\"\n ? validateFieldValues(GITHUB_AUTH_PROVIDER_NAME, storedFields, input.values).pipe(Effect.flatMap(Effect.fn(function* (values) {\n // A hard-coded providers({ baseUrl }) pins the host; nothing\n // is stored in the profile config in that case (mirrors the\n // interactive configure flow).\n const baseUrl = fixed !== undefined\n ? undefined\n : values.baseUrl !== undefined\n ? yield* normalizeGitHubBaseUrl(storedValueText(values.baseUrl) ?? \"\")\n : undefined;\n const token = Redacted.value(storedSecret(values.token) ?? Redacted.make(\"\"));\n yield* interaction.output.success(\"GitHub: credentials saved.\");\n return { method: \"stored\", token, baseUrl };\n })))\n : Effect.fail(new AuthError({\n message: `GitHub: unknown method '${input.method}'. Valid methods: stored. (gh-cli is interactive-only.)`,\n }));\n return {\n configSchema: GitHubAuthConfigSchema,\n configure: configureCredentials,\n configureWith,\n configureMethods,\n logout,\n login,\n details,\n read: resolveCredentials,\n readEnvironment: readEnvCredentials(fixed !== undefined ? fixed.baseUrl : undefined),\n environment: [\n {\n name: \"GITHUB_ACCESS_TOKEN\",\n required: true,\n secret: true,\n alternatives: [\n \"GITHUB_TOKEN\",\n \"GH_ENTERPRISE_TOKEN\",\n \"GITHUB_ENTERPRISE_TOKEN\",\n ],\n description: \"Personal access token. The enterprise variants are only consulted when a GitHub Enterprise host is configured.\",\n },\n {\n name: \"GITHUB_BASE_URL\",\n required: false,\n alternatives: [\"GITHUB_API_URL\", \"GH_HOST\"],\n description: \"GitHub Enterprise host or REST API base URL.\",\n },\n ],\n };\n}));\n/**\n * The default GitHub AuthProvider layer — {@link makeGitHubAuth} with no\n * hard-coded host. Use `GitHub.providers({ baseUrl })` (or\n * `makeGitHubAuth({ baseUrl })` directly) to pin a GitHub Enterprise host.\n */\nexport const GitHubAuth = makeGitHubAuth();\n//# sourceMappingURL=AuthProvider.js.map","import { DEFAULT_API_BASE_URL } from \"@distilled.cloud/hetzner\";\nimport * as Effect from \"effect/Effect\";\nimport * as Redacted from \"effect/Redacted\";\nimport { getEnv, getEnvRedactedRequired } from \"../Auth/Env.js\";\nimport { makeStoredAuthProvider, storedSecret, storedValueText, } from \"../Auth/StoredAuthProvider.js\";\nexport const HETZNER_AUTH_PROVIDER_NAME = \"Hetzner\";\nexport const HCLOUD_TOKEN_ENV = \"HCLOUD_TOKEN\";\nexport const HCLOUD_ENDPOINT_ENV = \"HCLOUD_ENDPOINT\";\nconst hetznerAuth = makeStoredAuthProvider({\n provider: HETZNER_AUTH_PROVIDER_NAME,\n fields: [\n { name: \"token\", label: \"Hetzner Cloud API Token\", secret: true },\n {\n name: \"apiBaseUrl\",\n label: \"Hetzner API endpoint\",\n optional: true,\n placeholder: DEFAULT_API_BASE_URL,\n },\n ],\n toResolved: (values) => ({\n type: \"token\",\n token: storedSecret(values.token) ?? Redacted.make(\"\"),\n apiBaseUrl: storedValueText(values.apiBaseUrl) ?? DEFAULT_API_BASE_URL,\n source: { type: \"stored\" },\n }),\n readEnvironment: Effect.all({\n token: getEnvRedactedRequired(HCLOUD_TOKEN_ENV),\n apiBaseUrl: getEnv(HCLOUD_ENDPOINT_ENV),\n }).pipe(Effect.map(({ token, apiBaseUrl }) => ({\n type: \"token\",\n token,\n apiBaseUrl: apiBaseUrl ?? DEFAULT_API_BASE_URL,\n source: {\n type: \"env\",\n details: apiBaseUrl\n ? `${HCLOUD_TOKEN_ENV}, ${HCLOUD_ENDPOINT_ENV}`\n : HCLOUD_TOKEN_ENV,\n },\n }))),\n environment: [\n { name: HCLOUD_TOKEN_ENV, required: true, secret: true },\n { name: HCLOUD_ENDPOINT_ENV, required: false },\n ],\n});\n/**\n * Layer that registers the Hetzner {@link AuthProvider} into the\n * {@link AuthProviders} registry.\n *\n * Auth is a Hetzner Cloud API token (`HCLOUD_TOKEN`). An optional\n * `HCLOUD_ENDPOINT` overrides the API root.\n */\nexport const HetznerAuth = hetznerAuth.layer;\n//# sourceMappingURL=AuthProvider.js.map","import * as Effect from \"effect/Effect\";\nimport * as Redacted from \"effect/Redacted\";\nimport { getEnvRedactedRequired } from \"../Auth/Env.js\";\nimport { makeStoredAuthProvider, storedSecret, } from \"../Auth/StoredAuthProvider.js\";\nexport const NEON_AUTH_PROVIDER_NAME = \"Neon\";\nconst neonAuth = makeStoredAuthProvider({\n provider: NEON_AUTH_PROVIDER_NAME,\n fields: [{ name: \"apiKey\", label: \"Neon API Key\", secret: true }],\n toResolved: (values) => ({\n type: \"apiKey\",\n apiKey: storedSecret(values.apiKey) ?? Redacted.make(\"\"),\n source: { type: \"stored\" },\n }),\n readEnvironment: getEnvRedactedRequired(\"NEON_API_KEY\").pipe(Effect.map((apiKey) => ({\n type: \"apiKey\",\n apiKey,\n source: { type: \"env\" },\n }))),\n environment: [\n {\n name: \"NEON_API_KEY\",\n required: true,\n secret: true,\n },\n ],\n});\n/**\n * Layer that registers the Neon {@link AuthProvider} into the\n * {@link AuthProviders} registry.\n */\nexport const NeonAuth = neonAuth.layer;\n//# sourceMappingURL=AuthProvider.js.map","import { makeOAuthClient } from \"../Auth/OAuthFlow.js\";\nimport * as Redacted from \"effect/Redacted\";\nexport { OAuthCredentials, OAuthError, } from \"../Auth/OAuthFlow.js\";\n/**\n * Registered PlanetScale OAuth application credentials.\n *\n * Unlike Cloudflare, PlanetScale OAuth has **no public-client flow** — the\n * token endpoint requires client authentication for every grant (PKCE is\n * advertised in their discovery doc but does not lift that requirement), so\n * exchanging the authorization code (and refreshing the token) requires the\n * application's `client_secret`. There is no way to keep that secret out of\n * a distributed CLI, so it ships here: the exposure is the same posture as a\n * public `client_id` (a stolen refresh token is usable, exactly like\n * Cloudflare's secret-less refresh), and it can be rotated by cutting a new\n * release. PlanetScale's own CLI ships its OAuth `client_secret` in source\n * the same way:\n * https://github.com/planetscale/cli/blob/main/internal/auth/authenticator.go\n *\n * Registered at https://app.planetscale.com with redirect URI\n * {@link OAUTH_REDIRECT_URI}. Scopes are configured on the application\n * itself, not requested per-authorization (so `authorize()` is called with\n * no scopes). Rotate by registering a new secret and cutting a release.\n */\nexport const OAUTH_CLIENT_ID = \"pscale_app_aa12e3938baebb788aac443f66e422da\";\nexport const OAUTH_CLIENT_SECRET = Redacted.make(\"pscale_app_secret_yyZ3Q8oe99GP9_yA5wrA5er6RuN6Lz9dC66Bj1OJzpg\");\nexport const OAUTH_REDIRECT_URI = \"https://alchemy.run/auth/callback\";\nexport const OAUTH_LOCAL_CALLBACK_URI = \"http://localhost:9976/auth/callback\";\nexport const OAUTH_ENDPOINTS = {\n // PlanetScale's own .well-known OAuth discovery doc declares this as\n // the authorization_endpoint — NOT auth.planetscale.com/oauth/authorize\n // (which their public docs cite). The auth.planetscale.com alias does\n // render a consent screen but emits codes whose resulting tokens lack\n // a `sub` claim, so the resource API at api.planetscale.com rejects\n // them as invalid. Use the canonical endpoint.\n authorize: \"https://app.planetscale.com/oauth/authorize\",\n token: \"https://auth.planetscale.com/oauth/token\",\n};\nconst client = makeOAuthClient({\n clientId: OAUTH_CLIENT_ID,\n endpoints: OAUTH_ENDPOINTS,\n redirectUri: OAUTH_REDIRECT_URI,\n localCallbackUri: OAUTH_LOCAL_CALLBACK_URI,\n auth: { kind: \"clientSecret\", clientSecret: OAUTH_CLIENT_SECRET },\n // PlanetScale's docs show the token endpoint with all parameters in the\n // query string (https://planetscale.com/docs/api/reference/oauth). Their\n // .well-known discovery doc advertises client_secret_basic /\n // client_secret_post instead, but both behave identically to the\n // query-string form in practice, so we follow the public docs literally.\n tokenTransport: \"query\",\n});\nexport const { authorize, callback, exchange, exchangeCallbackInput, refresh, usesCurrentClient, } = client;\n//# sourceMappingURL=OAuthClient.js.map","import { listOrganizations } from \"@distilled.cloud/planetscale\";\nimport * as PsCredentialsModule from \"@distilled.cloud/planetscale/Credentials\";\nimport * as Clock from \"effect/Clock\";\nimport * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Match from \"effect/Match\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as Schema from \"effect/Schema\";\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\";\nimport * as HttpClient from \"effect/unstable/http/HttpClient\";\nimport { AuthError, AuthProviderLayer, refreshHint, NeedsReauth, } from \"../Auth/AuthProvider.js\";\nimport { storedSecret, storedValueText, validateFieldValues, } from \"../Auth/StoredAuthProvider.js\";\nimport { displayRedacted } from \"../Auth/Credentials.js\";\nimport { withProfileCredentialsLock } from \"../Auth/Lock.js\";\nimport { getEnvRedactedRequired, getEnvRequired, mapPromptCancellation, } from \"../Auth/Env.js\";\nimport { browserOAuth } from \"../Auth/BrowserOAuth.js\";\nimport * as Interaction from \"../Interaction.js\";\nimport * as OAuthClient from \"./OAuthClient.js\";\n/**\n * Canonical name registered in {@link AuthProviders}. Use this key to look\n * up the PlanetScale {@link AuthProvider} from inside provider Layers.\n */\nexport const PLANETSCALE_AUTH_PROVIDER_NAME = \"Planetscale\";\n/**\n * Provide PlanetScale `Credentials` + `HttpClient` to an Effect using a\n * just-obtained OAuth access token. Used during configure to call\n * org-discovery endpoints before the user has chosen an org.\n *\n * `organization` is required by the credential type but isn't consulted by\n * `listOrganizations` (it's a user-scoped endpoint), so an empty string is\n * fine here.\n */\nconst withOAuthCredentials = (accessToken, effect) => Effect.provide(effect, Layer.mergeAll(PsCredentialsModule.fromOAuth({\n accessToken,\n organization: \"\",\n}), FetchHttpClient.layer));\n/**\n * List the organizations the OAuth user belongs to and either auto-pick\n * (one org) or prompt the user to choose. Returns the org's URL slug\n * (`name` field, used as `{organization}` in API paths).\n */\nconst selectOrganization = (accessToken) => Effect.gen(function* () {\n const interaction = Interaction.accessors;\n const list = yield* listOrganizations;\n const response = yield* list({});\n const orgs = response.data;\n if (orgs.length === 0) {\n return yield* new AuthError({\n message: \"Planetscale: no organizations found for this credential.\",\n });\n }\n if (orgs.length === 1) {\n const org = orgs[0];\n if (org === undefined) {\n return yield* new AuthError({\n message: \"Planetscale: organization response was unexpectedly empty.\",\n });\n }\n yield* interaction.output.info(`Planetscale: using organization: ${org.name} (${org.id})`);\n return org.name;\n }\n return yield* interaction.prompt\n .select({\n message: \"Select a Planetscale organization\",\n options: orgs.map((o) => ({\n value: o.name,\n label: o.name,\n description: o.id,\n })),\n })\n .pipe(mapPromptCancellation);\n}).pipe((e) => withOAuthCredentials(accessToken, e));\nconst options = [\n {\n value: \"oauth\",\n label: \"OAuth\",\n description: \"recommended — browser-based login with automatic token refresh\",\n },\n {\n value: \"stored\",\n label: \"Service Token\",\n description: \"enter a service token and store it inline in the provider file\",\n },\n];\n/**\n * Typed values stored in a PlanetScale provider profile document. Both\n * service-token and OAuth values are inline. PlanetScale has no PKCE flow,\n * so the OAuth application's\n * `client_secret` ships in the CLI — see {@link OAuthClient}.\n */\nexport const PlanetscaleAuthConfigSchema = Schema.Union([\n Schema.Struct({\n method: Schema.Literal(\"stored\"),\n tokenId: Schema.String,\n token: Schema.String,\n organization: Schema.String,\n }),\n Schema.Struct({\n method: Schema.Literal(\"oauth\"),\n organization: Schema.String,\n clientId: Schema.optional(Schema.String),\n access: Schema.String,\n refresh: Schema.String,\n expires: Schema.Number,\n scopes: Schema.mutable(Schema.Array(Schema.String)),\n }),\n]);\n/**\n * Layer that registers the PlanetScale {@link AuthProvider} into the\n * {@link AuthProviders} registry when built. Include this in the\n * PlanetScale `providers()` layer so the alchemy CLI can discover it.\n *\n * Supported methods:\n * - `stored`: prompts for a service token and stores it inline.\n * - `oauth`: browser-based login storing access/refresh values inline.\n */\nexport const PlanetscaleAuth = AuthProviderLayer()(PLANETSCALE_AUTH_PROVIDER_NAME, Effect.gen(function* () {\n const interaction = Interaction.accessors;\n const oauthLogin = (_profileName) => Effect.gen(function* () {\n const authorization = yield* OAuthClient.authorize();\n const credentials = yield* browserOAuth({\n provider: \"Planetscale\",\n url: authorization.url,\n callback: OAuthClient.callback(authorization),\n exchange: (input) => OAuthClient.exchangeCallbackInput(input, authorization),\n });\n yield* interaction.output.success(\"Planetscale: OAuth credentials saved.\");\n return credentials;\n });\n const configureOAuth = Effect.fn(function* (profileName) {\n const oauthCreds = yield* oauthLogin(profileName);\n // Use the just-issued access token to list the user's orgs and let\n // them pick (mirrors Cloudflare's selectAccount). Requires the\n // `user:read_organizations` scope. If the call fails for any\n // reason — missing scope, network, off-spec response — fall back\n // to a manual prompt so login still completes.\n const organization = yield* selectOrganization(Redacted.value(oauthCreds.access)).pipe(Effect.catch((e) => Effect.gen(function* () {\n yield* interaction.output.warning(`Planetscale: could not auto-list organizations (${String(e)}). Falling back to manual entry.`);\n return yield* interaction.prompt\n .text({\n message: \"Planetscale Organization (URL slug)\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n })\n .pipe(mapPromptCancellation);\n })));\n return {\n method: \"oauth\",\n organization,\n clientId: oauthCreds.clientId,\n access: Redacted.value(oauthCreds.access),\n refresh: Redacted.value(oauthCreds.refresh),\n expires: oauthCreds.expires,\n scopes: oauthCreds.scopes,\n };\n });\n const loginStored = Effect.fn(function* (_profileName) {\n const tokenId = yield* interaction.prompt\n .text({\n message: \"Planetscale Service Token ID\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n })\n .pipe(mapPromptCancellation);\n const token = yield* interaction.prompt\n .password({\n message: \"Planetscale Service Token\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n })\n .pipe(mapPromptCancellation);\n const organization = yield* interaction.prompt\n .text({\n message: \"Planetscale Organization (URL slug)\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n })\n .pipe(mapPromptCancellation);\n yield* interaction.output.success(\"Planetscale: credentials saved.\");\n return { method: \"stored\", tokenId, token, organization };\n });\n const configureInteractive = (profileName) => interaction.prompt\n .select({\n message: \"Planetscale authentication method\",\n options,\n })\n .pipe(Effect.flatMap((method) => Match.value(method).pipe(Match.when(\"oauth\", () => configureOAuth(profileName)), Match.when(\"stored\", () => loginStored(profileName)), Match.exhaustive)));\n const configureCredentials = (profileName) => configureInteractive(profileName).pipe(Effect.mapError((e) => new AuthError({\n message: \"failed to configure credentials\",\n cause: e,\n })));\n /**\n * Flag-driven (`--method stored --set ...`) fields, mirroring the\n * interactive service-token prompts. OAuth requires a browser and stays\n * interactive-only, so it is deliberately absent from\n * {@link configureMethods}.\n */\n const serviceTokenFields = [\n { name: \"tokenId\", label: \"Planetscale Service Token ID\" },\n { name: \"token\", label: \"Planetscale Service Token\", secret: true },\n { name: \"organization\", label: \"Planetscale Organization (URL slug)\" },\n ];\n const configureMethods = [\n { method: \"stored\", fields: serviceTokenFields },\n ];\n const configureWith = (_profileName, input) => input.method === \"stored\"\n ? validateFieldValues(PLANETSCALE_AUTH_PROVIDER_NAME, serviceTokenFields, input.values).pipe(Effect.map((values) => ({\n method: \"stored\",\n tokenId: Redacted.value(storedSecret(values.tokenId) ?? Redacted.make(\"\")),\n token: Redacted.value(storedSecret(values.token) ?? Redacted.make(\"\")),\n organization: storedValueText(values.organization) ?? \"\",\n })), Effect.tap(() => interaction.output.success(\"Planetscale: credentials saved.\")))\n : Effect.fail(new AuthError({\n message: `Planetscale: unknown method '${input.method}'. Valid methods: stored. (OAuth is interactive-only.)`,\n }));\n const resolveCredentials = (profileName, config, updateConfig) => Effect.gen(function* () {\n const reauth = refreshHint(PLANETSCALE_AUTH_PROVIDER_NAME, profileName);\n return yield* Match.value(config).pipe(Match.when({ method: \"stored\" }, (stored) => Effect.succeed({\n type: \"apiToken\",\n tokenId: Redacted.make(stored.tokenId),\n token: Redacted.make(stored.token),\n organization: stored.organization,\n source: { type: \"stored\", details: undefined },\n })), Match.when({ method: \"oauth\" }, (cfg) => Effect.gen(function* () {\n const creds = {\n type: \"oauth\",\n clientId: cfg.clientId,\n access: Redacted.make(cfg.access),\n refresh: Redacted.make(cfg.refresh),\n expires: cfg.expires,\n scopes: cfg.scopes,\n };\n if (!OAuthClient.usesCurrentClient(creds)) {\n return yield* Effect.fail(new NeedsReauth({\n provider: PLANETSCALE_AUTH_PROVIDER_NAME,\n profile: profileName,\n message: `Planetscale OAuth credentials for profile '${profileName}' were issued to an incompatible OAuth client and have been removed. ${reauth}`,\n }));\n }\n // Refresh proactively if the token has expired (or is within\n // 10s of expiring). Persist the refreshed creds so subsequent\n // resolves don't repeat the round-trip.\n const now = yield* Clock.currentTimeMillis;\n const fresh = creds.expires > now + 10_000\n ? creds\n : yield* OAuthClient.refresh(creds).pipe(\n // Only the refresh round-trip maps to NeedsReauth — a\n // failed persist afterwards is a local I/O AuthError and\n // passes through untouched.\n Effect.mapError((e) => new NeedsReauth({\n provider: PLANETSCALE_AUTH_PROVIDER_NAME,\n profile: profileName,\n message: `Planetscale OAuth refresh failed. ${reauth}`,\n cause: e,\n })));\n if (fresh !== creds) {\n yield* (updateConfig?.({\n method: \"oauth\",\n organization: cfg.organization,\n clientId: fresh.clientId,\n access: Redacted.value(fresh.access),\n refresh: Redacted.value(fresh.refresh),\n expires: fresh.expires,\n scopes: fresh.scopes,\n }) ?? Effect.void);\n }\n return {\n type: \"oauth\",\n accessToken: fresh.access,\n expires: fresh.expires,\n organization: cfg.organization,\n source: { type: \"oauth\" },\n };\n })), Match.exhaustive);\n });\n const logout = (_profileName, config) => Match.value(config).pipe(Match.when({ method: \"stored\" }, () => Effect.void), Match.when({ method: \"oauth\" }, () => Effect.void), Match.exhaustive);\n const login = (profileName, config, updateConfig) => Match.value(config)\n .pipe(Match.when({ method: \"stored\" }, (stored) => Effect.succeed(stored)), Match.when({ method: \"oauth\" }, (oauth) => Effect.gen(function* () {\n const credentials = {\n type: \"oauth\",\n clientId: oauth.clientId,\n access: Redacted.make(oauth.access),\n refresh: Redacted.make(oauth.refresh),\n expires: oauth.expires,\n scopes: oauth.scopes,\n };\n if (!OAuthClient.usesCurrentClient(credentials)) {\n return yield* configureOAuth(profileName);\n }\n const refreshed = yield* withProfileCredentialsLock(profileName, interaction.output\n .info(\"Planetscale: refreshing OAuth credentials...\")\n .pipe(Effect.andThen(OAuthClient.refresh(credentials)), Effect.flatMap((credentials) => {\n const config = {\n ...oauth,\n clientId: credentials.clientId,\n access: Redacted.value(credentials.access),\n refresh: Redacted.value(credentials.refresh),\n expires: credentials.expires,\n scopes: credentials.scopes,\n };\n return (updateConfig?.(config) ?? Effect.void).pipe(Effect.as(config));\n }), Effect.tap(() => interaction.output.success(\"Planetscale: OAuth credentials refreshed.\")))).pipe(Effect.catchTag(\"OAuthError\", () => configureOAuth(profileName)));\n return refreshed;\n })), Match.exhaustive)\n .pipe(Effect.mapError((e) => new AuthError({ message: \"login failed\", cause: e })));\n const details = (profileName, config, updateConfig) => Effect.all([\n resolveCredentials(profileName, config, updateConfig),\n Clock.currentTimeMillis,\n ]).pipe(Effect.map(([creds, now]) => {\n const sourceStr = \"details\" in creds.source && creds.source.details\n ? `${creds.source.type} - ${creds.source.details}`\n : creds.source.type;\n return Match.value(creds).pipe(Match.when({ type: \"apiToken\" }, (c) => ({\n lines: [\n { key: \"tokenId\", value: displayRedacted(c.tokenId, 3) },\n { key: \"token\", value: displayRedacted(c.token, 6) },\n { key: \"organization\", value: c.organization },\n { key: \"source\", value: sourceStr },\n ],\n })), Match.when({ type: \"oauth\" }, (c) => {\n const remainingMs = c.expires - now;\n const expiresAt = new Date(c.expires).toISOString();\n const expiresStr = remainingMs <= 0\n ? `expired (${expiresAt})`\n : `in ${Duration.format(Duration.millis(remainingMs))} (${expiresAt})`;\n return {\n lines: [\n { key: \"accessToken\", value: displayRedacted(c.accessToken) },\n { key: \"expires\", value: expiresStr },\n { key: \"organization\", value: c.organization },\n { key: \"source\", value: sourceStr },\n ],\n };\n }), Match.exhaustive);\n }));\n const readEnvironment = Effect.gen(function* () {\n const tokenId = yield* getEnvRedactedRequired(\"PLANETSCALE_API_TOKEN_ID\");\n const token = yield* getEnvRedactedRequired(\"PLANETSCALE_API_TOKEN\");\n const organization = yield* getEnvRequired(\"PLANETSCALE_ORGANIZATION\");\n return {\n type: \"apiToken\",\n tokenId,\n token,\n organization,\n source: {\n type: \"env\",\n details: \"PLANETSCALE_API_TOKEN_ID/PLANETSCALE_API_TOKEN\",\n },\n };\n });\n return {\n configSchema: PlanetscaleAuthConfigSchema,\n configure: configureCredentials,\n configureWith,\n configureMethods,\n logout,\n login,\n details,\n read: resolveCredentials,\n readEnvironment,\n environment: [\n {\n name: \"PLANETSCALE_API_TOKEN_ID\",\n required: true,\n description: \"Service token id.\",\n },\n {\n name: \"PLANETSCALE_API_TOKEN\",\n required: true,\n secret: true,\n description: \"Service token secret.\",\n },\n {\n name: \"PLANETSCALE_ORGANIZATION\",\n required: true,\n description: \"Organization URL slug.\",\n },\n {\n name: \"PLANETSCALE_API_BASE_URL\",\n required: false,\n description: \"API base URL override.\",\n },\n ],\n };\n}));\n//# sourceMappingURL=AuthProvider.js.map","import * as Effect from \"effect/Effect\";\nimport * as Redacted from \"effect/Redacted\";\nimport { AuthError } from \"../Auth/AuthProvider.js\";\nimport { getEnvRedacted } from \"../Auth/Env.js\";\nimport { makeStoredAuthProvider, storedSecret, } from \"../Auth/StoredAuthProvider.js\";\nexport const PRISMA_AUTH_PROVIDER_NAME = \"Prisma\";\nconst prismaAuth = makeStoredAuthProvider({\n provider: PRISMA_AUTH_PROVIDER_NAME,\n fields: [\n {\n name: \"serviceToken\",\n label: \"Prisma Service Token\",\n secret: true,\n validate: (value) => (value.trim().length === 0 ? \"Required\" : undefined),\n },\n ],\n toResolved: (values) => ({\n type: \"serviceToken\",\n serviceToken: storedSecret(values.serviceToken) ?? Redacted.make(\"\"),\n source: { type: \"stored\" },\n }),\n readEnvironment: Effect.gen(function* () {\n const serviceToken = yield* getEnvRedacted(\"PRISMA_SERVICE_TOKEN\");\n const apiToken = yield* getEnvRedacted(\"PRISMA_API_TOKEN\");\n const token = serviceToken ?? apiToken;\n if (token === undefined || Redacted.value(token).trim().length === 0) {\n return yield* new AuthError({\n message: \"Prisma CI credentials not found. Set PRISMA_SERVICE_TOKEN or PRISMA_API_TOKEN.\",\n });\n }\n return {\n type: \"serviceToken\",\n serviceToken: Redacted.make(Redacted.value(token).trim()),\n source: {\n type: \"env\",\n details: serviceToken === undefined\n ? \"PRISMA_API_TOKEN\"\n : \"PRISMA_SERVICE_TOKEN\",\n },\n };\n }),\n environment: [\n {\n name: \"PRISMA_SERVICE_TOKEN\",\n required: true,\n secret: true,\n alternatives: [\"PRISMA_API_TOKEN\"],\n description: \"Prisma Platform service token.\",\n },\n {\n name: \"PRISMA_API_URL\",\n required: false,\n alternatives: [\"PRISMA_MANAGEMENT_API_URL\"],\n description: \"Management API base URL override.\",\n },\n ],\n});\n/**\n * Layer that registers the Prisma Management API auth provider.\n */\nexport const PrismaAuth = prismaAuth.layer;\n/** Schema of Prisma's inline static-token values. */\nexport const PrismaStoredCredentials = prismaAuth.storedSchema;\n//# sourceMappingURL=AuthProvider.js.map","import * as railway from \"@distilled.cloud/railway\";\nimport { CredentialsFromToken } from \"@distilled.cloud/railway\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Schedule from \"effect/Schedule\";\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\";\n/** Dashboard host used by `railway login --browserless` pairing URLs. */\nexport const RAILWAY_CLI_LOGIN_HOST = \"https://railway.com\";\n/**\n * Build the Railway CLI pairing URL for a {@link railway.createLoginSession}\n * code.\n *\n * Mirrors `railway login --browserless`: the payload is\n * `wordCode={code}&hostname={hostname}` (URL-safe base64) on\n * `https://railway.com/cli-login?d=…`. The user confirms the pairing code\n * in the browser; {@link railway.loginSessionAuth} is the dashboard-side\n * mutation that marks the session authorized. {@link railway.verifyLoginSession}\n * is a liveness check (true while the pairing session exists). The CLI then\n * polls {@link railway.loginSessionConsume} until a token is returned.\n *\n * Alchemy's AuthProvider `method: \"oauth\"` runs this flow: create → print\n * the pairing URL → poll consume → store the token.\n *\n * ### Pairing URL\n * **Example:** From a session code\n * ```typescript\n * const code = yield* railway.createLoginSession({});\n * const url = loginSessionUrl(code, { hostname: \"dev-box\" });\n * ```\n */\nexport const loginSessionUrl = (code, options) => {\n const hostname = options?.hostname ?? \"alchemy\";\n const host = (options?.host ?? RAILWAY_CLI_LOGIN_HOST).replace(/\\/+$/, \"\");\n const payload = `wordCode=${code}&hostname=${hostname}`;\n const encoded = Buffer.from(payload)\n .toString(\"base64\")\n .replace(/\\+/g, \"-\")\n .replace(/\\//g, \"_\");\n return `${host}/cli-login?d=${encoded}`;\n};\n/**\n * Credentials layer that sends no `Authorization` header. Login-session\n * mutations are public: they run before the user has a token.\n */\nconst anonymousRailwayCredentials = (apiBaseUrl) => CredentialsFromToken({\n token: \"\",\n tokenKind: \"account\",\n apiBaseUrl,\n});\nconst anonymousRailway = (apiBaseUrl) => Layer.mergeAll(anonymousRailwayCredentials(apiBaseUrl), FetchHttpClient.layer);\nexport const provideAnonymousRailway = (effect, apiBaseUrl) => effect.pipe(Effect.provide(anonymousRailway(apiBaseUrl)));\nconst LOGIN_POLL_TIMES = 300;\n/**\n * Poll {@link railway.verifyLoginSession} then\n * {@link railway.loginSessionConsume} until a token is returned, or 5 minutes\n * elapse. Mirrors `railway login --browserless`: consume is the token source;\n * verify is a liveness check. Does not cancel the session — the caller should\n * cancel on timeout or interrupt.\n *\n * Exhaustion returns `undefined` (not a failure) so the AuthProvider can\n * surface a timeout rather than a poll error.\n */\nconst missingSession = [\"RailwayNotFound\"];\nexport const pollLoginSessionToken = (code) => railway.verifyLoginSession({ code }).pipe(railway.catchTags(missingSession, () => Effect.succeed(false)), Effect.flatMap(() => railway\n .loginSessionConsume({ code })\n .pipe(railway.catchTags(missingSession, () => Effect.succeed(null)))), Effect.map((token) => token != null && token.length > 0 ? token : undefined), Effect.repeat({\n schedule: Schedule.spaced(\"1 second\"),\n while: (token) => token == null,\n times: LOGIN_POLL_TIMES,\n}));\n//# sourceMappingURL=LoginSession.js.map","import * as railway from \"@distilled.cloud/railway\";\nimport { DEFAULT_API_BASE_URL } from \"@distilled.cloud/railway\";\nimport * as Effect from \"effect/Effect\";\nimport * as Match from \"effect/Match\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as Schema from \"effect/Schema\";\nimport * as Os from \"node:os\";\nimport { AuthError, AuthProviderLayer, NeedsReauth, } from \"../Auth/AuthProvider.js\";\nimport { displayRedacted } from \"../Auth/Credentials.js\";\nimport { getEnv, getEnvRedacted, getEnvRedactedRequired, mapPromptCancellation, } from \"../Auth/Env.js\";\nimport { storedSecret, storedValueText, validateFieldValues, } from \"../Auth/StoredAuthProvider.js\";\nimport * as Interaction from \"../Interaction.js\";\nimport { loginSessionUrl, pollLoginSessionToken, provideAnonymousRailway, } from \"./LoginSession.js\";\nexport const RAILWAY_AUTH_PROVIDER_NAME = \"Railway\";\nexport const RAILWAY_API_TOKEN_ENV = \"RAILWAY_API_TOKEN\";\nexport const RAILWAY_API_URL_ENV = \"RAILWAY_API_URL\";\n/** Typed values stored in a Railway provider profile document. */\nexport const RailwayAuthConfigSchema = Schema.Union([\n Schema.Struct({ method: Schema.Literal(\"env\") }),\n Schema.Struct({\n method: Schema.Literal(\"stored\"),\n token: Schema.String,\n apiBaseUrl: Schema.optional(Schema.String),\n }),\n Schema.Struct({\n method: Schema.Literal(\"oauth\"),\n token: Schema.String,\n apiBaseUrl: Schema.optional(Schema.String),\n }),\n]);\nconst options = [\n {\n value: \"oauth\",\n label: \"OAuth (CLI login session)\",\n description: \"recommended — open railway.com/cli-login, confirm the pairing code\",\n },\n {\n value: \"env\",\n label: \"Environment Variables\",\n description: `${RAILWAY_API_TOKEN_ENV} + optional ${RAILWAY_API_URL_ENV}`,\n },\n {\n value: \"stored\",\n label: \"API Token\",\n description: \"enter interactively and store inline in the provider file\",\n },\n];\nconst normalizeApiBaseUrl = (explicit) => {\n const trimmed = (explicit ?? \"\").trim().replace(/\\/+$/, \"\");\n return trimmed.length > 0 ? trimmed : DEFAULT_API_BASE_URL;\n};\nconst resolveApiBaseUrl = (explicit) => getEnv(RAILWAY_API_URL_ENV).pipe(Effect.map((fromEnv) => normalizeApiBaseUrl(explicit ?? fromEnv)));\n/**\n * Layer that registers the Railway {@link AuthProvider} into the\n * {@link AuthProviders} registry. Include this in the Railway `providers()`\n * layer so the alchemy CLI can discover it.\n *\n * Supported methods:\n * - `env`: reads `RAILWAY_API_TOKEN` (account Bearer). Project tokens are\n * not used — they cannot reach workspace-wide operations.\n * - `stored`: prompts for an API token and stores it in the provider file.\n * - `oauth`: CLI login session (`loginSessionCreate` → open the pairing URL →\n * poll `loginSessionVerify` / `loginSessionConsume` → store the token).\n * Does not require a pre-existing token. An optional `RAILWAY_API_URL`\n * overrides the backboard host (default `https://backboard.railway.com`).\n */\nexport const RailwayAuth = AuthProviderLayer()(RAILWAY_AUTH_PROVIDER_NAME, Effect.gen(function* () {\n const interaction = Interaction.accessors;\n const loginStored = Effect.fn(function* (_profileName) {\n const token = yield* interaction.prompt\n .password({\n message: \"Railway API Token\",\n validate: (v) => (v.length === 0 ? \"Required\" : undefined),\n })\n .pipe(mapPromptCancellation);\n const envUrl = yield* getEnv(RAILWAY_API_URL_ENV);\n const urlPrompt = yield* interaction.prompt\n .text({\n message: \"Railway API URL (Enter for default)\",\n placeholder: DEFAULT_API_BASE_URL,\n defaultValue: envUrl ?? DEFAULT_API_BASE_URL,\n })\n .pipe(mapPromptCancellation);\n const trimmed = (urlPrompt ?? \"\").trim();\n const apiBaseUrl = trimmed.length > 0 && trimmed !== DEFAULT_API_BASE_URL\n ? trimmed\n : undefined;\n yield* interaction.output.success(\"Railway: credentials saved.\");\n return { method: \"stored\", token, apiBaseUrl };\n });\n const loginOAuth = Effect.fn(function* (_profileName) {\n const apiBaseUrl = yield* resolveApiBaseUrl();\n const hostname = yield* Effect.sync(() => {\n try {\n return Os.hostname();\n }\n catch {\n return \"alchemy\";\n }\n });\n const withAnonymous = (effect) => provideAnonymousRailway(effect, apiBaseUrl);\n const code = yield* withAnonymous(railway.createLoginSession({})).pipe(Effect.mapError((e) => new AuthError({\n message: \"Railway login session create failed\",\n cause: e,\n })));\n const url = loginSessionUrl(code, { hostname });\n // `awaitExternal` is only on the Interaction service, not the `accessors`\n // helper (same acquisition as BrowserOAuth / the AWS SSO flow).\n const interaction = yield* Interaction.Interaction;\n const services = yield* Effect.context();\n // Invoked later by the prompt's keyboard event boundary, not while the\n // surrounding Effect is executing.\n const runOpenUrl = Effect.runPromiseWith(services);\n const openFailed = yield* Interaction.openUrl(url).pipe(Effect.as(false), Effect.catch(() => Effect.succeed(true)));\n const cancel = withAnonymous(railway.cancelLoginSession({ code })).pipe(Effect.catch(() => Effect.void));\n // The token only ever arrives through the poll; the awaitExternal\n // prompt renders the pairing URL + code and re-opens the browser on\n // demand, so it must never win the race — park it after it returns.\n const token = yield* withAnonymous(pollLoginSessionToken(code)).pipe(Effect.raceFirst(interaction.prompt\n .awaitExternal({\n message: \"Railway authorization\",\n waitingLabel: \"waiting for browser authorization (up to 5 minutes)…\",\n url,\n code,\n openFailed,\n onOpen: () => runOpenUrl(Interaction.openUrl(url)),\n allowManualInput: false,\n })\n .pipe(mapPromptCancellation, Effect.andThen(Effect.never))), Effect.onInterrupt(() => cancel), Effect.tapError(() => cancel), Effect.mapError((e) => e instanceof AuthError\n ? e\n : new AuthError({\n message: \"Railway login session poll failed\",\n cause: e,\n })));\n if (token == null || token.length === 0) {\n yield* cancel;\n return yield* new AuthError({\n message: \"Railway login session timed out after 5 minutes.\",\n });\n }\n yield* interaction.output.success(\"Railway: OAuth credentials saved.\");\n return {\n method: \"oauth\",\n token,\n apiBaseUrl: apiBaseUrl === DEFAULT_API_BASE_URL ? undefined : apiBaseUrl,\n };\n });\n const configureInteractive = (profileName) => interaction.prompt\n .select({\n message: \"Railway authentication method\",\n options,\n })\n .pipe(Effect.flatMap((method) => Match.value(method).pipe(Match.when(\"env\", () => Effect.gen(function* () {\n const token = yield* getEnvRedacted(RAILWAY_API_TOKEN_ENV);\n if (!token) {\n yield* interaction.output.warning(`Railway: ${RAILWAY_API_TOKEN_ENV} is not currently set — export it before deploying.`);\n }\n return { method: \"env\" };\n })), Match.when(\"stored\", () => loginStored(profileName)), Match.when(\"oauth\", () => loginOAuth(profileName)), Match.exhaustive)));\n const configureCredentials = (profileName) => configureInteractive(profileName).pipe(Effect.mapError((e) => new AuthError({\n message: \"failed to configure credentials\",\n cause: e,\n })));\n /**\n * Flag-driven (`--method stored --set ...` / `--method env`) fields,\n * mirroring the interactive prompts. OAuth requires a browser and stays\n * interactive-only, so it is deliberately absent.\n */\n const tokenFields = [\n { name: \"token\", label: \"Railway API Token\", secret: true },\n {\n name: \"apiBaseUrl\",\n label: \"Railway API URL\",\n placeholder: DEFAULT_API_BASE_URL,\n optional: true,\n },\n ];\n const configureMethods = [\n { method: \"stored\", fields: tokenFields },\n { method: \"env\", fields: [] },\n ];\n const configureWith = (_profileName, input) => input.method === \"stored\"\n ? validateFieldValues(RAILWAY_AUTH_PROVIDER_NAME, tokenFields, input.values).pipe(Effect.map((values) => ({\n method: \"stored\",\n token: Redacted.value(storedSecret(values.token) ?? Redacted.make(\"\")),\n apiBaseUrl: storedValueText(values.apiBaseUrl),\n })), Effect.tap(() => interaction.output.success(\"Railway: credentials saved.\")))\n : input.method === \"env\"\n ? Effect.succeed({ method: \"env\" })\n : Effect.fail(new AuthError({\n message: `Railway: unknown method '${input.method}'. Valid methods: stored, env. (OAuth is interactive-only.)`,\n }));\n const readStoredToken = (config) => Effect.gen(function* () {\n const apiBaseUrl = yield* resolveApiBaseUrl(config.apiBaseUrl);\n return {\n type: \"token\",\n token: Redacted.make(config.token),\n tokenKind: \"account\",\n apiBaseUrl,\n source: { type: config.method },\n };\n });\n const resolveCredentials = (profileName, config) => Effect.gen(function* () {\n return yield* Match.value(config).pipe(Match.when({ method: \"env\" }, Effect.fn(function* () {\n const token = yield* getEnvRedacted(RAILWAY_API_TOKEN_ENV);\n if (!token) {\n return yield* new AuthError({\n message: `Railway env credentials not found. Set ${RAILWAY_API_TOKEN_ENV}.`,\n });\n }\n const apiBaseUrl = yield* resolveApiBaseUrl();\n return {\n type: \"token\",\n token,\n tokenKind: \"account\",\n apiBaseUrl,\n source: {\n type: \"env\",\n details: RAILWAY_API_TOKEN_ENV,\n },\n };\n })), Match.when({ method: \"stored\" }, readStoredToken), Match.when({ method: \"oauth\" }, readStoredToken), Match.exhaustive);\n });\n const logout = (_profileName, config) => Match.value(config).pipe(Match.when({ method: \"env\" }, () => Effect.void), Match.when({ method: \"stored\" }, () => Effect.void), \n // Railway account tokens have no revocation endpoint for CLI-session\n // tokens, so logout just drops the locally stored token.\n Match.when({ method: \"oauth\" }, () => Effect.void), Match.exhaustive);\n const login = (profileName, config) => Match.value(config)\n .pipe(Match.when({ method: \"env\" }, () => getEnvRedacted(RAILWAY_API_TOKEN_ENV).pipe(Effect.flatMap((token) => token\n ? Effect.void\n : Effect.fail(new AuthError({\n message: `Railway: ${RAILWAY_API_TOKEN_ENV} is not set. Export it, or run ` +\n `\\`alchemy profile edit --profile ${profileName} --reconfigure ${RAILWAY_AUTH_PROVIDER_NAME}\\` to switch methods.`,\n }))))), \n // Railway account tokens neither expire nor refresh, so login only\n // (re-)prompts when no credential is stored yet.\n Match.when({ method: \"stored\" }, (config) => Effect.succeed(config)), Match.when({ method: \"oauth\" }, (config) => Effect.succeed(config)), Match.exhaustive)\n .pipe(Effect.mapError((e) => e instanceof AuthError\n ? e\n : new AuthError({ message: \"login failed\", cause: e })));\n const details = (profileName, config) => resolveCredentials(profileName, config).pipe(Effect.map((creds) => ({\n lines: [\n { key: \"token\", value: displayRedacted(creds.token, 6) },\n { key: \"tokenKind\", value: creds.tokenKind },\n { key: \"apiBaseUrl\", value: creds.apiBaseUrl },\n {\n key: \"source\",\n value: creds.source.details\n ? `${creds.source.type} - ${creds.source.details}`\n : creds.source.type,\n },\n ],\n })));\n const readEnvironment = Effect.gen(function* () {\n const token = yield* getEnvRedactedRequired(RAILWAY_API_TOKEN_ENV);\n const apiBaseUrl = yield* resolveApiBaseUrl();\n return {\n type: \"token\",\n token,\n tokenKind: \"account\",\n apiBaseUrl,\n source: { type: \"env\", details: RAILWAY_API_TOKEN_ENV },\n };\n });\n return {\n configSchema: RailwayAuthConfigSchema,\n configure: configureCredentials,\n configureWith,\n configureMethods,\n logout,\n login,\n details,\n read: resolveCredentials,\n readEnvironment,\n environment: [\n {\n name: RAILWAY_API_TOKEN_ENV,\n required: true,\n secret: true,\n description: \"Account API token (Bearer).\",\n },\n {\n name: RAILWAY_API_URL_ENV,\n required: false,\n description: \"Backboard API base URL override.\",\n },\n ],\n };\n}));\n//# sourceMappingURL=AuthProvider.js.map","import { DEFAULT_API_BASE_URL } from \"@distilled.cloud/stripe\";\nimport * as Effect from \"effect/Effect\";\nimport * as Redacted from \"effect/Redacted\";\nimport { getEnv, getEnvRedactedRequired } from \"../Auth/Env.js\";\nimport { makeStoredAuthProvider, storedSecret, storedValueText, } from \"../Auth/StoredAuthProvider.js\";\nexport const STRIPE_AUTH_PROVIDER_NAME = \"Stripe\";\nexport const STRIPE_API_KEY_ENV = \"STRIPE_API_KEY\";\nexport const STRIPE_API_BASE_URL_ENV = \"STRIPE_API_BASE_URL\";\nconst stripeAuth = makeStoredAuthProvider({\n provider: STRIPE_AUTH_PROVIDER_NAME,\n fields: [\n { name: \"apiKey\", label: \"Stripe Secret API Key\", secret: true },\n {\n name: \"apiBaseUrl\",\n label: \"Stripe API base URL\",\n optional: true,\n placeholder: DEFAULT_API_BASE_URL,\n },\n ],\n toResolved: (values) => ({\n type: \"apiKey\",\n apiKey: storedSecret(values.apiKey) ?? Redacted.make(\"\"),\n apiBaseUrl: storedValueText(values.apiBaseUrl) ?? DEFAULT_API_BASE_URL,\n source: { type: \"stored\" },\n }),\n readEnvironment: Effect.all({\n apiKey: getEnvRedactedRequired(STRIPE_API_KEY_ENV),\n apiBaseUrl: getEnv(STRIPE_API_BASE_URL_ENV),\n }).pipe(Effect.map(({ apiKey, apiBaseUrl }) => ({\n type: \"apiKey\",\n apiKey,\n apiBaseUrl: apiBaseUrl ?? DEFAULT_API_BASE_URL,\n source: {\n type: \"env\",\n details: apiBaseUrl\n ? `${STRIPE_API_KEY_ENV}, ${STRIPE_API_BASE_URL_ENV}`\n : STRIPE_API_KEY_ENV,\n },\n }))),\n environment: [\n { name: STRIPE_API_KEY_ENV, required: true, secret: true },\n { name: STRIPE_API_BASE_URL_ENV, required: false },\n ],\n});\n/**\n * Layer that registers the Stripe {@link AuthProvider} into the\n * {@link AuthProviders} registry. Include this in the Stripe `providers()`\n * layer so the alchemy CLI can discover it.\n *\n * Auth is a Stripe secret API key (`STRIPE_API_KEY`, typically `sk_test_…`\n * or `sk_live_…`). There is no OAuth flow. An optional\n * `STRIPE_API_BASE_URL` overrides the API root (default\n * `https://api.stripe.com`).\n */\nexport const StripeAuth = stripeAuth.layer;\n//# sourceMappingURL=AuthProvider.js.map","import * as Output from \"./Output.js\";\n// special runtime-only symbol for probing the Ref proxy for its metadata\nconst RefMetadata = Symbol.for(\"alchemy/RefMetadata\");\nexport const isRef = (s) => s && s[RefMetadata] !== undefined;\nexport const getRefMetadata = (ref) => ref[RefMetadata];\nexport const ref = (id, { stack, stage, } = {}, type) => {\n const ref = new Proxy({}, {\n get: (_, prop) => {\n if (prop === RefMetadata) {\n return {\n stack,\n stage,\n id,\n type,\n };\n }\n return Output.of(ref)[prop];\n },\n });\n return ref;\n};\n//# sourceMappingURL=Ref.js.map","/**\n * Separator used in FQN strings.\n */\nexport const FQN_SEPARATOR = \"/\";\n/**\n * Encode an FQN for safe filesystem storage.\n * Replaces `/` (FQN separator) with `__` to avoid subdirectory creation.\n */\nexport const encodeFqn = (fqn) => fqn.replaceAll(FQN_SEPARATOR, \"__\");\n/**\n * Decode a filename back to FQN.\n */\nexport const decodeFqn = (filename) => filename.replaceAll(\"__\", FQN_SEPARATOR);\n/**\n * Convert a NamespaceNode chain to an array of namespace IDs, from root to leaf.\n *\n * @example\n * ```ts\n * const ns = { Id: \"Child\", Parent: { Id: \"Parent\", Parent: { Id: \"Root\" } } };\n * toPath(ns); // [\"Root\", \"Parent\", \"Child\"]\n * ```\n */\nexport const toPath = (ns) => {\n if (!ns)\n return [];\n const path = [];\n let current = ns;\n while (current) {\n path.unshift(current.Id);\n current = current.Parent;\n }\n return path;\n};\n/**\n * Create a fully-qualified name (FQN) from a namespace and logical ID.\n * The FQN is a flat key suitable for state storage.\n *\n * @example\n * ```ts\n * const ns = { Id: \"Child\", Parent: { Id: \"Parent\" } };\n * toFqn(ns, \"MyResource\"); // \"Parent/Child/MyResource\"\n * toFqn(undefined, \"MyResource\"); // \"MyResource\"\n * ```\n */\nexport const toFqn = (ns, logicalId) => {\n const path = toPath(ns);\n path.push(logicalId);\n return path.join(FQN_SEPARATOR);\n};\n/**\n * Parse an FQN back into namespace path segments and the logical ID.\n *\n * @example\n * ```ts\n * parseFqn(\"Parent/Child/MyResource\"); // { path: [\"Parent\", \"Child\"], logicalId: \"MyResource\" }\n * parseFqn(\"MyResource\"); // { path: [], logicalId: \"MyResource\" }\n * ```\n */\nexport const parseFqn = (fqn) => {\n const parts = fqn.split(FQN_SEPARATOR);\n const logicalId = parts.pop();\n return { path: parts, logicalId };\n};\n/**\n * Reconstruct a NamespaceNode chain from a path array.\n *\n * @example\n * ```ts\n * fromPath([\"Parent\", \"Child\"]);\n * // { Id: \"Child\", Parent: { Id: \"Parent\" } }\n * ```\n */\nexport const fromPath = (path) => {\n if (path.length === 0)\n return undefined;\n let node;\n for (const id of path) {\n node = { Id: id, Parent: node };\n }\n return node;\n};\n//# sourceMappingURL=FQN.js.map","import * as Context from \"effect/Context\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport * as Option from \"effect/Option\";\nimport { AlchemyContext } from \"./AlchemyContext.js\";\n/**\n * ProviderModePolicy opts resources OUT of local emulation: when `true`,\n * resources registered while it is in context resolve the **live**\n * provider even during `alchemy dev`.\n *\n * Apply it with the {@link remote} combinator. During `alchemy deploy`\n * everything is live anyway, so the policy only has an effect in dev.\n *\n * Tri-state `Context.Reference`: `undefined` (the default — no explicit\n * decoration, inherit/run default), `true` (`remote()`), `false`\n * (`remote(false)` — explicitly follow the run default again). The unset vs\n * explicit distinction is load-bearing for conflict detection at\n * registration (see `Resource.ts`).\n */\nexport const ProviderModePolicy = Context.Reference(\"ProviderModePolicy\", { defaultValue: () => undefined });\n/**\n * The same resource (identified by FQN) was registered (`yield*`ed) from two\n * places whose ambient {@link ProviderModePolicy} disagree — e.g. once inside\n * `remote()` and once without it. Context-based decoration cannot decide which\n * one wins, so the engine fails loudly instead of silently picking one.\n *\n * Fix: register the resource once and close over the returned value, or make\n * both registration sites agree.\n */\nexport class ConflictingProviderModeError extends Data.TaggedError(\"ConflictingProviderModeError\") {\n}\n/**\n * Prefix marking a locally-emulated resource's physical identity. Local\n * providers fabricate ids/names with this prefix (`dev:<uuid>` queue and\n * namespace ids, `dev:`-prefixed bucket names, ...) so a resource's\n * persisted attributes reveal which runtime hosts it even without the\n * `providerMode` stamp.\n */\nexport const LOCAL_ID_PREFIX = \"dev:\";\n/**\n * Does a persisted attributes value carry a local identity marker — any\n * string value (at any depth) with the {@link LOCAL_ID_PREFIX}? Persisted\n * attrs are plain JSON (state commits strip unresolved values), so a\n * structural scan is safe.\n */\nexport const hasLocalIdentity = (value) => {\n if (typeof value === \"string\")\n return value.startsWith(LOCAL_ID_PREFIX);\n if (Array.isArray(value))\n return value.some(hasLocalIdentity);\n if (typeof value === \"object\" && value !== null) {\n return Object.values(value).some(hasLocalIdentity);\n }\n return false;\n};\n/**\n * The mode a persisted state row was actually reconciled with: its stamped\n * `providerMode`, or — for legacy rows written before stamping existed —\n * `\"local\"` when the persisted attributes carry a {@link LOCAL_ID_PREFIX}\n * identity marker, `\"live\"` otherwise.\n *\n * An unstamped row without a marker predates provider modes or was written\n * by a mode-agnostic provider — in both cases the write acted on the REAL\n * cloud, so the row's physical resource is `\"live\"`. Assuming the current\n * run's mode instead silently adopts a deployed cloud resource as a local\n * instance during `alchemy dev`: the row noops (or restarts locally over\n * the live attrs), gets re-stamped `\"local\"`, and the live resource becomes\n * untracked — it is never deleted by a later destroy or replacement, and\n * its deployed URL keeps serving.\n *\n * An unstamped row WITH a marker (e.g. a queue with a `dev:<uuid>` id\n * written by `alchemy dev` on a pre-stamping version) is the mirror case:\n * assuming `\"live\"` hands the `dev:` identity to the live provider, which\n * sends it to the real cloud API (Cloudflare rejects it as a malformed\n * parameter, permanently wedging the destroy). The marker proves the row\n * was reconciled locally, so it is handled as `\"local\"`.\n *\n * For mode-agnostic providers the returned mode is harmless either way:\n * `providerForMode` ignores the mode when the provider has a single\n * implementation.\n */\nexport const stampedMode = (row) => row.providerMode ?? (hasLocalIdentity(row.attr) ? \"local\" : \"live\");\n/**\n * Run the wrapped resources **remotely (against the real cloud) even during\n * `alchemy dev`** — the opt-out from local emulation. During `alchemy deploy`\n * this is a no-op (everything is remote).\n *\n * Captured at registration time like `adopt()` / `retain()`, so it can be\n * applied to a single resource or a whole scope:\n *\n * ```ts\n * // This queue talks to real Cloudflare even in dev\n * const queue = yield* Queue(\"Jobs\", {}).pipe(Alchemy.remote());\n *\n * // Everything in this scope runs live in dev\n * yield* Effect.gen(function* () {\n * const queue = yield* Queue(\"Jobs\", {});\n * const consumer = yield* Consumer(\"JobsConsumer\", { queue });\n * }).pipe(Alchemy.remote());\n * ```\n *\n * `remote(false)` (or an `Effect<boolean>` resolving to false) removes the\n * pin — the resource follows the run default again.\n *\n * Providers with a single implementation are mode-agnostic and already run\n * live in dev; `remote()` on them is a no-op.\n */\nexport const remote = ((enabled = true) => (eff) => eff.pipe(typeof enabled === \"boolean\"\n ? Effect.provideService(ProviderModePolicy, enabled)\n : Effect.provideServiceEffect(ProviderModePolicy, enabled)));\n/**\n * Resolve the run-level default provider mode:\n *\n * 1. An ambient {@link ProviderModePolicy} of `true` (e.g. `remote()` wrapped\n * around a whole program) forces `\"live\"`.\n * 2. Otherwise `AlchemyContext.dev` decides: `dev: true` → `\"local\"`.\n * 3. Without an AlchemyContext (bare engine tests), default to `\"live\"`.\n */\nexport const defaultProviderMode = Effect.gen(function* () {\n if (yield* ProviderModePolicy)\n return \"live\";\n const ctx = yield* Effect.serviceOption(AlchemyContext);\n return Option.match(ctx, {\n onNone: () => \"live\",\n onSome: (c) => (c.dev ? \"local\" : \"live\"),\n });\n});\n//# sourceMappingURL=ProviderMode.js.map","import * as Context from \"effect/Context\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport * as Predicate from \"effect/Predicate\";\nimport { defaultProviderMode } from \"./ProviderMode.js\";\nexport const Provider = (type) => Context.Service()(type);\nconst withDefaultList = (service) => service.list ? service : { ...service, list: () => Effect.succeed([]) };\nexport const effect = (cls, eff) => Layer.effect(\n// @ts-expect-error\nProvider(cls.Type), Effect.map(eff, (service) => ({\n aliases: \"Aliases\" in cls ? cls.Aliases : undefined,\n ...withDefaultList(service),\n})));\nexport const succeed = (cls, service) => \n// @ts-expect-error\nLayer.succeed(Provider(cls.Type), {\n aliases: \"Aliases\" in cls ? cls.Aliases : undefined,\n ...withDefaultList(service),\n});\nexport const ProviderCollection = () => (id) => Context.Service()(id);\nexport const collection = (resources) => Effect.gen(function* () {\n const context = yield* Effect.context();\n const providers = Object.fromEntries(yield* Effect.all(resources.map((resource) => \"Provider\" in resource\n ? resource.Provider.pipe(Effect.map((provider) => [resource.Type, provider]))\n : Effect.succeed([\n resource.key,\n context.mapUnsafe.get(resource.key),\n ])), { concurrency: \"unbounded\" }));\n return {\n kind: \"ProviderCollection\",\n get: (service) => providers[service],\n providers,\n };\n});\nexport const isProviderCollectionService = (value) => {\n return (Predicate.isObject(value) &&\n Predicate.hasProperty(value, \"kind\") &&\n value.kind === \"ProviderCollection\");\n};\n/**\n * Structural check for a {@link ProviderService} living in the Effect\n * context. Providers are keyed by their canonical resource type; when\n * searching for a legacy alias, the tag key won't match, so lookup has to\n * recognize provider services by shape.\n */\nexport const isProviderService = (value) => Predicate.isObject(value) &&\n Predicate.hasProperty(value, \"reconcile\") &&\n Predicate.isFunction(value.reconcile) &&\n Predicate.hasProperty(value, \"delete\") &&\n Predicate.isFunction(value.delete);\n/**\n * Resolve the concrete service for `mode` from a provider found in context.\n *\n * - `mode === undefined` → the service as registered (for dual\n * registrations that is the delegating service for the run's default\n * mode).\n * - `mode` given and the provider carries {@link ProviderService.modes} →\n * the (lazily built, memoized) variant for that mode.\n * - `mode` given but the provider is mode-agnostic → the service itself:\n * a single implementation satisfies every mode (hybrid), which is what\n * lets live-only resources (e.g. R2 buckets) participate in dev runs.\n */\nexport const providerForMode = (service, mode) => mode !== undefined && service.modes !== undefined\n ? service.modes[mode]\n : Effect.succeed(service);\n/**\n * Resolve where a resource's deploy-time binding clients should be routed:\n * its registration-captured {@link ResourceLike.Mode} (`Alchemy.remote()`\n * → `\"live\"`) or the run default (`alchemy dev` → `\"local\"`) — the same\n * resolution `Plan.make` applies to lifecycle operations — combined with\n * whether the provider registered a local data plane at all.\n */\nexport const describeDataPlane = (resource) => Effect.gen(function* () {\n const found = yield* tryFindProviderRegistrationByType(resource.Type);\n if (Option.isNone(found))\n return { kind: \"unregistered\" };\n const provider = found.value;\n if (provider.modes === undefined)\n return { kind: \"agnostic\" };\n const mode = resource.Mode ?? (yield* defaultProviderMode);\n if (mode !== \"local\") {\n const layer = provider.liveDataPlane?.();\n return layer !== undefined\n ? { kind: \"live\", layer }\n : { kind: \"live\" };\n }\n if (provider.localDataPlane === undefined) {\n return { kind: \"undeclared\", providerType: resource.Type };\n }\n return { kind: \"local\", layer: provider.localDataPlane() };\n});\n/**\n * The data-plane override layer for a resource, or `undefined` when its\n * clients target the real cloud for any reason (see\n * {@link describeDataPlane} for which).\n */\nexport const resolveLocalDataPlane = (resource) => describeDataPlane(resource).pipe(Effect.map((plane) => (plane.kind === \"local\" ? plane.layer : undefined)));\nexport const findProviderByType = ((type, mode) => tryFindProviderByType(type, mode).pipe(Effect.flatMap(Option.match({\n onNone: () => Effect.die(`Provider not found for ${type}`),\n onSome: (provider) => Effect.succeed(provider),\n}))));\n/**\n * Resolve the concrete provider for the requested or current run mode.\n * Typed provider lookup by resource class (or {@link Platform}) value. Infers\n * `R` from the class so `provider.list()` / `provider.read(...)` return the\n * resource's `Attributes` shape — prefer this over {@link findProviderByType},\n * which only takes the type string.\n */\nexport const findProvider = (resource, mode) => findProviderByType((resource.Type ?? resource.key), mode);\n/**\n * A persisted state row references a resource type with no registered\n * provider — the type was removed from the program (or renamed without an\n * alias) while its state row still exists (\"zombie\" row).\n *\n * This is FATAL at plan time: the program and state fundamentally disagree,\n * and without the provider the row's physical resource cannot be deleted\n * anyway, so proceeding would only strand it silently. The plan dies with\n * this error; nothing is deployed or destroyed until the provider is\n * re-registered (or aliased), or the state row is cleared manually.\n */\nexport class MissingProviderError extends Data.TaggedError(\"MissingProviderError\") {\n}\n/** Build the fatal plan-time error for a zombie state row. */\nexport const missingProviderError = (resourceType, fqn) => new MissingProviderError({\n message: `No provider is registered for resource type '${resourceType}' ` +\n `(state row '${fqn}'). The type was removed from the program or ` +\n \"renamed without an alias. Re-register the provider (or add the \" +\n \"old name to the resource's `aliases`) so this row can be \" +\n \"destroyed, or clear the state row manually if the physical \" +\n \"resource is already gone.\",\n resourceType,\n fqn,\n});\n/** Resolve a concrete provider, using the current run's mode when omitted. */\nexport const tryFindProviderByType = (resourceType, mode) => Effect.gen(function* () {\n const found = yield* tryFindProviderRegistrationByType(resourceType);\n if (Option.isNone(found))\n return found;\n return Option.some(yield* providerForMode(found.value, mode ?? (yield* defaultProviderMode)));\n});\n/** Inspect registration metadata without constructing either provider variant. */\nexport const tryFindProviderRegistrationByType = Effect.fn(function* (resourceType) {\n const found = yield* Effect.gen(function* () {\n const Tag = Provider(resourceType);\n const direct = yield* Effect.serviceOption(Tag);\n if (Option.isSome(direct)) {\n return direct;\n }\n const context = yield* Effect.context();\n for (const value of context.mapUnsafe.values()) {\n if (isProviderCollectionService(value)) {\n const provider = value.get(resourceType);\n if (provider) {\n return Option.some(provider);\n }\n }\n }\n // State persisted before a type rename carries the legacy name, so no\n // provider is keyed under it. Fall back to a provider that declares the\n // name in its `aliases` — scanning both bare Provider layers and the\n // members of every ProviderCollection.\n for (const value of context.mapUnsafe.values()) {\n if (isProviderCollectionService(value)) {\n for (const provider of Object.values(value.providers)) {\n if (provider.aliases?.includes(resourceType)) {\n return Option.some(provider);\n }\n }\n }\n else if (isProviderService(value) &&\n value.aliases?.includes(resourceType)) {\n return Option.some(value);\n }\n }\n return Option.none();\n });\n return found;\n});\n//# sourceMappingURL=Provider.js.map","import * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport * as Effectable from \"effect/Effectable\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport { AdoptPolicy } from \"./AdoptPolicy.js\";\nimport { toFqn } from \"./FQN.js\";\nimport { CurrentNamespace } from \"./Namespace.js\";\nimport * as Output from \"./Output.js\";\nimport { Provider } from \"./Provider.js\";\nimport { ConflictingProviderModeError, ProviderModePolicy, } from \"./ProviderMode.js\";\nimport { ref as makeRef } from \"./Ref.js\";\nimport { RemovalPolicy } from \"./RemovalPolicy.js\";\nimport { RenamePolicy } from \"./Rename.js\";\nimport { Self } from \"./Self.js\";\nimport { Stack } from \"./Stack.js\";\nexport const isResource = (value) => {\n // Require the full resource identity (Type AND FQN), not just `Type`:\n // user-authored prop objects legitimately carry a `Type` field (e.g.\n // Amazon States Language states like `{ Type: \"Pass\", End: true }` in a\n // Step Functions definition) and must not be mistaken for resources.\n // Locally-declared resources always expose both as own keys; refs\n // (`Resource.ref(...)`) deliberately report neither via `in` so they keep\n // routing through Output resolution.\n return (typeof value === \"object\" &&\n value !== null &&\n \"Type\" in value &&\n \"FQN\" in value);\n};\n/**\n * Does `value` reference an instance of the resource type `type` —\n * either a locally-declared resource or a `Resource.ref(...)` to one?\n *\n * Two constraints that ad-hoc guards get wrong for refs, which resolve\n * to Output-expression proxies:\n *\n * - Read `.Type` via property access (never `in`): the proxy answers\n * property reads with statically-known values but deliberately does\n * not report key existence (so {@link isResource} keeps routing refs\n * through Output resolution instead of the upstream-node lookup).\n * - Accept `typeof value === \"function\"`: the proxy's target is\n * callable (it needs an `apply` trap), so refs are not `\"object\"`.\n *\n * Either mistake silently rejects refs — in a Worker `env` that\n * degrades the binding to a plain JSON var.\n */\nexport const isResourceOfType = (value, type) => (typeof value === \"object\" || typeof value === \"function\") &&\n value !== null &&\n value.Type === type;\n/**\n * A tagged platform resource declared with neither props nor an inline\n * implementation was `yield*`ed, but its `.make(props, impl)` Layer never\n * built.\n *\n * Such a tag carries no configuration on its own — props AND impl both live\n * on the Layer — so its registration is a forward reference with `undefined`\n * props that the Layer's build repairs (in either order; see the #874\n * circular env-tag pattern). Props still `undefined` once the whole program\n * has evaluated means the Layer was never provided; `Plan.make` fails fast\n * with this error instead of letting the failure surface deep inside\n * whichever provider first reads a prop (e.g. `TypeError: undefined is not\n * an object (evaluating 'news.name')` in the Cloudflare Worker pre-create).\n */\nexport class MissingImplementationError extends Data.TaggedError(\"MissingImplementationError\") {\n}\nexport const missingImplementation = (type, id) => new MissingImplementationError({\n type,\n id,\n message: [\n `${type}<${id}> was yielded without its implementation.`,\n \"\",\n `\\`${id}\\` is declared as a bare tag — no props, no inline implementation — so both come from its \\`.make(...)\\` Layer:`,\n \"\",\n ` export class ${id} extends ${type}<${id}>()(\"${id}\") {}`,\n ` export const ${id}Live = ${id}.make({ /* props */ }, Effect.gen(function* () { /* ... */ }));`,\n \"\",\n `That Layer is not in scope where \\`${id}\\` is yielded. Provide it to the Stack's program:`,\n \"\",\n \" Alchemy.Stack(\",\n ` \"my-stack\",`,\n \" { providers, state },\",\n \" Effect.gen(function* () {\",\n ` const instance = yield* ${id};`,\n ` }).pipe(Effect.provide([${id}Live])),`,\n \" )\",\n \"\",\n `If \\`${id}\\` is not Effect-native, declare it with props instead: \\`()(\"${id}\", { /* props */ })\\`.`,\n ].join(\"\\n\"),\n});\n/**\n * Creates a resource constructor for a concrete resource type.\n *\n * The returned constructor registers the resource on the current stack,\n * resolves input props, exposes output attributes as `Output` expressions, and\n * records bindings contributed by policies and event sources. Resource\n * providers are attached separately through `.provider`.\n */\nexport function Resource(type, options) {\n const defaultRemovalPolicy = options?.defaultRemovalPolicy ?? \"destroy\";\n const self = Self(type);\n const constructor = (id, props) => Effect.gen(function* () {\n const stack = yield* Stack;\n const namespace = yield* CurrentNamespace;\n const fqn = toFqn(namespace, id);\n // `remote()` opts resources out of local emulation during dev. The\n // captured Mode is either \"live\" (pinned) or undefined (run default).\n // The Reference default is `undefined` — \"no explicit decoration\" —\n // which is distinct from an explicit `remote(false)`.\n const ambientPolicy = yield* ProviderModePolicy;\n const ambientMode = ambientPolicy\n ? \"live\"\n : undefined;\n const existing = stack.resources[fqn];\n if (existing) {\n // A resource may be `yield*`ed from several places (idempotent\n // registration). If a later site carries an *explicit* ambient\n // ProviderModePolicy that disagrees with what the resource was\n // registered with, the decorations are conflicting — fail loudly\n // instead of silently picking one. A later site with NO ambient\n // policy simply inherits the registered resource (the common\n // \"reference it from elsewhere\" pattern).\n if (ambientPolicy !== undefined && existing.Mode !== ambientMode) {\n return yield* Effect.die(new ConflictingProviderModeError({\n message: `Resource '${fqn}' was registered with provider mode ` +\n `'${existing.Mode ?? \"default\"}' but is now being registered ` +\n `with conflicting mode '${ambientMode ?? \"default\"}'. A ` +\n \"resource must resolve to a single provider mode: register \" +\n \"it once and close over the returned value, or make both \" +\n \"registration sites agree (e.g. wrap both in the same \" +\n \"`remote()` scope).\",\n fqn,\n existingMode: existing.Mode,\n conflictingMode: ambientMode,\n }));\n }\n // // TODO(sam): check if props are different and die\n return existing;\n }\n const bind = (...args) => typeof args[0] === \"string\"\n ? Effect.gen(function* () {\n const [sid, data] = args;\n (stack.bindings[fqn] ??= []).push({\n sid,\n data,\n });\n return undefined;\n })\n : (data) => {\n const stringifyBindArg = (arg) => {\n if (arg === undefined) {\n return undefined;\n }\n if (Array.isArray(arg)) {\n return arg\n .flatMap((item) => {\n const stringified = stringifyBindArg(item);\n return stringified === undefined ? [] : [stringified];\n })\n .join(\", \");\n }\n if (arg &&\n (typeof arg === \"object\" || typeof arg === \"function\")) {\n if (\"LogicalId\" in arg && typeof arg.LogicalId === \"string\") {\n return arg.LogicalId;\n }\n if (\"id\" in arg && typeof arg.id === \"string\") {\n return arg.id;\n }\n }\n return String(arg);\n };\n return bind(`${args[0]\n .flatMap((text, i) => {\n const stringified = stringifyBindArg(args[i + 1]);\n return stringified !== undefined\n ? [text, stringified]\n : [text];\n })\n .join(\"\")}`, data);\n };\n const target = {\n Type: type,\n Namespace: namespace,\n FQN: fqn,\n LogicalId: id,\n Props: props,\n Provider: ProviderTag,\n RemovalPolicy: yield* Effect.serviceOption(RemovalPolicy).pipe(Effect.map(Option.getOrElse(() => defaultRemovalPolicy))),\n Adopt: yield* Effect.serviceOption(AdoptPolicy).pipe(Effect.map(Option.getOrUndefined)),\n Mode: ambientMode,\n RequiresImplementation: options?.requiresImplementation || undefined,\n // Bare-string former ids resolve against the SAME namespace as the\n // resource's own id, so `renamedFrom(\"Site/Worker\")` declared at the\n // caller's level claims `<callerNs>/Site/Worker`; the `{ fqn }` form\n // is absolute (cross-namespace moves).\n FormerFqns: yield* Effect.serviceOption(RenamePolicy).pipe(Effect.map(Option.match({\n onNone: () => undefined,\n onSome: (formerIds) => formerIds.map((formerId) => typeof formerId === \"string\"\n ? toFqn(namespace, formerId)\n : formerId.fqn),\n }))),\n bind,\n toString() {\n return `Resource<${this.Type}>(${this.LogicalId})`;\n },\n [Symbol.toPrimitive](hint) {\n return hint === \"number\" ? NaN : this.toString();\n },\n };\n const Resource = (stack.resources[fqn] = new Proxy(target, {\n set: (t, prop, value) => {\n t[prop] = value;\n return true;\n },\n get: (t, prop) => typeof prop === \"symbol\" || prop in t\n ? t[prop]\n : new Output.PropExpr(Output.of(Resource), prop),\n }));\n Resource.Props = Effect.isEffect(props)\n ? // @effect-diagnostics-next-line anyUnknownInErrorContext:off\n yield* props.pipe(Effect.provide(Layer.mergeAll(Layer.succeed(Self, Resource), Layer.succeed(Self(type), Resource))))\n : props;\n return Resource;\n });\n const ProviderTag = Provider(type);\n const Service = {\n /**\n * Build a typed reference to a deployed instance of this resource\n * — in the current stack/stage by default, or in another via\n * `options`. Resolves to the same shape as `yield*\n * MyResource(\"id\", props)` so downstream code can read attributes\n * (`ref.someAttr`) exactly the way it would for a locally-declared\n * resource.\n */\n ref: (id, options) => Effect.succeed(Output.of(makeRef(id, options, type))),\n Type: type,\n Provider: ProviderTag,\n Self: self,\n Aliases: options?.aliases,\n };\n const ResourceClass = Object.assign((...args) => typeof args[0] === \"object\"\n ? Object.assign(ResourceClass, args[0])\n : constructor(...args), Service, \n // Make the constructor itself a real Effect: `yield* MyResource` resolves\n // to the constructor function (same as the old `asEffect()`), and\n // `Effect.isEffect(MyResource)` is now true so `Effect.all`/`forEach` work.\n Effectable.Prototype({\n label: `Resource<${type}>`,\n evaluate: () => Effect.succeed((id, props) => constructor(id, props)),\n }));\n return ResourceClass;\n}\n//# sourceMappingURL=Resource.js.map","import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport * as Redacted from \"effect/Redacted\";\n/**\n * Canonicalize a logical key into a key that is safe to use as the name of an\n * environment variable / binding (`[a-zA-Z][a-zA-Z0-9_]*`).\n *\n * `RuntimeContext.set`/`get` are dumb key/value stores: they read and write the\n * key **verbatim**. It is the *caller's* responsibility to hand them a\n * canonical key, since the caller is the one that knows the logical key may\n * contain `.`/`-` (e.g. a dotted config name from `Platform`, or an\n * `Output.toString()` like `\"QueueSinkQueue.queueUrl\"`). Callers run the key\n * through this before calling `set`/`get` so both sides agree.\n */\nexport const sanitizeKey = (key) => key.replaceAll(/[^a-zA-Z0-9]/g, \"_\");\n/**\n * Detect the (already JSON-parsed) {@link RedactedMarker} shape. After\n * `JSON.parse` the marker is a plain object — `Redacted.isRedacted` is\n * always `false` on it — so detection is structural.\n */\nexport const isRedactedMarker = (value) => typeof value === \"object\" &&\n value !== null &&\n value._tag === \"Redacted\" &&\n \"value\" in value;\n/**\n * Returns true when {@link unpackEnvValue}'s `JSON.parse` would reinterpret\n * the raw string as something other than itself — a number (`\"123\"`), a\n * boolean, `null`, or a JSON document. Such strings must stay\n * `JSON.stringify`-packed; everything else round-trips verbatim through the\n * parse-failure fallback.\n */\nconst parsesAsJson = (value) => {\n try {\n JSON.parse(value);\n return true;\n }\n catch {\n return false;\n }\n};\n/**\n * Serialize a binding value for an env var: `Redacted` values are packed as\n * a {@link RedactedMarker}, non-string values as JSON.\n *\n * A plain string is stored **verbatim** whenever `JSON.parse` would reject\n * it — which is almost every real-world string (names, URLs, ids). Packing\n * those too would put `\"my-queue\"` (quote characters included) on the wire,\n * where anything that consumes the raw binding without going through\n * {@link unpackEnvValue} — the Cloudflare dashboard, a hand-written env\n * read, a queue-name comparison against `MessageBatch.queue` — sees the\n * quoted form and mismatches (#1243). Only ambiguous strings (`\"123\"`,\n * `\"null\"`, JSON documents) keep the pack so the read side can't\n * reinterpret them.\n */\nexport const packEnvValue = (value) => Redacted.isRedacted(value)\n ? JSON.stringify({\n _tag: \"Redacted\",\n value: Redacted.value(value),\n })\n : typeof value === \"string\" && !parsesAsJson(value)\n ? value\n : JSON.stringify(value);\n/**\n * Like {@link packEnvValue}, but a `Redacted` input keeps its `Redacted`\n * wrapper on the *outside* of the packed string, so deploy-time code can\n * route secrets through a dedicated channel (Cloudflare `secret_text`,\n * Secrets Store) instead of leaking them as plain env vars. The inner\n * payload still carries the marker for the runtime `get` accessor.\n */\nexport const packEnvValueKeepRedacted = (value) => Redacted.isRedacted(value)\n ? Redacted.make(packEnvValue(value))\n : packEnvValue(value);\n/**\n * Parse an env-var string produced by {@link packEnvValue} back into its\n * value: rebuild `Redacted` from the marker, return other JSON values\n * as-is, and fall back to the raw string for non-JSON input (a verbatim\n * string from `packEnvValue`, or an env var the user set directly).\n * `undefined` passes through.\n *\n * Runtime `get` accessors MUST feed this from the raw environment\n * (`process.env[key]` / the platform env object) — never through\n * `Config.String`: the ambient runtime `ConfigProvider` reifies bound\n * values (unwrapping the marker before it could be detected here), and\n * during init the ambient provider is the interceptor installed in\n * `Platform.ts`, whose runtime branch calls back into `ctx.get(key)` —\n * resolving through `Config` would re-enter it for the same key and\n * recurse forever.\n */\nexport const unpackEnvValue = (raw) => {\n if (raw === undefined) {\n return undefined;\n }\n try {\n const parsed = JSON.parse(raw);\n if (isRedactedMarker(parsed)) {\n return Redacted.make(parsed.value);\n }\n return parsed;\n }\n catch {\n return raw; // assume it's just a string\n }\n};\n/**\n * Context of the runtime environment.\n *\n * E.g. the context of a running Worker, Task, Process, Function\n */\nexport class RuntimeContext extends Context.Service()(\"RuntimeContext\") {\n static phantom = Layer.empty;\n}\nexport const CurrentRuntimeContext = Effect.serviceOption(RuntimeContext).pipe(Effect.map(Option.getOrUndefined));\n//# sourceMappingURL=RuntimeContext.js.map","import * as Context from \"effect/Context\";\nexport class Stage extends Context.Service()(\"Stage\") {\n}\n//# sourceMappingURL=Stage.js.map","import * as Context from \"effect/Context\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nexport const isActionState = (s) => !!s && s.kind === \"action\";\nexport const isResourceState = (s) => !!s && s.kind !== \"task\";\nexport class StateStoreError extends Data.TaggedError(\"StateStoreError\") {\n}\nexport class State extends Context.Service()(\"alchemy/State\") {\n}\n//# sourceMappingURL=State.js.map","import * as Predicate from \"effect/Predicate\";\nimport * as EffectRecord from \"effect/Record\";\nimport * as Redacted from \"effect/Redacted\";\nexport const isPrimitive = (value) => value === undefined ||\n value === null ||\n typeof value === \"boolean\" ||\n typeof value === \"number\" ||\n typeof value === \"string\" ||\n typeof value === \"symbol\" ||\n typeof value === \"bigint\";\nexport const isPlainObject = (value) => {\n if (!Predicate.isObject(value))\n return false;\n return Object.getPrototypeOf(value) === Object.prototype;\n};\n/**\n * Is `value` plain data the engine's deep walkers may traverse — an array,\n * or an object whose prototype is `Object.prototype`/`null`?\n *\n * Everything else (class instances: effect's Effect/Layer/Context, Dates,\n * SDK config objects, functions, ...) is a LEAF for every deep walker in\n * the engine. The engine cannot meaningfully evaluate, diff, or persist\n * *through* a foreign class instance — rebuilding one entry-by-entry strips\n * its prototype — and walking one is not safe: effect ≥4.0.0-beta.103's\n * Context is self-referential (`cacheRoot` points back at itself), which\n * sent the naive walk-everything traversal into unbounded recursion\n * (#1082). Resources and Outputs are detected structurally *before* this\n * gate, so dependencies declared in plain props are unaffected.\n */\nexport const isPlainData = (value) => {\n if (Array.isArray(value))\n return true;\n if (typeof value !== \"object\" || value === null)\n return false;\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n};\n/**\n * Rebuild a plain-data value by mapping each child through `walk`,\n * preserving the shape (array → array, object → object).\n *\n * Cycle-guarded by ancestor path: a value that appears on its own ancestor\n * chain is a true cycle and becomes `undefined` (it could never serialize\n * or persist anyway). The guard is scoped to the current path — NOT a\n * visited-set — so a diamond (the same object legitimately referenced from\n * two places) is rebuilt in both places. Sync DFS only: add/delete around\n * the recursion is race-free. (#1082)\n */\nexport const mapPlainData = (value, ancestors, walk) => {\n if (ancestors.has(value))\n return undefined;\n ancestors.add(value);\n try {\n return Array.isArray(value)\n ? value.map(walk)\n : Object.fromEntries(Object.entries(value).map(([key, child]) => [key, walk(child)]));\n }\n finally {\n ancestors.delete(value);\n }\n};\nexport const stripFields = (value, empty) => {\n if (Array.isArray(value)) {\n return value.map((item) => stripFields(item, empty));\n }\n if (!isPlainObject(value))\n return value;\n return EffectRecord.map(EffectRecord.filter(value, (entry) => entry !== empty), (entry) => stripFields(entry, empty));\n};\nexport const stripNullFields = (value) => stripFields(value, null);\nexport const stripUndefinedFields = (value) => stripFields(value, undefined);\nexport const unwrapRedacted = (value) => {\n if (Redacted.isRedacted(value)) {\n return Redacted.value(value);\n }\n if (Array.isArray(value)) {\n return value.map(unwrapRedacted);\n }\n if (!isPlainObject(value))\n return value;\n return EffectRecord.map(value, unwrapRedacted);\n};\n//# sourceMappingURL=data.js.map","import * as Config from \"effect/Config\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport { pipe } from \"effect/Function\";\nimport { SingleShotGen } from \"effect/Utils\";\nimport { getRefMetadata, isRef } from \"./Ref.js\";\nimport { isResource } from \"./Resource.js\";\nimport { RuntimeContext, sanitizeKey } from \"./RuntimeContext.js\";\nimport { Stack } from \"./Stack.js\";\nimport { Stage } from \"./Stage.js\";\nimport * as State from \"./State/State.js\";\nimport { isPlainData, isPrimitive } from \"./Util/data.js\";\nconst inspect = Symbol.for(\"nodejs.util.inspect.custom\");\nexport const of = (resource) => {\n if (isRef(resource)) {\n const metadata = getRefMetadata(resource);\n return new RefExpr(metadata.stack, metadata.stage, metadata.id, \n // Surface the target's resource type and logical id as\n // statically-known properties so duck-typing classifiers (Worker\n // env bindings) and label/bind templates (`${resource.LogicalId}`,\n // `host.bind\\`...\\``) identify the ref exactly like a\n // locally-declared resource.\n {\n LogicalId: metadata.id,\n ...(metadata.type !== undefined ? { Type: metadata.type } : {}),\n });\n }\n return new ResourceExpr(resource);\n};\nexport const asOutput = (t) => isOutput(t)\n ? t\n : Effect.isEffect(t)\n ? new EffectExpr(VoidExpr, () => t)\n : new LiteralExpr(t);\n/**\n * Lift a plan-time Effect into an {@link Output}.\n *\n * The effect runs when the stack resolves the Output during plan/deploy —\n * with the stack's services (cloud credentials, region, ...) provided — and\n * never inside a deployed runtime: constructing the Output is inert, so\n * helpers built on `fromEffect` (e.g. AMI lookups) are safe to call from\n * composition code that is re-executed inside a Function/Worker/Instance\n * bundle.\n *\n * The effect must not fail (`E = never`) — die with a descriptive error for\n * unresolvable lookups.\n */\nexport const fromEffect = (effect) => new EffectExpr(VoidExpr, () => effect);\nexport const isOutput = (value) => value &&\n (typeof value === \"object\" || typeof value === \"function\") &&\n ExprSymbol in value;\nexport const ExprSymbol = Symbol.for(\"alchemy/Expr\");\nconst exprKind = (node) => node?.[ExprSymbol]?.kind ?? node?.kind;\nexport const isExpr = (value) => value &&\n (typeof value === \"object\" || typeof value === \"function\") &&\n ExprSymbol in value;\nexport class BaseExpr {\n // we use a kind tag instead of instanceof to protect ourselves from duplicate alchemy module imports\n constructor() { }\n as() {\n return this;\n }\n [Symbol.iterator]() {\n // @ts-expect-error - TODO(sam): fix this (works at runtime, but maybe indicates a bad assumption)\n return new SingleShotGen(this.asEffect());\n }\n asEffect() {\n return this.bind(this.toString());\n }\n bind(id) {\n // `set`/`get` store keys verbatim, so canonicalize here (the caller's job).\n const key = sanitizeKey(id);\n return RuntimeContext.pipe(Effect.flatMap((ctx) => Effect.map(ctx.set(key, this), (k) => ctx.get(k))));\n }\n pipe(...fns) {\n // @ts-expect-error\n return pipe(this, ...fns);\n }\n toString() {\n return this[inspect]();\n }\n}\nexport const isResourceExpr = (node) => exprKind(node) === \"ResourceExpr\";\nexport class ResourceExpr extends BaseExpr {\n src;\n stables;\n kind = \"ResourceExpr\";\n constructor(src, stables) {\n super();\n this.src = src;\n this.stables = stables;\n return proxy(this);\n }\n [inspect]() {\n return this.src.LogicalId;\n }\n}\nexport const isPropExpr = (node) => exprKind(node) === \"PropExpr\";\nexport class PropExpr extends BaseExpr {\n expr;\n identifier;\n kind = \"PropExpr\";\n constructor(expr, identifier) {\n super();\n this.expr = expr;\n this.identifier = identifier;\n return proxy(this);\n }\n [inspect]() {\n return `${this.expr[inspect]()}.${this.identifier.toString()}`;\n }\n}\nexport const literal = (value) => new LiteralExpr(value);\nexport const isLiteralExpr = (node) => exprKind(node) === \"LiteralExpr\";\nexport class LiteralExpr extends BaseExpr {\n value;\n kind = \"LiteralExpr\";\n constructor(value) {\n super();\n this.value = value;\n return proxy(this);\n }\n [inspect]() {\n return String(this.value);\n }\n}\nexport const VoidExpr = new LiteralExpr(void 0);\nexport const map = ((...args) => args.length === 1\n ? (output) => new ApplyExpr(output, args[0])\n : new ApplyExpr(args[0], args[1]));\n//Output.ApplyExpr<any, any, ResourceLike, any>\nexport const isApplyExpr = (node) => exprKind(node) === \"ApplyExpr\";\nexport class ApplyExpr extends BaseExpr {\n expr;\n f;\n kind = \"ApplyExpr\";\n constructor(expr, f) {\n super();\n this.expr = expr;\n this.f = f;\n return proxy(this);\n }\n [inspect]() {\n return `${this.expr[inspect]()}.map(${this.f.toString()})`;\n }\n}\nexport const mapEffect = (fn) => (output) => new EffectExpr(output, fn);\nexport const flatMap = ((...args) => args.length === 1\n ? (output) => new FlatMapExpr(output, args[0])\n : new FlatMapExpr(args[0], args[1]));\nexport const isFlatMapExpr = (node) => exprKind(node) === \"FlatMapExpr\";\nexport class FlatMapExpr extends BaseExpr {\n expr;\n f;\n kind = \"FlatMapExpr\";\n constructor(expr, f) {\n super();\n this.expr = expr;\n this.f = f;\n return proxy(this);\n }\n [inspect]() {\n return `${this.expr[inspect]()}.flatMap(${this.f.toString()})`;\n }\n}\nexport const isEffectExpr = (node) => exprKind(node) === \"EffectExpr\";\nexport class EffectExpr extends BaseExpr {\n expr;\n f;\n kind = \"EffectExpr\";\n constructor(expr, f) {\n super();\n this.expr = expr;\n this.f = f;\n return proxy(this);\n }\n [inspect]() {\n return `${this.expr[inspect]()}.mapEffect(${this.f.toString()})`;\n }\n}\nexport const isNamedExpr = (node) => exprKind(node) === \"NamedExpr\";\n/**\n * Wraps another `Expr` and overrides its `toString()` / inspect output.\n *\n * `BaseExpr` derives the binding id from `this.toString()`, so\n * wrapping an expression in `NamedExpr` makes that derived id stable and\n * caller-controlled (e.g. an env var name like `\"API_KEY\"`).\n */\nexport class NamedExpr extends BaseExpr {\n expr;\n bindingName;\n kind = \"NamedExpr\";\n constructor(expr, bindingName) {\n super();\n this.expr = expr;\n this.bindingName = bindingName;\n return proxy(this);\n }\n [inspect]() {\n return this.bindingName;\n }\n}\nexport const named = (expr, name) => new NamedExpr(expr, name);\nexport const all = (...outs) => new AllExpr(outs);\nexport const isAllExpr = (node) => exprKind(node) === \"AllExpr\";\nexport class AllExpr extends BaseExpr {\n outs;\n kind = \"AllExpr\";\n constructor(outs) {\n super();\n this.outs = outs;\n return proxy(this);\n }\n [inspect]() {\n return `all(${this.outs.map((out) => out[inspect]()).join(\", \")})`;\n }\n}\nexport const isRefExpr = (node) => exprKind(node) === \"RefExpr\";\nexport class RefExpr extends BaseExpr {\n stack;\n stage;\n resourceId;\n stables;\n kind = \"RefExpr\";\n constructor(stack, stage, resourceId, \n /**\n * Statically-known properties of the ref's target (currently its\n * resource `Type`), served as literals by the proxy instead of\n * `PropExpr`s — mirrors {@link ResourceExpr}'s `stables`.\n */\n stables) {\n super();\n this.stack = stack;\n this.stage = stage;\n this.resourceId = resourceId;\n this.stables = stables;\n return proxy(this);\n }\n [inspect]() {\n return `ref(${this.resourceId}, { stack: ${this.stack}, stage: ${this.stage} })`;\n }\n}\nexport const isStackRefExpr = (node) => exprKind(node) === \"StackRefExpr\";\n/**\n * A reference to the persisted output of a Stack at `(stack, stage)`.\n *\n * Resolved at evaluation time by reading `state.getOutput({ stack,\n * stage })`. Distinct from {@link RefExpr}, which references a\n * single resource's attributes within a stack/stage. `stage` may be\n * `undefined`, in which case it falls back to the current stage.\n */\nexport class StackRefExpr extends BaseExpr {\n stack;\n stage;\n kind = \"StackRefExpr\";\n constructor(stack, stage) {\n super();\n this.stack = stack;\n this.stage = stage;\n return proxy(this);\n }\n [inspect]() {\n return `stackRef(${this.stack}${this.stage ? `, { stage: ${this.stage} }` : \"\"})`;\n }\n}\n/**\n * Build an `Output<A>` referencing the persisted output of another\n * Stack. The returned Effect resolves to a lazy `Output<A>` whose\n * value is read from the state store at plan/apply time.\n *\n * Returns `Effect<Output<A>>` (not `Output<A>` directly) so that\n * `yield* Output.stackRef(...)` reads ergonomically inside an Effect\n * generator and lines up with `Resource.ref` and `Stack.stage.<name>`.\n */\nexport const stackRef = (stack, options = {}) => Effect.succeed(new StackRefExpr(stack, options.stage));\nexport const filter = (...outs) => outs.filter(isOutput);\nexport const interpolate = (template, ...args) => all(...args.map((arg) => (isOutput(arg) ? arg : literal(arg)))).pipe(map((args) => template\n .map((str, i) => str + (args[i] == null ? \"\" : String(args[i])))\n .join(\"\")));\nfunction proxy(self) {\n const target = Object.assign(() => { }, self);\n if (inspect in self) {\n Object.defineProperty(target, inspect, {\n value: self[inspect].bind(self),\n configurable: true,\n });\n }\n const proxy = new Proxy(target, {\n has: (_, prop) => prop === ExprSymbol || prop === inspect\n ? true\n : // Statically-known literal props (`Type`, `LogicalId` on\n // resource/ref exprs) are visible to `in` checks so duck-typing\n // code paths (e.g. `\"LogicalId\" in arg`) treat them like real\n // properties, matching what `get` serves.\n ((isResourceExpr(self) || isRefExpr(self)) &&\n self.stables !== undefined &&\n prop in self.stables) ||\n prop in self,\n get: (target, prop) => prop === Symbol.toPrimitive\n ? (hint) => {\n // Any JS-level coercion of an unresolved Output produces a\n // placeholder that *looks* like a real value but isn't:\n //\n // - `string` / `default` hints (`${output}`, `output + \"\"`,\n // `==` against a primitive) previously fell through to\n // `self.toString()` and returned the inspect form\n // (e.g. \"tunnel.tunnelId\"). The bogus string flowed\n // into resource props and into the cloud — only\n // surfacing as an opaque downstream error (see PR\n // description for a real Cloudflare DNS landing).\n //\n // - `number` hint (`+output`, `output * 2`,\n // `Math.max(0, output)`) previously returned NaN, which\n // propagates silently through arithmetic and lands as\n // \"the API rejected a NaN field\" much later.\n //\n // All three hints fail loud at the coercion site with a\n // pointer to the right composition API.\n throw new Error(`Cannot coerce Output<${self[inspect]()}> to a ` +\n `${hint === \"number\" ? \"number\" : \"string\"} via JS coercion. ` +\n `Use Output.interpolate\\`...\\` or Output.map(output, fn) ` +\n `to compose Outputs — the value isn't known until deploy time.`);\n }\n : prop === ExprSymbol\n ? self\n : prop === inspect\n ? target[inspect]\n : (isResourceExpr(self) || isRefExpr(self)) &&\n self.stables &&\n prop in self.stables\n ? self.stables[prop]\n : prop in self\n ? typeof self[prop] === \"function\" &&\n !(\"kind\" in self)\n ? new PropExpr(proxy, prop)\n : self[prop]\n : new PropExpr(proxy, prop),\n apply: (_, thisArg, args) => {\n if (isPropExpr(self)) {\n // Method-style combinators on an Output proxy. `map`/`apply` and\n // `mapEffect`/`effect` are aliases that mirror the standalone\n // `Output.map` / `Output.mapEffect` / `Output.flatMap` functions.\n if (self.identifier === \"map\" || self.identifier === \"apply\") {\n return new ApplyExpr(self.expr, args[0]);\n }\n else if (self.identifier === \"mapEffect\" ||\n self.identifier === \"effect\") {\n return new EffectExpr(self.expr, args[0]);\n }\n else if (self.identifier === \"flatMap\") {\n return new FlatMapExpr(self.expr, args[0]);\n }\n }\n return undefined;\n },\n });\n return proxy;\n}\n/// Evaluation\nexport class MissingSourceError extends Data.TaggedError(\"MissingSourceError\") {\n}\nexport class InvalidReferenceError extends Data.TaggedError(\"InvalidReferenceError\") {\n}\nexport const evaluate = (expr, upstream, ancestors = new Set()) => Effect.gen(function* () {\n if (isResource(expr)) {\n const srcId = expr.FQN;\n const src = upstream[srcId];\n if (!src) {\n // type-safety should prevent this but let the caller decide how to handle it\n return yield* new MissingSourceError({\n message: `Source ${srcId} not found`,\n srcId,\n });\n }\n return src;\n }\n else if (isOutput(expr)) {\n if (isResourceExpr(expr)) {\n const srcId = expr.src.FQN;\n const src = upstream[srcId];\n if (!src) {\n // type-safety should prevent this but let the caller decide how to handle it\n return yield* new MissingSourceError({\n message: `Source ${srcId} not found`,\n srcId,\n });\n }\n return src;\n }\n else if (isLiteralExpr(expr)) {\n return expr.value;\n }\n else if (isApplyExpr(expr)) {\n return expr.f(yield* evaluate(expr.expr, upstream));\n }\n else if (isEffectExpr(expr)) {\n // TODO(sam): the same effect shoudl be memoized so that it's not run multiple times\n return yield* expr.f(yield* evaluate(expr.expr, upstream));\n }\n else if (isFlatMapExpr(expr)) {\n // Resolve the source, hand it to `f` to produce a new Output, then\n // recursively evaluate that Output (flattening one level).\n const value = yield* evaluate(expr.expr, upstream);\n return yield* evaluate(expr.f(value), upstream);\n }\n else if (isAllExpr(expr)) {\n return yield* Effect.all(expr.outs.map((out) => evaluate(out, upstream)));\n }\n else if (isPropExpr(expr)) {\n return (yield* evaluate(expr.expr, upstream))?.[expr.identifier];\n }\n else if (isNamedExpr(expr)) {\n return yield* evaluate(expr.expr, upstream);\n }\n else if (isRefExpr(expr)) {\n const state = yield* yield* State.State;\n const stack = expr.stack ?? (yield* Stack).name;\n const stage = expr.stage ?? (yield* Stage);\n const resource = yield* state.get({\n stack,\n stage,\n fqn: expr.resourceId,\n });\n if (!resource) {\n return yield* Effect.fail(new InvalidReferenceError({\n message: `Reference to '${expr.resourceId}' in stack '${stack}' and stage '${stage}' not found. Have you deployed '${stage}' or '${stack}'?`,\n stack,\n stage,\n resourceId: expr.resourceId,\n }));\n }\n // RefExpr targets persisted resources; tasks aren't cross-stack\n // referenceable. Return the resource's output attrs, otherwise the\n // task's output value, otherwise undefined.\n return resource.attr ?? resource.output;\n }\n else if (isStackRefExpr(expr)) {\n const state = yield* yield* State.State;\n const stack = expr.stack;\n const stage = expr.stage ?? (yield* Stage);\n const output = yield* state.getOutput({ stack, stage });\n if (output == null) {\n return yield* Effect.fail(new InvalidReferenceError({\n message: `Reference to stack '${stack}' at stage '${stage}' not found. Have you deployed stage '${stage}' of '${stack}'?`,\n stack,\n stage,\n resourceId: stack,\n }));\n }\n return output;\n }\n }\n if (Config.isConfig(expr)) {\n // Resolve Config against the deploy environment — see resolveInput in\n // Plan.ts for rationale. `Config.Redacted` resolves to a `Redacted`,\n // which stays opaque via the leaf fallthrough below.\n return yield* evaluate(yield* expr, upstream, ancestors);\n }\n else if (isPlainData(expr)) {\n if (ancestors.has(expr)) {\n return undefined;\n }\n const nested = new Set(ancestors).add(expr);\n if (Array.isArray(expr)) {\n return yield* Effect.all(expr.map((item) => evaluate(item, upstream, nested)));\n }\n return Object.fromEntries(yield* Effect.all(Object.entries(expr).map(([key, value]) => evaluate(value, upstream, nested).pipe(Effect.map((value) => [key, value])))));\n }\n // Everything else is a leaf returned by identity: Duration, Redacted,\n // Date, and effect runtime values (a Worker's `exports` carries each\n // DO's `constructor` Effect and captured `services` Context). Rebuilding\n // a class instance entry-by-entry strips its prototype, and effect\n // ≥4.0.0-beta.103's Context is cyclic (#1082). This sits after\n // `Config.isConfig` on purpose — Configs are Effects but must resolve.\n return expr;\n});\nexport const hasOutputs = (value) => Object.keys(upstreamAny(value)).length > 0;\n/**\n * Cycle guard shared by the upstream walkers. Marks `value` as visited in\n * `seen`; returns true when it was already visited (the caller returns `{}`\n * — the first visit already contributed the subtree's resources to the\n * FQN-keyed union, so skipping repeats is lossless).\n */\nconst alreadySeen = (value, seen) => {\n if (seen.has(value)) {\n return true;\n }\n seen.add(value);\n return false;\n};\n// The dependency rule (#1082): a Resource or Output IS a dependency; plain\n// data (arrays, plain objects) is traversed to find them; every other value\n// — class instances like effect's Effect/Layer/Context, Dates, SDK objects,\n// functions — is a leaf. See `isPlainData` in Util/data.ts for why leaves\n// must never be walked.\nexport const upstreamAny = (value, seen = new WeakSet()) => {\n if (isResource(value)) {\n return { [value.FQN]: value };\n }\n else if (isExpr(value)) {\n return upstream(value, seen);\n }\n else if (isPlainData(value)) {\n if (alreadySeen(value, seen)) {\n return {};\n }\n return Object.assign({}, ...Object.values(value).map((value) => resolveUpstream(value, seen)));\n }\n return {};\n};\n// TODO(sam): add a type\nexport const upstream = (expr, seen = new WeakSet()) => {\n if (isResource(expr)) {\n return {\n [expr.FQN]: expr,\n };\n }\n else if (isResourceExpr(expr)) {\n return {\n [expr.src.FQN]: expr.src,\n };\n }\n else if (isPropExpr(expr)) {\n return upstream(expr.expr, seen);\n }\n else if (isAllExpr(expr)) {\n return Object.assign({}, ...expr.outs.map((out) => upstream(out, seen)));\n }\n else if (isEffectExpr(expr) ||\n isApplyExpr(expr) ||\n isFlatMapExpr(expr) ||\n isNamedExpr(expr)) {\n return upstream(expr.expr, seen);\n }\n else if (isPlainData(expr)) {\n if (alreadySeen(expr, seen)) {\n return {};\n }\n return Object.values(expr)\n .map((v) => upstream(v, seen))\n .reduce(toObject, {});\n }\n return {};\n};\n// TODO(sam): add a type\nexport const resolveUpstream = (value, seen = new WeakSet()) => {\n if (isPrimitive(value)) {\n return {};\n }\n else if (isResource(value)) {\n return { [value.FQN]: value };\n }\n else if (isOutput(value)) {\n return upstream(value, seen);\n }\n else if (isPlainData(value)) {\n if (alreadySeen(value, seen)) {\n return {};\n }\n return Object.fromEntries(Object.values(value)\n .map((v) => resolveUpstream(v, seen))\n .flatMap(Object.entries));\n }\n return {};\n};\nconst toObject = (acc, v) => ({\n ...acc,\n ...v,\n});\nexport const log = (_value) => Effect.gen(function* () {\n // TODO(sam): implement a log effect\n});\nexport const toEnvKey = (id, suffix) => `${replace(toUpper(id))}_${replace(toUpper(suffix))}`;\nexport const toUpper = (str) => str.toUpperCase();\nconst replace = (str) => str.replace(/-/g, \"_\");\n//# sourceMappingURL=Output.js.map","import * as Context from \"effect/Context\";\nexport const StackContext = Context.Service()(\"Stack\");\n//# sourceMappingURL=StackContext.js.map","import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Effectable from \"effect/Effectable\";\nexport const effectClass = ((impl) => impl === undefined\n ? (innerImpl) => effectClass(innerImpl)\n : Object.assign(class {\n }, \n // Spreading the Effect prototype onto the class (static side) makes the\n // class itself a real Effect — `Effect.isEffect(X)` is true, so\n // `Effect.all([X])` / `Effect.forEach` work — and subclasses\n // (`class Y extends effectClass(impl)`) inherit the protocol statically.\n Effectable.Prototype({\n label: \"alchemy/EffectClass\",\n evaluate: () => impl,\n })));\nexport const taggedFunction = (tag, fn) => {\n // The Proxy below forwards every Effect-protocol key to `tag` (already an\n // Effect), so `asEffect`/`[Symbol.iterator]`/`pipe` need no explicit\n // override — only `toString` diverges.\n const overrides = {\n toString: () => `${tag.toString()}.${fn.name}`,\n };\n return new Proxy(fn, {\n get: (target, prop, receiver) => Reflect.has(overrides, prop)\n ? Reflect.get(overrides, prop, receiver)\n : Reflect.has(target, prop)\n ? Reflect.get(target, prop, receiver)\n : Reflect.get(tag, prop, tag),\n has: (target, prop) => Reflect.has(overrides, prop) ||\n Reflect.has(target, prop) ||\n Reflect.has(tag, prop),\n });\n};\nexport const isYieldableEffect = (value) => Effect.isEffect(value) &&\n typeof value[Symbol.iterator] ===\n \"function\";\nexport const isEffectClassLike = (value) => typeof value === \"function\" &&\n typeof value.asEffect === \"function\";\nexport const isYieldableEffectLike = (value) => (isYieldableEffect(value) || isEffectClassLike(value)) &&\n !(\"~alchemy/Kind\" in value);\nexport const toEffectInterface = (raw) => ({\n raw,\n ...Object.fromEntries(Object.entries(raw).map(([key, value]) => [\n key,\n typeof value === \"function\"\n ? (...args) => Effect.tryPromise(async () => value(...args))\n : value,\n ])),\n});\n//# sourceMappingURL=effect.js.map","import * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Logger from \"effect/Logger\";\nimport { Path } from \"effect/Path\";\nimport { AlchemyContext } from \"../AlchemyContext.js\";\nexport const fileLogger = Effect.fn(function* (...segments) {\n const { dotAlchemy } = yield* AlchemyContext;\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path;\n const logFile = path.join(dotAlchemy, \"log\", ...segments);\n yield* fs.makeDirectory(path.dirname(logFile), { recursive: true });\n return yield* Logger.formatLogFmt.pipe(Logger.toFile(logFile, {\n flag: \"a\",\n }));\n});\n//# sourceMappingURL=FileLogger.js.map","import * as Effect from \"effect/Effect\";\nimport * as NodeNet from \"node:net\";\n/**\n * The process's working directory, captured ONCE at module load.\n *\n * Relative user paths (Vite roots, asset directories) must resolve against\n * this instead of a live `process.cwd()` read: third-party code sharing the\n * process can change the working directory transiently — most notably\n * cross-spawn, which `process.chdir`s into a spawn's `cwd` to resolve its\n * binary on PATH and then chdirs back. A live read racing that window\n * resolves against an unrelated directory. (`State/LocalState.ts` anchors\n * the state tree the same way, for the same reason.)\n */\nexport const initialCwd = process.cwd();\n/**\n * The extension of alchemy's own modules next to `importMetaUrl`: `.ts`\n * when running from `src/` (Bun, or Node under the dev loader), `.js`\n * from the compiled `lib/`. The dev loader namespaces file URLs with a\n * query, so only the pathname is consulted.\n */\nexport const moduleExtension = (importMetaUrl) => new URL(importMetaUrl).pathname.endsWith(\".ts\") ? \".ts\" : \".js\";\n/**\n * Opt out of cross-spawn's temporary `process.chdir` dance.\n *\n * cross-spawn (bundled inside vite, wrangler, next, tinyexec, playwright,\n * tsx, prisma, …) resolves a spawn's binary by `process.chdir`ing the\n * WHOLE parent process into the spawn's `cwd`, calling `which.sync`, and\n * chdiring back. In an alchemy process — which runs many resource builds\n * and hashers concurrently on one event loop — every fiber that touches a\n * relative path can race that window and resolve against an unrelated\n * directory.\n *\n * `process.chdir.disabled = true` is NODE'S OWN convention: Node sets it\n * on `process.chdir` inside worker threads (where chdir is forbidden),\n * and cross-spawn checks it to skip the dance. Setting it on the main\n * thread opts us into the exact mode every cross-spawn copy already runs\n * in inside jest/vitest/playwright workers daily — not an untested path.\n * The flag is purely advisory: `process.chdir` itself keeps working, and\n * an audit of the dependency tree shows the only readers are bundled\n * cross-spawn copies; nothing else writes or consults it.\n *\n * Behavior delta: a spawn combining a custom `cwd` with a command that is\n * neither absolute nor on PATH (e.g. `./scripts/build.sh`). POSIX still\n * works (cross-spawn falls back to the raw command; the OS resolves it in\n * the child's cwd). On Windows that shape can fail to resolve — the same\n * limitation those tools already have inside worker threads. Everything\n * alchemy and its toolchains spawn is absolute or on PATH, and `Command`\n * resources use effect's ChildProcess (plain spawn, no cross-spawn).\n */\nexport const disableCrossSpawnChdir = () => {\n process.chdir.disabled = true;\n};\n/**\n * Node arguments that install alchemy's Oxc loader in a child process, the\n * same way `bin/cli.js` installs it for the CLI itself. Every `.ts`/`.tsx`\n * a Node process loads — alchemy's own source in a checkout, the user's\n * stack everywhere — goes through it; nothing relies on Node's built-in\n * TypeScript support (strip-only, and Node 26 removed the transform flag).\n *\n * A `.ts` entry means a checkout: `bin/register-dev-mode.js` adds the\n * src-condition resolution for workspace packages on top of the loader.\n * A `.js` entry means a published install: `bin/register-oxc.js` is the\n * loader alone.\n */\nexport const nodeLoaderArgs = (entry) => [\n \"--import\",\n import.meta.resolve(/\\.[cm]?tsx?$/.test(entry)\n ? \"../../bin/register-dev-mode.js\"\n : \"../../bin/register-oxc.js\"),\n];\n/**\n * Whether this Node supports the synchronous in-thread loader hooks\n * (`module.registerHooks`, v22.15 / v23.5) that `bin/register-dev-mode.js`\n * needs. This is THE capability gate for running the CLI from source under\n * node: with the hooks installed, the Oxc loader handles every `.ts`/`.tsx`\n * file regardless of Node's own TypeScript support.\n *\n * `bin/cli.js` mirrors this predicate inline — it must run under plain node\n * before any `.ts` can load. Keep the two in sync.\n */\nexport const isRegisterHooksSupported = (version = process.versions.node) => {\n const [major = 0, minor = 0] = version.split(\".\").map(Number);\n return ((major === 22 && minor >= 15) || (major === 23 && minor >= 5) || major >= 24);\n};\n/**\n * Ask the OS for an unused TCP port, release it, and return its number.\n *\n * The port is only available, not reserved: another process can claim it\n * before the caller binds. Callers should keep the gap short and still handle\n * `EADDRINUSE`.\n */\nexport const findAvailablePort = (host = \"127.0.0.1\") => Effect.callback((resume) => {\n const server = NodeNet.createServer();\n server.unref();\n server.once(\"error\", (error) => resume(Effect.fail(error)));\n server.listen(0, host, () => {\n const address = server.address();\n const port = typeof address === \"object\" && address !== null\n ? address.port\n : undefined;\n server.close((error) => {\n if (error) {\n resume(Effect.fail(error));\n }\n else if (port !== undefined) {\n resume(Effect.succeed(port));\n }\n else {\n resume(Effect.fail(new Error(\"Failed to allocate an available port\")));\n }\n });\n });\n});\n//# sourceMappingURL=Node.js.map","import * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport { defaultTeardown } from \"effect/Runtime\";\nimport { disableCrossSpawnChdir } from \"./Node.js\";\nconst isBun = typeof Bun !== \"undefined\";\nconst importPlatformPeer = (peerDependency, load) => load().catch(() => {\n console.error([\n `Alchemy could not load the required peer dependency \"${peerDependency}\".`,\n `Install a compatible version of \"${peerDependency}\" in the same project as \"alchemy\".`,\n \"If it is already installed, you may be running a globally installed Alchemy CLI; run the project-local CLI instead.\",\n ].join(\"\\n\"));\n process.exit(1);\n});\n/**\n * Constructs a layer with different implementations for Bun and Node.\n */\nexport const platformLayer = (constructors) => Layer.unwrap(Effect.promise(async () => {\n if (isBun) {\n return await constructors.bun();\n }\n else {\n return await constructors.node();\n }\n}));\nexport const PlatformServices = platformLayer({\n bun: async () => {\n const [BunServices, BunSocket] = await Promise.all([\n importPlatformPeer(\"@effect/platform-bun\", () => import(\"@effect/platform-bun/BunServices\")),\n importPlatformPeer(\"@effect/platform-bun\", () => import(\"@effect/platform-bun/BunSocket\")),\n ]);\n return Layer.merge(BunServices.layer, BunSocket.layerWebSocketConstructor);\n },\n node: async () => {\n const [NodeServices, NodeSocket] = await Promise.all([\n importPlatformPeer(\"@effect/platform-node\", () => import(\"@effect/platform-node/NodeServices\")),\n importPlatformPeer(\"@effect/platform-node\", () => import(\"@effect/platform-node/NodeSocket\")),\n ]);\n return Layer.merge(NodeServices.layer, NodeSocket.layerWebSocketConstructor);\n },\n});\n/**\n * ALWAYS exit once the main effect completes. The platform `runMain` default\n * only force-exits on failure or signal interruption — a *successful*\n * `alchemy deploy`/`destroy` otherwise lingers for ~100 seconds after \"Done\"\n * while keep-alive sockets (Cloudflare API agents, provider sidecar handles)\n * pin the event loop until the remote side closes them. All Effect finalizers\n * have already run by the time teardown is invoked; the macrotask hop lets\n * any buffered stdout drain before the process exits.\n */\nconst exitingTeardown = (exit, onExit) => {\n defaultTeardown(exit, (code) => {\n const finalCode = code !== 0 ? code : Number(process.exitCode ?? 0) || 0;\n setTimeout(() => process.exit(finalCode), 0);\n onExit(finalCode);\n });\n};\nexport const runMain = (effect, options) => {\n // Every alchemy process (CLI, exec child, sidecar, build/dev runners)\n // runs concurrent effects that depend on a stable working directory —\n // forbid cross-spawn's transient process-wide chdir (see Util/Node.ts).\n disableCrossSpawnChdir();\n const opts = {\n ...options,\n teardown: options?.teardown ?? exitingTeardown,\n };\n if (isBun) {\n void importPlatformPeer(\"@effect/platform-bun\", () => import(\"@effect/platform-bun/BunRuntime\")).then((BunRuntime) => BunRuntime.runMain(effect, opts));\n }\n else {\n void importPlatformPeer(\"@effect/platform-node\", () => import(\"@effect/platform-node/NodeRuntime\")).then((NodeRuntime) => NodeRuntime.runMain(effect, opts));\n }\n};\nexport const httpServer = (port = 0, host = \"127.0.0.1\", options) => platformLayer({\n bun: async () => {\n const BunHttpServer = await importPlatformPeer(\"@effect/platform-bun\", () => import(\"@effect/platform-bun/BunHttpServer\"));\n // `idleTimeout: 0` disables Bun's default 10s request idle timeout.\n // The RPC spawner serves a long-lived `/logs` stream (sidecar output\n // forwarded to the exec child's renderer) that can legitimately sit\n // idle between lines; Bun would otherwise sever it mid-session.\n return BunHttpServer.layer({ hostname: host, port, idleTimeout: 0 });\n },\n node: async () => {\n const [NodeHttpServer, Http] = await Promise.all([\n importPlatformPeer(\"@effect/platform-node\", () => import(\"@effect/platform-node/NodeHttpServer\")),\n import(\"node:http\"),\n ]);\n return NodeHttpServer.layerServer(Http.createServer, {\n host,\n port,\n gracefulShutdownTimeout: options?.gracefulShutdownTimeout,\n });\n },\n});\n//# sourceMappingURL=PlatformServices.js.map","import { ConfigProvider } from \"effect/ConfigProvider\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport { FileSystem } from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Logger from \"effect/Logger\";\nimport * as Option from \"effect/Option\";\nimport { Path } from \"effect/Path\";\nimport * as Scope from \"effect/Scope\";\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\";\nimport { AlchemyContext, AlchemyContextLive } from \"./AlchemyContext.js\";\nimport { provideFreshArtifactStore } from \"./Artifacts.js\";\nimport { AuthProviders } from \"./Auth/AuthProvider.js\";\nimport { CredentialsStore, CredentialsStoreLive } from \"./Auth/Credentials.js\";\nimport { ProfileStore, ProfileStoreLive } from \"./Auth/Profile.js\";\nimport * as Output from \"./Output.js\";\nimport { Stage } from \"./Stage.js\";\nimport { StackContext } from \"./StackContext.js\";\nimport { loadConfigProvider } from \"./Util/ConfigProvider.js\";\nimport { effectClass, taggedFunction } from \"./Util/effect.js\";\nimport { fileLogger } from \"./Util/FileLogger.js\";\nimport { PlatformServices } from \"./Util/PlatformServices.js\";\nexport const Stack = Object.assign(taggedFunction(StackContext, (stackName, options, eff) => {\n if (!stackName) {\n return (stackName) => Object.assign(\n // by default, reference the stack at the \"current\" stage of the importer\n Output.stackRef(stackName).pipe(effectClass), {\n stackName,\n stage: createStageProxy(stackName),\n state: options?.state,\n providers: options?.providers,\n make: (options, eff) => \n // @ts-expect-error\n Stack(stackName, options, eff),\n });\n }\n return eff.pipe(\n // @ts-expect-error\n make({\n name: stackName,\n ...options,\n }), (eff) => Object.assign(eff, {\n stackName,\n stage: createStageProxy(stackName),\n state: options?.state,\n providers: options?.providers,\n }));\n}));\nconst createStageProxy = (stackName) => new Proxy({}, {\n get: (_, stage) => Output.stackRef(stackName, { stage }),\n});\nexport const StackName = Stack.use((stack) => Effect.succeed(stack.name));\nexport const make = (options) => (effect) => Effect.scope.pipe(Effect.flatMap((scope) => {\n if (options.state == null) {\n return Effect.die(new Error(`Stack \"${options.name}\" is missing a state store. ` +\n `Add a \\`state\\` layer to the stack options, e.g.:\\n` +\n ` Alchemy.Stack(\"${options.name}\", {\\n` +\n ` providers: Cloudflare.providers(),\\n` +\n ` state: Cloudflare.state(), // <-- required\\n` +\n ` }, ...)\\n` +\n `See https://alchemy.run/state-store for available state stores.`));\n }\n if (options.providers == null) {\n return Effect.die(new Error(`Stack \"${options.name}\" is missing a providers layer. ` +\n `Add a \\`providers\\` layer to the stack options, e.g.:\\n` +\n ` Alchemy.Stack(\"${options.name}\", {\\n` +\n ` providers: Cloudflare.providers(), // <-- required\\n` +\n ` state: Cloudflare.state(),\\n` +\n ` }, ...)`));\n }\n return options.providers.pipe(Layer.provideMerge(options.state), Layer.provideMerge(Layer.effect(Stack, Stage.pipe(Effect.map((stage) => options.stack ?? {\n name: options.name,\n stage,\n resources: {},\n bindings: {},\n actions: {},\n })))), Layer.buildWithScope(scope));\n}), Effect.flatMap((context) => Effect.all([\n effect,\n Stack,\n Effect.context(),\n]).pipe(Effect.map(([output, stack, services]) => ({\n ...stack,\n output,\n services: Context.merge(services, context),\n})), Effect.provideContext(context))));\nexport const CurrentStack = Effect.serviceOption(Stack)\n .pipe(Effect.map(Option.getOrUndefined));\nconst platform = Layer.mergeAll(PlatformServices, FetchHttpClient.layer, Logger.layer([fileLogger(\"out\")], { mergeWithExisting: true }), Layer.provide(ProfileStoreLive, PlatformServices), Layer.provide(CredentialsStoreLive, PlatformServices));\n// override alchemy state store, CLI/reporting, state, and Config\nconst alchemy = (overrides) => Layer.mergeAll(\n// optional\noverrides?.dev\n ? Layer.provide(Layer.effect(AlchemyContext, AlchemyContext.useSync((ctx) => ({ ...ctx, dev: overrides.dev }))), AlchemyContextLive)\n : AlchemyContextLive);\nexport const evalStack = (effect, fn, options) => {\n const body = Effect.gen(function* () {\n const stack = yield* effect;\n const configProvider = yield* loadConfigProvider(Option.none());\n return yield* fn(stack).pipe(provideFreshArtifactStore, Effect.provide(Layer.succeedContext(stack.services).pipe(Layer.provideMerge(Layer.succeed(ConfigProvider, configProvider)))));\n }).pipe(Effect.provide(Layer.effect(AuthProviders, Effect.serviceOption(AuthProviders).pipe(Effect.map(Option.getOrElse(() => ({}))))).pipe(Layer.provideMerge(Layer.succeed(Stage, options.stage)), Layer.provideMerge(Layer.provideMerge(alchemy({ dev: options.dev }), platform)))));\n return options.scope === undefined\n ? Effect.scoped(body)\n : Scope.provide(body, options.scope);\n};\n//# sourceMappingURL=Stack.js.map","import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\n/**\n * The one ambient progress channel. Everything long-running — the planner's\n * phase/node events, state-store bootstrap, nuke scans and deletions,\n * provider configure/refresh — reports through it. Defaults to a no-op, so\n * a caller that only wants the result provides nothing; a renderer provides\n * its own handler for the events it wants to observe.\n */\nexport const Progress = Context.Reference(\"alchemy/Progress\", { defaultValue: () => () => Effect.void });\n/** A session that drops everything — the default when no renderer is ambient. */\nexport const noopSession = {\n emit: () => Effect.void,\n done: () => Effect.void,\n};\nexport class Cli extends Context.Service()(\"CLI\") {\n}\n//# sourceMappingURL=Report.js.map","import * as Clock from \"effect/Clock\";\nimport * as Effect from \"effect/Effect\";\nimport {} from \"../Report.js\";\n// The event contract itself lives in Report.ts (one flat `_tag` union, the\n// `Progress` reference the engine emits into). This module adds the\n// Alchemist-side plumbing: the OTEL span-event bridge routes wrap their\n// reporter with, and the adapter to the engine's apply-session contract.\nexport { Progress, } from \"../Report.js\";\n/**\n * The OTEL span-event shape of one {@link ProgressEvent}, or `undefined`\n * for events that are renderer-only. Per-node plan events are deliberately\n * excluded: a plan emits one per resource *including noops* on every\n * (re)plan — dev-watch replans would flood the collector with rows that\n * mostly say \"noop\", and the node's own `plan.diff.resource` span already\n * carries the diff. The phase markers are enough to know planning started\n * and where the time went.\n */\nconst spanEventOf = (event) => {\n switch (event._tag) {\n case \"plan.phase\":\n return {\n name: \"alchemy.plan.phase\",\n attributes: { \"alchemy.plan.phase\": event.phase },\n };\n case \"plan.resource.started\":\n case \"plan.resource.completed\":\n case \"plan.action.completed\":\n return undefined;\n case \"apply.resource.status\":\n return {\n name: \"alchemy.apply.resource.status\",\n attributes: {\n \"alchemy.resource.fqn\": event.fqn,\n \"alchemy.resource.logical_id\": event.id,\n \"alchemy.resource.type\": event.type,\n \"alchemy.apply.resource.status\": event.status,\n ...(event.message === undefined\n ? {}\n : { \"alchemy.apply.message\": event.message }),\n },\n };\n case \"apply.resource.note\":\n return {\n name: \"alchemy.apply.resource.note\",\n attributes: {\n \"alchemy.resource.fqn\": event.fqn,\n \"alchemy.resource.logical_id\": event.id,\n \"alchemy.apply.message\": event.message,\n ...(event.kind === undefined\n ? {}\n : { \"alchemy.apply.note.kind\": event.kind }),\n },\n };\n case \"state.bootstrap.started\":\n case \"state.bootstrap.completed\":\n return {\n name: `alchemy.${event._tag}`,\n attributes: { \"alchemy.state_store.name\": event.store },\n };\n case \"nuke.scan.started\":\n return {\n name: \"alchemy.nuke.scan.started\",\n attributes: { \"alchemy.nuke.providers\": event.total },\n };\n case \"nuke.pass.started\":\n return {\n name: \"alchemy.nuke.pass.started\",\n attributes: { \"alchemy.nuke.pass\": event.pass },\n };\n case \"nuke.scan.provider.started\":\n return {\n name: \"alchemy.nuke.scan.provider.started\",\n attributes: { \"alchemy.provider\": event.provider },\n };\n case \"nuke.scan.provider.completed\":\n return {\n name: \"alchemy.nuke.scan.provider.completed\",\n attributes: {\n \"alchemy.provider\": event.provider,\n \"alchemy.nuke.resources\": event.resources,\n ...(event.error === undefined\n ? {}\n : { \"alchemy.nuke.message\": event.error }),\n },\n };\n case \"nuke.resource.deleted\":\n return {\n name: \"alchemy.nuke.resource.deleted\",\n attributes: { \"alchemy.resource.display_name\": event.resource },\n };\n case \"nuke.resource.failed\":\n return {\n name: \"alchemy.nuke.resource.failed\",\n attributes: {\n \"alchemy.resource.display_name\": event.resource,\n \"alchemy.nuke.message\": event.message,\n },\n };\n case \"provider.configure.started\":\n case \"provider.configure.completed\":\n case \"provider.refresh.started\":\n case \"provider.refresh.completed\":\n return {\n name: `alchemy.${event._tag}`,\n attributes: { \"alchemy.provider\": event.provider },\n };\n }\n};\n/**\n * Decorate a reporter so a {@link ProgressEvent} with a span-event shape is\n * also recorded on the currently active span before it reaches the\n * renderer. Emission happens inside the engine's instrumented fibers, so\n * apply events land on `apply.resource` / `provider.<op>` spans — giving\n * traces a within-span timeline of status transitions. A no-op when no\n * span is active (tracing disabled), and independent of whether a renderer\n * is attached, so `--yes` and CI runs still produce the events.\n */\nexport const withSpanEvents = (report) => (event) => {\n const spanEvent = spanEventOf(event);\n if (spanEvent === undefined)\n return report(event);\n return Effect.currentSpan.pipe(Effect.flatMap((span) => Effect.flatMap(Clock.currentTimeNanos, (now) => Effect.sync(() => span.event(spanEvent.name, now, spanEvent.attributes)))), Effect.ignore, Effect.andThen(report(event)));\n};\n/** Adapt the ambient reporter to the engine's apply-session contract. */\nexport const applySession = (report) => ({\n emit: (event) => report(event),\n done: () => Effect.void,\n});\n//# sourceMappingURL=Progress.js.map","var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n};\nimport * as Cause from \"effect/Cause\";\nimport * as ConfigProvider from \"effect/ConfigProvider\";\nimport * as Context from \"effect/Context\";\nimport * as Data from \"effect/Data\";\nimport * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Logger from \"effect/Logger\";\nimport * as Option from \"effect/Option\";\nimport * as Path from \"effect/Path\";\nimport * as Predicate from \"effect/Predicate\";\nimport * as Schema from \"effect/Schema\";\nimport * as Semaphore from \"effect/Semaphore\";\nimport { pathToFileURL } from \"node:url\";\nimport { AdoptPolicy } from \"../AdoptPolicy.js\";\nimport { AlchemyContext } from \"../AlchemyContext.js\";\nimport { ArtifactStore, createArtifactStore } from \"../Artifacts.js\";\nimport { AuthError, AuthProviders } from \"../Auth/AuthProvider.js\";\nimport { SuppressMissingProviderConfig } from \"../Auth/Profile.js\";\nimport { withProfileOverride } from \"../Auth/Resolve.js\";\nimport { AwsAuth } from \"../AWS/AuthProvider.js\";\nimport { AxiomAuth } from \"../Axiom/AuthProvider.js\";\nimport { CloudflareAuth } from \"../Cloudflare/Auth/AuthProvider.js\";\nimport { FlyAuth } from \"../Fly/AuthProvider.js\";\nimport { GitHubAuth } from \"../GitHub/AuthProvider.js\";\nimport { HetznerAuth } from \"../Hetzner/AuthProvider.js\";\nimport { NeonAuth } from \"../Neon/AuthProvider.js\";\nimport { PlanetscaleAuth } from \"../Planetscale/AuthProvider.js\";\nimport { PrismaAuth } from \"../Prisma/AuthProvider.js\";\nimport { RailwayAuth } from \"../Railway/AuthProvider.js\";\nimport { StripeAuth } from \"../Stripe/AuthProvider.js\";\nimport * as Stack from \"../Stack.js\";\nimport { Stage } from \"../Stage.js\";\nimport { Progress } from \"./Progress.js\";\nimport { loadConfigProvider } from \"../Util/ConfigProvider.js\";\nimport { fileLogger } from \"../Util/FileLogger.js\";\nimport { DEFAULT_ENTRYPOINT, resolveStackEntrypoint, StackEntrypointError, } from \"./Entrypoint.js\";\nexport { DEFAULT_ENTRYPOINT, resolveStackEntrypoint, StackEntrypointError };\n/** Stage used by routes that inspect a project without addressing a deployment. */\nexport const PLACEHOLDER_STAGE = \"placeholder\";\nexport const StackModuleLoader = Context.Reference(\"Alchemy/Alchemist/StackModuleLoader\", {\n defaultValue: () => ({ import: (url) => import(__rewriteRelativeImportExtension(url)) }),\n});\nexport const importStack = Effect.fn(function* (main) {\n const absolutePath = yield* resolveStackEntrypoint(main);\n const loader = yield* StackModuleLoader;\n const module = yield* Effect.promise(() => loader.import(pathToFileURL(absolutePath).href));\n if (!Effect.isEffect(module.default) ||\n !Predicate.hasProperty(module.default, \"stackName\") ||\n typeof module.default.stackName !== \"string\") {\n return yield* Effect.fail(new StackEntrypointError({\n message: `Stack entrypoint '${main}' must export a default stack definition (export default Alchemy.Stack({...})).`,\n }));\n }\n return module.default;\n});\n/** Shared config and logging services used by every stack/auth build path. */\nconst sessionServices = Effect.fn(\"sessionServices\")(function* (options) {\n return Layer.mergeAll(ConfigProvider.layer(withProfileOverride(yield* loadConfigProvider(options.envFile), options.profile)), options.logger ??\n Logger.layer([fileLogger(\"out\")], { mergeWithExisting: true }), options.extra ?? Layer.empty);\n});\nconst RouteCache = Context.Reference(\"Alchemy/Alchemist/RouteCache\", {\n defaultValue: () => ({\n open: (target, options) => openUncached(target, options),\n authProviders: collectAuthProvidersUncached,\n }),\n});\nconst stackSessionKey = (target, options) => JSON.stringify([\n target.entrypoint ?? DEFAULT_ENTRYPOINT,\n target.stage ?? PLACEHOLDER_STAGE,\n target.profile ?? null,\n target.envFile ?? null,\n options.dev ?? false,\n options.adopt ?? false,\n options.updateStateStore ?? false,\n]);\nconst authRegistryKey = (options) => JSON.stringify([\n options.main,\n Option.getOrNull(options.envFile),\n options.profile,\n]);\nconst cached = (lock, entries, key, load) => Semaphore.withPermits(lock, 1)(Effect.suspend(() => {\n const existing = entries.get(key);\n if (existing !== undefined)\n return Effect.succeed(existing);\n return Effect.cached(load).pipe(Effect.tap((effect) => Effect.sync(() => {\n entries.set(key, effect);\n })));\n})).pipe(Effect.flatten);\n/** Memoize stack sessions and auth registries for one command or API scope. */\nexport const routeCacheLayer = Layer.effect(RouteCache, Effect.sync(() => {\n const lock = Semaphore.makeUnsafe(1);\n const sessions = new Map();\n const registries = new Map();\n return {\n open: (target, options) => cached(lock, sessions, stackSessionKey(target, options), openUncached(target, options)),\n authProviders: (options) => cached(lock, registries, authRegistryKey(options), collectAuthProvidersUncached(options)),\n };\n}));\n/**\n * Import the user's stack module and build the services its resources run\n * under. This is the one place that decides what a stack run sees — plan,\n * apply, drift, logs, and state inspection all come through here.\n *\n * The session lives in the surrounding `Scope`; run stack-scoped effects by\n * providing `session.context` (`Effect.provide(effect, session.context)`).\n */\nconst openUncached = Effect.fn(\"openStackSessionUncached\")(function* (target, options = {}) {\n // Phases are emitted here, at the actual work boundaries, rather than by\n // callers around `open` — the import and the service build both happen\n // inside this function, so only it can time them honestly.\n const report = yield* Progress;\n yield* report({ _tag: \"plan.phase\", phase: \"importing-module\" });\n const stackEffect = yield* importStack(target.entrypoint ?? DEFAULT_ENTRYPOINT);\n yield* report({ _tag: \"plan.phase\", phase: \"resolving-services\" });\n const shared = yield* sessionServices({\n envFile: Option.fromNullishOr(target.envFile),\n profile: target.profile,\n });\n const services = Layer.mergeAll(Layer.effect(AlchemyContext, Effect.map(AlchemyContext, (context) => ({\n ...context,\n dev: options.dev ?? context.dev,\n adopt: options.adopt ?? false,\n updateStateStore: options.updateStateStore ?? false,\n }))), Layer.succeedContext(Context.make(AdoptPolicy, options.adopt ?? false).pipe(Context.add(ArtifactStore, createArtifactStore()), Context.add(AuthProviders, yield* Effect.serviceOption(AuthProviders).pipe(Effect.map(Option.getOrElse(() => ({}))))), Context.add(Stage, target.stage ?? PLACEHOLDER_STAGE))), shared);\n const sessionContext = yield* Layer.build(services);\n const stack = yield* Effect.provide(stackEffect, sessionContext);\n return {\n stack,\n /**\n * Everything a stack-scoped effect runs under: the stack's own providers\n * and state store over this session's services.\n */\n context: Context.merge(sessionContext, stack.services),\n };\n});\nexport const open = Effect.fn(\"openStackSession\")(function* (target, options = {}) {\n return yield* (yield* RouteCache).open(target, options);\n});\nconst placeholderStack = (name) => ({\n actions: {},\n bindings: {},\n name,\n resources: {},\n stage: PLACEHOLDER_STAGE,\n});\nexport const buildStackProviders = Effect.fn(\"buildStackProviders\")(function* (options) {\n const authProviders = options.registry ?? {};\n const stackEffect = yield* importStack(options.main);\n const shared = yield* sessionServices(options);\n const valueServices = Layer.succeedContext(Context.make(AuthProviders, authProviders).pipe(Context.add(Stage, PLACEHOLDER_STAGE), Context.add(Stack.Stack, placeholderStack(stackEffect.stackName))));\n const context = yield* Layer.build((stackEffect.providers ?? Layer.empty).pipe(Layer.provideMerge(stackEffect.state ?? Layer.empty), Layer.provideMerge(Layer.mergeAll(valueServices, shared))));\n return { authProviders, context, stackEffect };\n});\nconst builtinAuth = Layer.mergeAll(AwsAuth, AxiomAuth, CloudflareAuth, FlyAuth, GitHubAuth, HetznerAuth, NeonAuth, PlanetscaleAuth, PrismaAuth, RailwayAuth, StripeAuth);\nconst buildBuiltinAuthProviders = Effect.fn(\"buildBuiltinAuthProviders\")(function* (options) {\n const authProviders = options.registry ?? {};\n const shared = yield* sessionServices(options);\n yield* Layer.build(Layer.provide(builtinAuth, Layer.mergeAll(Layer.succeed(AuthProviders, authProviders), shared)));\n return authProviders;\n});\nconst isMissingProviderConfig = Schema.is(Schema.Struct({ _tag: Schema.Literals([\"MissingProviderConfig\"]) }));\n/**\n * Every auth provider reachable from the current project: the built-ins, plus\n * whatever the user's stack module registers when it is importable.\n */\nconst collectAuthProvidersUncached = Effect.fn(\"collectAuthProvidersUncached\")(function* (options) {\n const authProviders = {};\n yield* buildBuiltinAuthProviders({\n envFile: options.envFile,\n profile: options.profile,\n registry: authProviders,\n });\n const fs = yield* FileSystem.FileSystem;\n const entrypointExists = yield* fs.exists(options.main);\n const missingDefault = options.main === DEFAULT_ENTRYPOINT && !entrypointExists;\n if (!entrypointExists && !missingDefault) {\n return yield* Effect.fail(new AuthError({\n message: `Stack entrypoint '${options.main}' does not exist.`,\n }));\n }\n if (!missingDefault) {\n yield* buildStackProviders({ ...options, registry: authProviders }).pipe(Effect.timeout(Duration.seconds(15)), Effect.catchTag(\"TimeoutError\", () => Effect.void), Effect.catchCause((cause) => {\n const suppressed = cause.reasons.some((reason) => {\n const error = Cause.isFailReason(reason)\n ? reason.error\n : Cause.isDieReason(reason)\n ? reason.defect\n : undefined;\n return isMissingProviderConfig(error);\n });\n return suppressed\n ? Effect.void\n : Effect.fail(new AuthError({\n message: `Could not load auth providers from '${options.main}'.`,\n cause,\n }));\n }));\n }\n return authProviders;\n}, Effect.provideService(SuppressMissingProviderConfig, true));\nexport const collectAuthProviders = Effect.fn(\"collectAuthProviders\")(function* (options) {\n return yield* (yield* RouteCache).authProviders(options);\n});\n//# sourceMappingURL=Session.js.map","/**\n * Per-resource dev log files.\n *\n * Layout under `{dotAlchemy}/log`:\n *\n * log/{stage}/{fqn…}/{timestamp}.log — one file per instance start\n * (a restart opens a new file;\n * the FQN nests as directories,\n * e.g. log/dev/Site/Worker/)\n * log/{stage}/{timestamp}.log — the dev child's mixed tail\n *\n * Retention: opening a new log prunes its sibling `*.log` files first — the\n * newest `LOG_RETENTION_GENERATIONS` survive, and anything older than\n * `LOG_RETENTION_MS` (7 days, judged by stat mtime — file names are never\n * trusted) is deleted regardless. Pruning is best-effort: any failure is\n * swallowed so it can never break dev startup.\n */\nimport * as Clock from \"effect/Clock\";\nimport * as Effect from \"effect/Effect\";\nimport * as Duration from \"effect/Duration\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Option from \"effect/Option\";\nimport * as Path from \"effect/Path\";\nimport * as Queue from \"effect/Queue\";\nimport * as Stream from \"effect/Stream\";\nimport { AlchemyContext } from \"../AlchemyContext.js\";\nimport { stripVTControlCharacters } from \"node:util\";\nconst LOG_RETENTION = Duration.days(7);\nconst LOG_RETENTION_GENERATIONS = 10;\n/**\n * Delete a resource's stale sibling logs before a new one is opened: keep\n * the newest `LOG_RETENTION_GENERATIONS - 1` (the file about to be created\n * fills the last slot) and drop anything older than `LOG_RETENTION_MS`.\n * Ages come from stat mtime — file names are never trusted. Best-effort:\n * every step (including a missing directory) is swallowed.\n */\nconst pruneDevLogs = (fs, path, dir) => Effect.gen(function* () {\n const entries = yield* fs\n .readDirectory(dir)\n .pipe(Effect.orElseSucceed(() => []));\n const logs = [];\n for (const entry of entries) {\n if (!entry.endsWith(\".log\"))\n continue;\n const file = path.join(dir, entry);\n const info = yield* fs\n .stat(file)\n .pipe(Effect.orElseSucceed(() => undefined));\n const mtime = info === undefined ? undefined : Option.getOrUndefined(info.mtime);\n if (mtime !== undefined)\n logs.push({ file, mtime: mtime.getTime() });\n }\n const cutoff = (yield* Clock.currentTimeMillis) - Duration.toMillis(LOG_RETENTION);\n logs.sort((a, b) => b.mtime - a.mtime);\n for (const [index, log] of logs.entries()) {\n if (index >= LOG_RETENTION_GENERATIONS - 1 || log.mtime < cutoff) {\n yield* fs.remove(log.file).pipe(Effect.ignore);\n }\n }\n}).pipe(Effect.ignore);\n/**\n * Resolves the directory a resource's dev logs land in, for surfacing in\n * startup messages (\"Started … → url (logs: …)\") without opening a file.\n * Must join the same segments the opener is later called with.\n */\nexport const makeDevLogDirectory = Effect.gen(function* () {\n const path = yield* Path.Path;\n const { dotAlchemy } = yield* AlchemyContext;\n return (...segments) => path.join(dotAlchemy, \"log\", ...segments);\n});\n/**\n * Resolves the file-system services once (at provider/process init) and\n * returns an opener whose only requirement is the ambient `Scope` — local\n * provider `start` signatures are Scope-only, so the opener composes into\n * them without widening their requirements.\n *\n * The opener creates `{dotAlchemy}/log/{...segments}/{timestamp}.log`\n * (pruning stale siblings per the module retention policy first) and\n * returns the file's `path` plus synchronous `write`/`writeLine` sinks —\n * chunks queue through a drain fiber, so they're safe to call from\n * non-Effect callbacks (workerd output pumps, stream mirrors). The file and\n * drain close with the scope, which ties one log file to one\n * process/serve generation.\n */\nexport const makeDevLogOpener = Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const devLogDirectory = yield* makeDevLogDirectory;\n const encoder = new TextEncoder();\n return Effect.fn(function* (...segments) {\n const dir = devLogDirectory(...segments);\n yield* fs.makeDirectory(dir, { recursive: true });\n yield* pruneDevLogs(fs, path, dir);\n const name = yield* Effect.sync(() => `${new Date().toISOString().replaceAll(\":\", \"-\")}.log`);\n const filePath = path.join(dir, name);\n const file = yield* fs.open(filePath, { flag: \"a\" });\n const queue = yield* Queue.make();\n yield* Stream.fromQueue(queue).pipe(Stream.runForEach((chunk) => file.write(chunk).pipe(Effect.ignore)), Effect.forkScoped);\n // ANSI is stripped: colors belong to the terminal path (FORCE_COLOR\n // rides the sidecar pipes); the files stay plain-text grep-able.\n return {\n /** Absolute path of this generation's log file. */\n path: filePath,\n write: (chunk) => {\n Queue.offerUnsafe(queue, encoder.encode(stripVTControlCharacters(chunk)));\n },\n /** `write` + a trailing newline — for line-based sources. */\n writeLine: (line) => {\n Queue.offerUnsafe(queue, encoder.encode(`${stripVTControlCharacters(line)}\\n`));\n },\n };\n });\n});\n//# sourceMappingURL=DevLog.js.map","import * as Duration from \"effect/Duration\";\nimport * as Redacted from \"effect/Redacted\";\nimport { isResource } from \"../Resource.js\";\n/**\n * JSON marker used to tag a `Redacted<T>` value when writing state.\n * The reviver recognises objects with exactly this key and rebuilds\n * the `Redacted` wrapper on read.\n */\nexport const REDACTED_MARKER = \"__redacted__\";\n/**\n * JSON marker used to tag a `Duration` value when writing state.\n * The reviver recognises objects with exactly this key and rebuilds\n * a real `Duration` instance on read so that downstream code can call\n * `Duration.toSeconds`, `Duration.toMillis`, etc. without first\n * decoding `Duration.toJSON`'s `{_id,_tag,...}` shape.\n */\nexport const DURATION_MARKER = \"__duration__\";\n/**\n * JSON marker used to tag a `Date` value when writing state. The reviver\n * recognises objects with exactly this key and rebuilds a real `Date`\n * instance on read, so a Date-typed prop read back out of persisted state\n * (`olds` in provider `diff`/`delete`/`read`) is a `Date` again — not the\n * bare ISO string `JSON.stringify` would otherwise leave behind.\n */\nexport const DATE_MARKER = \"__date__\";\nconst decodeDate = (encoded) => {\n if (typeof encoded !== \"string\")\n return undefined;\n const date = new Date(encoded);\n return Number.isNaN(date.getTime()) ? undefined : date;\n};\n/**\n * Rebuild a {@link Duration.Duration} from `Duration.toJSON`'s\n * `{_id,_tag,millis?,nanos?}` shape. Shared by state persistence and the\n * RPC sidecar — that JSON is not a valid `Duration.Input`.\n */\nexport const decodeDuration = (encoded) => {\n if (encoded === null || typeof encoded !== \"object\")\n return undefined;\n const json = encoded;\n switch (json._tag) {\n case \"Millis\":\n return json.millis !== undefined\n ? Duration.millis(json.millis)\n : undefined;\n case \"Nanos\":\n return json.nanos !== undefined\n ? Duration.nanos(BigInt(json.nanos))\n : undefined;\n case \"Infinity\":\n return Duration.infinity;\n case \"NegativeInfinity\":\n return Duration.negativeInfinity;\n default:\n return undefined;\n }\n};\n/**\n * Recursively encode a state value for JSON serialisation.\n *\n * - `Redacted<T>` values are wrapped as `{ [REDACTED_MARKER]: <inner> }`\n * so the actual string is persisted rather than the `<redacted>`\n * placeholder produced by the default `toJSON`.\n * - `Resource` instances are flattened to `{ id, type, props, attr }`\n * so persisted state matches the schema used by the loader.\n * - Plain objects and arrays are walked structurally.\n */\nexport const encodeState = (value) => {\n if (value === null ||\n value === undefined ||\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\")\n return value;\n if (Redacted.isRedacted(value)) {\n return {\n [REDACTED_MARKER]: encodeState(Redacted.value(value)),\n };\n }\n if (Duration.isDuration(value)) {\n // `JSON.stringify(Duration.seconds(N))` already invokes Duration.toJSON,\n // but encodeState is also called for code paths that don't go through\n // `JSON.stringify` (e.g. the HTTP state-store). Tag with our marker so\n // the reviver can unambiguously rebuild a real Duration instance —\n // Duration.toJSON's `{_id,_tag,...}` shape is NOT a valid Duration.Input.\n return {\n [DURATION_MARKER]: value.toJSON(),\n };\n }\n // Dates are serializable leaves and must round-trip: walking one\n // structurally would persist `{}` (`Object.entries(new Date())` is empty)\n // — and every later plan would then diff the empty object against the\n // program's Date and churn a phantom update forever. Tag with our marker\n // so the reviver rebuilds a real Date instance; rows written before the\n // marker carry a bare ISO string, which `canonicalize` in Diff.ts still\n // compares as equal to a live Date, so legacy rows never churn either.\n if (value instanceof Date) {\n return { [DATE_MARKER]: value.toJSON() };\n }\n if (isResource(value)) {\n return {\n id: value.LogicalId,\n type: value.Type,\n props: encodeState(value.Props),\n attr: encodeState(value.Attributes),\n };\n }\n if (Array.isArray(value))\n return value.map(encodeState);\n if (typeof value === \"object\") {\n const result = {};\n for (const [k, v] of Object.entries(value)) {\n result[k] = encodeState(v);\n }\n return result;\n }\n return value;\n};\n/**\n * JSON reviver that rebuilds `Redacted<T>` values that were written\n * through {@link encodeState}. Intended for use with `JSON.parse`.\n */\nexport const reviveState = (_key, value) => {\n if (value !== null && typeof value === \"object\" && !Array.isArray(value)) {\n const obj = value;\n if (REDACTED_MARKER in obj) {\n return Redacted.make(obj[REDACTED_MARKER]);\n }\n if (DURATION_MARKER in obj) {\n const decoded = decodeDuration(obj[DURATION_MARKER]);\n if (decoded !== undefined)\n return decoded;\n }\n // Exact single-key match only — unlike the legacy REDACTED/DURATION\n // markers there is no pre-marker data to tolerate, so a user object\n // that merely CONTAINS the key alongside other fields is never\n // collapsed into a Date (mirrors reviveStateRecursive's strictness).\n if (DATE_MARKER in obj && Object.keys(obj).length === 1) {\n const decoded = decodeDate(obj[DATE_MARKER]);\n if (decoded !== undefined)\n return decoded;\n }\n }\n return value;\n};\n/**\n * Recursively walk an already-decoded value and rebuild `Redacted<T>`\n * instances from `{ [REDACTED_MARKER]: <inner> }` envelopes. Mirror\n * image of {@link encodeState} for callers that hold a parsed JS\n * value rather than a JSON string (e.g. the HTTP state-store client,\n * which receives values pre-parsed by `HttpApiClient`).\n */\nexport const reviveStateRecursive = (value) => {\n if (value === null || typeof value !== \"object\")\n return value;\n if (Array.isArray(value))\n return value.map(reviveStateRecursive);\n const obj = value;\n const keys = Object.keys(obj);\n if (keys.length === 1 && keys[0] === REDACTED_MARKER) {\n return Redacted.make(reviveStateRecursive(obj[REDACTED_MARKER]));\n }\n if (keys.length === 1 && keys[0] === DURATION_MARKER) {\n const decoded = decodeDuration(obj[DURATION_MARKER]);\n if (decoded !== undefined)\n return decoded;\n }\n if (keys.length === 1 && keys[0] === DATE_MARKER) {\n const decoded = decodeDate(obj[DATE_MARKER]);\n if (decoded !== undefined)\n return decoded;\n }\n const result = {};\n for (const [k, v] of Object.entries(obj)) {\n result[k] = reviveStateRecursive(v);\n }\n return result;\n};\n//# sourceMappingURL=StateEncoding.js.map","import * as Cause from \"effect/Cause\";\nimport * as Context from \"effect/Context\";\nimport * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport { flow } from \"effect/Function\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as Schema from \"effect/Schema\";\nimport * as Stream from \"effect/Stream\";\nimport * as NodeUtil from \"node:util\";\nimport * as Output from \"../Output.js\";\nimport { isRedactedMarker } from \"../RuntimeContext.js\";\nimport { decodeDuration, DURATION_MARKER, encodeState, } from \"../State/StateEncoding.js\";\nexport const wrapRpcHandlers = (handlers, streamKeys) => {\n return Object.fromEntries(Object.entries(handlers).map(([key, value]) => [\n key,\n typeof value === \"function\"\n ? streamKeys?.includes(key)\n ? wrapRpcStreamHandler(value)\n : wrapRpcEffectHandler(value)\n : typeof value === \"object\" && value !== null && !Array.isArray(value)\n ? wrapRpcHandlers(value)\n : value,\n ]));\n};\nexport const unwrapRpcHandlers = (handlers, streamKeys) => {\n return Object.fromEntries(Object.entries(handlers).map(([key, value]) => [\n key,\n typeof value === \"function\"\n ? streamKeys?.includes(key)\n ? unwrapRpcStreamHandler(value)\n : unwrapRpcEffectHandler(value)\n : typeof value === \"object\" && value !== null && !Array.isArray(value)\n ? unwrapRpcHandlers(value)\n : value,\n ]));\n};\nconst serializeError = Schema.encodeSync(Schema.Defect());\nconst wrapRpcEffectHandler = (handler) => flow((args) => deserializeRpcArgs(args), (args) => handler(...args), Effect.exit, Effect.map((exit) => {\n if (exit._tag === \"Success\") {\n // Success values need the same marker treatment as args: provider\n // attributes can legitimately carry `Redacted` secrets (e.g. a local\n // container's bound env), and a raw Redacted reaching capnweb dies\n // with `TypeError: Cannot serialize value: <redacted>`.\n return {\n _tag: \"Success\",\n value: serializeRpcArgs(exit.value),\n };\n }\n return {\n _tag: \"Failure\",\n cause: exit.cause.reasons.map((reason) => {\n switch (reason._tag) {\n case \"Fail\":\n return {\n _tag: \"Fail\",\n error: serializeError(reason.error),\n };\n case \"Die\":\n return { _tag: \"Die\", defect: serializeError(reason.defect) };\n case \"Interrupt\":\n return { _tag: \"Interrupt\", fiberId: reason.fiberId };\n }\n }),\n };\n}), Effect.runPromise);\nconst wrapRpcStreamHandler = (handler) => flow((args) => deserializeRpcArgs(args), (args) => handler(...args), (stream) => Stream.toReadableStream(stream));\nconst unwrapRpcEffectHandler = (handler) => flow((...args) => serializeRpcArgs(args), (args) => Effect.promise(() => handler(args)), Effect.flatMap((exit) => {\n if (exit._tag === \"Success\") {\n // Mirror of the wrap side: rebuild `Redacted` wrappers from their\n // wire markers so callers get the same shape an in-process provider\n // returns.\n return Exit.succeed(deserializeRpcArgs(exit.value));\n }\n return Exit.failCause(Cause.fromReasons(exit.cause.map((reason) => {\n switch (reason._tag) {\n case \"Fail\":\n return Cause.makeFailReason(reason.error);\n case \"Die\":\n return Cause.makeDieReason(reason.defect);\n case \"Interrupt\":\n return Cause.makeInterruptReason(reason.fiberId);\n }\n })));\n}));\nconst unwrapRpcStreamHandler = (handler) => flow((...args) => serializeRpcArgs(args), (args) => handler(args), (stream) => Stream.fromReadableStream({\n evaluate: () => stream,\n onError: (error) => error,\n}));\nconst serializeRpcArgs = (value) => {\n if (Redacted.isRedacted(value)) {\n return {\n _tag: \"Redacted\",\n value: Redacted.value(value),\n };\n }\n // Output must be tested BEFORE Effect.isEffect — Output exprs are yieldable\n // and would otherwise be misclassified as plain Effects.\n if (Output.isOutput(value)) {\n return {\n _tag: \"Output\",\n description: NodeUtil.inspect(value),\n };\n }\n // Runtime-only effect values riding in props (e.g. a Worker's `exports`\n // carries each DO's `constructor` Effect and captured `services` Context —\n // passed through prop resolution by identity since #1094). They cannot\n // cross the wire (function-valued internals kill capnweb) and the sidecar\n // never runs them (`stripEffects` drops them from `news` provider-side), so\n // ship a marker that deserializes back into an equivalent leaf: an Effect\n // that dies loudly if it IS ever run, keeping `isResolved`/`stripEffects`\n // semantics identical on both sides of the boundary.\n if (Effect.isEffect(value)) {\n return {\n _tag: \"~alchemy/Rpc/Effect\",\n description: NodeUtil.inspect(value),\n };\n }\n if (Context.isContext(value)) {\n return {\n _tag: \"~alchemy/Rpc/Context\",\n description: NodeUtil.inspect(value),\n };\n }\n // Duration has `toJSON` (so the structural walk below skips it) but\n // capnweb cannot serialize the live Effect Duration object — it dies\n // with `TypeError: Cannot serialize value: 15000 millis`. Use the same\n // `{ __duration__: toJSON() }` envelope as persisted state.\n if (Duration.isDuration(value)) {\n return encodeState(value);\n }\n if (typeof value === \"function\") {\n return null;\n }\n if (Array.isArray(value)) {\n return value.map(serializeRpcArgs);\n }\n if (value && typeof value === \"object\" && !(\"toJSON\" in value)) {\n return Object.fromEntries(Object.entries(value).map(([key, child]) => [\n key,\n serializeRpcArgs(child),\n ]));\n }\n return value;\n};\nconst isEffectMarker = (value) => \"_tag\" in value &&\n value._tag === \"~alchemy/Rpc/Effect\" &&\n \"description\" in value &&\n typeof value.description === \"string\";\nconst isContextMarker = (value) => \"_tag\" in value &&\n value._tag === \"~alchemy/Rpc/Context\" &&\n \"description\" in value &&\n typeof value.description === \"string\";\nconst isDurationEnvelope = (value) => DURATION_MARKER in value && Object.keys(value).length === 1;\nconst deserializeRpcArgs = (value) => {\n if (Array.isArray(value)) {\n return value.map(deserializeRpcArgs);\n }\n else if (typeof value === \"object\" && value !== null) {\n // These values are serialized as `{_tag: \"Redacted\", value: ...}` and `{_tag: \"Output\", description: ...}`,\n // so we need to detect them manually - Redacted.isRedacted and Output.isOutput do not work.\n if (isRedactedMarker(value)) {\n return Redacted.make(value.value);\n }\n else if (\"_tag\" in value &&\n value._tag === \"Output\" &&\n \"description\" in value &&\n typeof value.description === \"string\") {\n return new Output.NamedExpr(new Output.EffectExpr(Output.VoidExpr, () => Effect.never), value.description);\n }\n else if (isEffectMarker(value)) {\n // Rebuild an Effect-typed leaf so `isResolved`/`stripEffects` classify\n // it exactly like the original; dies loudly if anything ever runs it.\n const description = value.description;\n return Effect.suspend(() => Effect.die(new Error(`An Effect from the resource's props cannot cross the RPC provider boundary and was replaced by a placeholder: ${description}`)));\n }\n else if (isContextMarker(value)) {\n return Context.empty();\n }\n else if (isDurationEnvelope(value)) {\n return decodeDuration(value[DURATION_MARKER]) ?? value;\n }\n return Object.fromEntries(Object.entries(value).map(([key, child]) => [\n key,\n deserializeRpcArgs(child),\n ]));\n }\n return value;\n};\n//# sourceMappingURL=RpcSerialization.js.map","import * as Config from \"effect/Config\";\nimport * as ConfigProvider from \"effect/ConfigProvider\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport { AlchemyContext } from \"../AlchemyContext.js\";\nimport { AuthProviders } from \"../Auth/AuthProvider.js\";\nimport { CredentialsStoreLive } from \"../Auth/Credentials.js\";\nimport { ProfileStoreLive } from \"../Auth/Profile.js\";\nimport { withProfileOverride } from \"../Auth/Resolve.js\";\nimport { Stack } from \"../Stack.js\";\nimport { Stage } from \"../Stage.js\";\nimport { loadConfigProvider } from \"../Util/ConfigProvider.js\";\n/** Query parameter carrying the JSON {@link SessionEnvironment} on session websockets. */\nexport const SESSION_ENV_PARAM = \"alchemy-session-env\";\nexport const encodeSessionEnvironment = (env) => JSON.stringify(env);\nexport const decodeSessionEnvironment = (raw) => JSON.parse(raw);\nexport const layer = (environment) => Layer.mergeAll(ProfileStoreLive, CredentialsStoreLive, Layer.succeed(AuthProviders, {}), ConfigProvider.layer(loadConfigProvider(Option.fromNullishOr(environment.envFile)).pipe(Effect.map((base) => withProfileOverride(base, environment.profile)))), Layer.succeed(AlchemyContext, environment.alchemyContext), Layer.succeed(Stack, {\n name: environment.stack.name,\n stage: environment.stack.stage,\n resources: {},\n bindings: {},\n actions: {},\n}), Layer.succeed(Stage, environment.stack.stage));\nexport const RPC_SERVER_ENVIRONMENT_KEY = \"ALCHEMY_RPC_SERVER_ENVIRONMENT\";\n/** The spawn-time environment the parent baked into the child's process env. */\nexport const fromProcessEnv = Config.String(RPC_SERVER_ENVIRONMENT_KEY).pipe(Config.map((raw) => JSON.parse(raw)));\n/**\n * Legacy single-stack boot: the full environment (including the stack) baked\n * into the process env at spawn time. Used by children that serve exactly one\n * stack for their whole lifetime (e.g. the Vite dev-server child, which gets\n * an explicit environment from `startViteChild`). RPC sidecars do NOT use\n * this — their sessions each carry a {@link SessionEnvironment}.\n */\nexport const fromEnv = () => Layer.unwrap(fromProcessEnv.pipe(Effect.flatMap((environment) => environment.stack === undefined ||\n environment.alchemyContext === undefined\n ? Effect.die(new Error(`${RPC_SERVER_ENVIRONMENT_KEY} carries no stack/alchemyContext — this child requires the legacy single-stack environment`))\n : Effect.succeed(layer({\n profile: environment.profile,\n envFile: environment.envFile,\n stack: environment.stack,\n alchemyContext: environment.alchemyContext,\n })))));\n//# sourceMappingURL=RpcServerEnvironment.js.map","import { newWebSocketRpcSession } from \"capnweb\";\nimport * as Cache from \"effect/Cache\";\nimport * as Config from \"effect/Config\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as HttpBody from \"effect/unstable/http/HttpBody\";\nimport * as HttpClient from \"effect/unstable/http/HttpClient\";\nimport { AlchemyContext } from \"../AlchemyContext.js\";\nimport { Stack } from \"../Stack.js\";\nimport { unwrapRpcHandlers } from \"./RpcSerialization.js\";\nimport { encodeSessionEnvironment, SESSION_ENV_PARAM, } from \"./RpcServerEnvironment.js\";\nexport class RpcProviderProxy extends Context.Service()(\"alchemy/Local/RpcProviderProxy\") {\n}\nexport const SPAWNER_URL_ENV_KEY = \"ALCHEMY_RPC_SPAWNER_URL\";\n/**\n * The one sidecar entry every RPC-backed provider is served from.\n * Resolve through package exports so this also works when the proxy is\n * bundled into `bin/exec.js`. The active export conditions select `src/`\n * under Bun or the dev loader and `lib/` in a published Node install.\n */\nexport const SIDECAR_ENTRY_URL = import.meta.resolve(\"alchemy/Local/Sidecar\");\nconst make = Effect.fn(function* (spawnerUrl) {\n const client = yield* HttpClient.HttpClient;\n const getSession = Effect.fn(function* (sessionEnv) {\n const payload = { serverEntryUrl: SIDECAR_ENTRY_URL };\n const response = yield* client.post(spawnerUrl, {\n body: yield* HttpBody.json(payload),\n });\n // The spawner returns the one shared sidecar; the stack-specific\n // environment rides the session websocket so the child can build (and\n // memoize) a provider context per stack and provider group.\n const body = yield* response.text;\n if (response.status !== 200) {\n return yield* Effect.fail(new Error(`RPC spawner POST ${spawnerUrl} returned ${response.status}: ${body.slice(0, 300)}`));\n }\n let websocketUrl;\n try {\n websocketUrl = new URL(body);\n }\n catch {\n return yield* Effect.fail(new Error(`RPC spawner POST ${spawnerUrl} did not return a websocket URL (got ${JSON.stringify(body.slice(0, 200))})`));\n }\n if (websocketUrl.protocol !== \"ws:\" && websocketUrl.protocol !== \"wss:\") {\n return yield* Effect.fail(new Error(`RPC spawner POST ${spawnerUrl} returned a non-websocket URL: ${websocketUrl.toString()}`));\n }\n websocketUrl.searchParams.set(SESSION_ENV_PARAM, sessionEnv);\n return newWebSocketRpcSession(websocketUrl.toString());\n }, (effect) => Effect.catch(effect, (error) => Effect.die(new Error(\"Failed to create a provider RPC session with the sidecar\", {\n cause: error,\n }))));\n // A websocket that drops (sidecar crash/restart, abnormal 1006 close)\n // permanently breaks the capnweb session, and a cached broken session would\n // poison every subsequent call — including test-runner retries.\n // `onRpcBroken` fires on disconnect and evicts the entry, so the next `get`\n // re-registers with the spawner (which respawns the sidecar child if it\n // died). Assigned after the cache exists; the callback only fires on live\n // sessions, which the cache must already contain.\n let evictBrokenSession = () => { };\n // One session per stack environment, shared by every provider group.\n const cache = yield* Cache.make({\n lookup: (sessionEnv) => getSession(sessionEnv).pipe(Effect.tap((session) => Effect.sync(() => session.onRpcBroken(() => evictBrokenSession(sessionEnv))))),\n capacity: Infinity,\n });\n evictBrokenSession = (key) => Effect.runFork(Cache.invalidate(cache, key));\n return RpcProviderProxy.of({\n get: Effect.fn(function* (providersUrl, providerName) {\n const alchemyContext = yield* AlchemyContext;\n const stack = yield* Stack;\n const key = encodeSessionEnvironment({\n alchemyContext,\n stack: { name: stack.name, stage: stack.stage },\n });\n const fetchProvider = Effect.gen(function* () {\n const session = yield* Cache.get(cache, key);\n return yield* Effect.tryPromise(() => session.getProvider(providerName, providersUrl));\n });\n // One in-place reconnect: if the session broke mid-call (the broken\n // callback may not have evicted it yet), drop it and re-register once\n // before giving up.\n const provider = yield* fetchProvider.pipe(Effect.catch(() => Cache.invalidate(cache, key).pipe(Effect.andThen(fetchProvider))), Effect.orDie);\n // The served shape omits the process-local `mode`/`modes` variant\n // machinery (see RpcProviderService); the unwrapped stub is a plain\n // (mode-agnostic) ProviderService.\n return unwrapRpcHandlers(provider, [\"tail\"]);\n }),\n });\n});\nexport const layer = (url) => Layer.effect(RpcProviderProxy, make(url));\nexport const fromEnv = () => Layer.effect(RpcProviderProxy, Config.String(SPAWNER_URL_ENV_KEY).pipe(Effect.flatMap(make)));\n//# sourceMappingURL=RpcProviderProxy.js.map","import * as Cache from \"effect/Cache\";\nimport * as Config from \"effect/Config\";\nimport * as Console from \"effect/Console\";\nimport * as Context from \"effect/Context\";\nimport * as Deferred from \"effect/Deferred\";\nimport * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport * as Queue from \"effect/Queue\";\nimport * as Schedule from \"effect/Schedule\";\nimport * as Schema from \"effect/Schema\";\nimport * as Scope from \"effect/Scope\";\nimport * as Stream from \"effect/Stream\";\nimport * as HttpClient from \"effect/unstable/http/HttpClient\";\nimport * as HttpServer from \"effect/unstable/http/HttpServer\";\nimport { HttpServerRequest } from \"effect/unstable/http/HttpServerRequest\";\nimport * as HttpServerResponse from \"effect/unstable/http/HttpServerResponse\";\nimport * as ChildProcess from \"effect/unstable/process/ChildProcess\";\nimport * as ChildProcessSpawner from \"effect/unstable/process/ChildProcessSpawner\";\nimport { fileURLToPath } from \"node:url\";\nimport { pipedColorEnv } from \"../Util/Terminal.js\";\nimport { nodeLoaderArgs } from \"../Util/Node.js\";\nimport { httpServer } from \"../Util/PlatformServices.js\";\nimport { SPAWNER_URL_ENV_KEY } from \"./RpcProviderProxy.js\";\nimport { RPC_SERVER_ENVIRONMENT_KEY, } from \"./RpcServerEnvironment.js\";\nexport class RpcSpawner extends Context.Service()(\"alchemy/Local/RpcSpawner\") {\n}\n/**\n * The spawner forks one child per distinct `serverEntryUrl`. Stack-specific\n * context (stack name/stage, AlchemyContext) is NOT part of the spawn key —\n * it travels per RPC session (see `SESSION_ENV_PARAM`), so many stacks\n * (e.g. every test file in a run) share a single sidecar process.\n */\nexport const RpcSpawnPayload = Schema.Struct({ serverEntryUrl: Schema.String });\nexport const HeartbeatFrame = Schema.Struct({\n channel: Schema.Literal(\"heartbeat\"),\n});\nconst SidecarLogLineSchema = Schema.Struct({\n channel: Schema.Literals([\"stdout\", \"stderr\"]),\n line: Schema.String,\n});\n/**\n * Path on the spawner's HTTP server that streams sidecar output as NDJSON\n * ({@link SidecarLogLine} per line). Consumed by {@link forwardSidecarLogs}\n * from the exec child, which owns the terminal renderer.\n */\nexport const LOGS_PATH = \"/logs\";\nexport const make = Effect.fn(function* ({ profile, envFile, }) {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const scope = yield* Effect.scope;\n const cache = yield* Cache.make({\n lookup: (serverEntryUrl) => spawn(serverEntryUrl).pipe(Scope.provide(scope)),\n capacity: Infinity,\n });\n // Sidecar output hub. During `alchemy dev` this process (the outer dev\n // command) shares the tty with the exec child, and the exec child owns the\n // repainting progress renderer. Printing sidecar lines RAW from here\n // interleaves with the renderer's repaints and corrupts the region\n // (stacked/duplicated frames). So: when an exec child is subscribed via\n // the /logs endpoint, hand lines to it and let its logger route them into\n // the renderer; only log from this process as a fallback when no\n // subscriber is connected (e.g. during a --watch restart gap, when no\n // renderer is alive either).\n const subscribers = new Set();\n const publish = (line) => Effect.suspend(() => {\n if (subscribers.size > 0) {\n for (const notify of subscribers)\n notify(line);\n return Effect.void;\n }\n // Fallback path (no exec child subscribed): sidecar lines already carry\n // the sidecar's logger prefix, so print verbatim rather than stamping\n // this process's logger prefix on top.\n return line.channel === \"stderr\"\n ? Console.error(line.line)\n : Console.log(line.line);\n });\n const spawn = Effect.fn(function* (serverEntryUrl) {\n const bin = typeof globalThis.Bun !== \"undefined\" ? \"bun\" : \"node\";\n const main = fileURLToPath(serverEntryUrl);\n // The sidecar runs on THIS process's runtime binary, not whatever PATH\n // resolves: a `.ts` entry (checkout) needs the dev-mode loader hooks,\n // which are gated on this node's version, and a published `.js` entry\n // must not silently switch Node versions between supervisor and sidecar.\n const program = bin === \"bun\" ? \"bun\" : process.execPath;\n // Stack-specific context is deliberately absent: sessions carry their\n // own SessionEnvironment, so one child serves every stack.\n const environment = {\n profile,\n envFile,\n };\n // Sidecar stdio is piped, so toolchains down the chain (vite, workerd,\n // pretty loggers) detect a non-TTY and drop ANSI colors — but their\n // output ultimately renders on THIS process's terminal. Force color\n // through the pipe when that terminal supports it, unless the user\n // already decided (NO_COLOR / FORCE_COLOR). `extendEnv` propagates it\n // from the sidecar to its own children (dev servers, workerd).\n const command = ChildProcess.make(program, {\n bun: [\"run\", main],\n // Under Node the sidecar starts with alchemy's Oxc loader hooks, the\n // same way `dev.ts` starts the exec child: a `.ts` entry (src/ in a\n // checkout) also gets src-condition resolution, a `.js` entry (lib/\n // in a published install) gets the loader alone.\n node: [...nodeLoaderArgs(main), main],\n }[bin], {\n stdout: \"pipe\",\n // Piped (NOT inherited) so the child's output routes through the\n // Effect Console service: raw writes to the parent's fd corrupt the\n // test runner's reporter/TUI. The drain below is mandatory — an\n // unread pipe eventually fills and blocks the child.\n stderr: \"pipe\",\n // `detached` deliberately unset: the spawner defaults to a new process\n // group on POSIX (and none on Windows, where a detached console child\n // has its own quirks). A terminal Ctrl+C must NOT reach the sidecar\n // directly — its lifecycle belongs to this process's finalizer (the\n // bounded kill below), and a sidecar tearing itself down concurrently\n // yanks local providers out from under the exec child mid-shutdown.\n // As a group leader the kill also reaps the sidecar's own children\n // (workerd, emulators) instead of orphaning them.\n env: {\n [RPC_SERVER_ENVIRONMENT_KEY]: JSON.stringify(environment),\n ...pipedColorEnv(),\n },\n extendEnv: true,\n });\n const handle = yield* spawner.spawn(command);\n yield* handle.stderr.pipe(Stream.decodeText, Stream.splitLines, Stream.runForEach((line) => publish({ channel: \"stderr\", line })), Effect.ignore, Effect.forkScoped);\n // This scope is the child handle's sole owner. Graceful shutdown runs this\n // finalizer; abrupt parent loss closes the RPC parent connection and the\n // child self-terminates (both paths are covered by RpcSpawnerCleanup).\n const kill = handle.kill({ forceKillAfter: \"500 millis\" });\n yield* Effect.addFinalizer(() => kill.pipe(Effect.ignore));\n const url = yield* getRpcAddress(handle.stdout, (line) => publish({ channel: \"stdout\", line }));\n const ws = yield* Effect.acquireRelease(Effect.sync(() => new WebSocket(new URL(\"/parent\", url))), (ws) => Effect.sync(() => ws.close()));\n return {\n url,\n isRunning: Effect.zipWith(handle.isRunning, Effect.sync(() => ws.readyState === WebSocket.CONNECTING ||\n ws.readyState === WebSocket.OPEN), (a, b) => a && b, { concurrent: true }),\n kill,\n };\n });\n const register = Effect.fn(function* (serverEntryUrl, attempt = 0) {\n const child = yield* Cache.get(cache, serverEntryUrl);\n if (yield* child.isRunning) {\n return child.url;\n }\n if (attempt > 3) {\n return yield* Effect.die(new Error(`Failed to spawn RPC server for \"${serverEntryUrl}\" after ${attempt} attempts.`));\n }\n yield* child.kill;\n yield* Cache.invalidate(cache, serverEntryUrl);\n return yield* register(serverEntryUrl, attempt + 1);\n });\n const server = yield* HttpServer.HttpServer;\n const encoder = new TextEncoder();\n // The first heartbeat flushes the response headers immediately; the\n // periodic ones defeat idle timeouts (Bun kills sockets that stay silent\n // for ~10s). Entries without a `line` are skipped by the client.\n const heartbeat = { channel: \"heartbeat\" };\n const HEARTBEAT = encoder.encode(`${JSON.stringify(heartbeat)}\\n`);\n const heartbeats = Stream.make(HEARTBEAT).pipe(Stream.concat(Stream.fromSchedule(Schedule.spaced(Duration.seconds(5))).pipe(Stream.map(() => HEARTBEAT))));\n yield* server.serve(Effect.gen(function* () {\n const request = yield* HttpServerRequest;\n // `request.url` is relative under Node and absolute under Bun —\n // normalize to the pathname before matching.\n const pathname = new URL(request.url, \"http://localhost\").pathname;\n if (pathname === LOGS_PATH) {\n // Long-lived NDJSON stream of sidecar output. The subscriber (exec\n // child) routes these lines through its logger, which the renderer\n // inserts above the progress region instead of tearing it. Client\n // disconnect interrupts the stream and unregisters the subscriber.\n const queue = yield* Queue.make();\n const notify = (line) => {\n Queue.offerUnsafe(queue, encoder.encode(`${JSON.stringify(line)}\\n`));\n };\n subscribers.add(notify);\n return HttpServerResponse.stream(Stream.merge(Stream.fromQueue(queue).pipe(Stream.ensuring(Effect.sync(() => subscribers.delete(notify)))), heartbeats), { contentType: \"application/x-ndjson\" });\n }\n const decoded = yield* Effect.result(request.json.pipe(Effect.flatMap(Schema.decodeUnknownEffect(RpcSpawnPayload))));\n if (decoded._tag === \"Failure\") {\n return HttpServerResponse.text(\"Invalid RPC spawn payload.\", {\n status: 400,\n });\n }\n const entry = yield* Effect.result(Effect.try({\n try: () => new URL(decoded.success.serverEntryUrl),\n catch: (cause) => cause,\n }));\n if (entry._tag === \"Failure\" || entry.success.protocol !== \"file:\") {\n return HttpServerResponse.text(\"serverEntryUrl must be a valid file URL.\", { status: 400 });\n }\n const url = yield* register(entry.success.href);\n return HttpServerResponse.text(url);\n }));\n return RpcSpawner.of({\n url: HttpServer.formatAddress(server.address),\n });\n});\nexport const layerServer = (environment) => Layer.effect(RpcSpawner, make(environment)).pipe(\n// `/logs` is deliberately long-lived. On shutdown the exec child still\n// owns that response while this scope owns the exec child, so waiting for\n// Node's default 20-second graceful HTTP drain creates a finalizer cycle.\n// Stop accepting/serving immediately so the watcher finalizer can close\n// the child; all actual sidecars still use their own bounded finalizers.\nLayer.provide(httpServer(0, \"127.0.0.1\", { gracefulShutdownTimeout: 0 })));\nconst RPC_ADDRESS_REGEX = /(<ALCHEMY_RPC_ADDRESS>)(.+)(<\\/ALCHEMY_RPC_ADDRESS>)/;\nconst getRpcAddress = (stdout, publish) => Effect.gen(function* () {\n const address = yield* Deferred.make();\n // Set once the address line is seen; lines before it are handshake noise.\n let addressSeen = false;\n yield* stdout.pipe(Stream.decodeText, Stream.splitLines, Stream.runForEach((line) => {\n const match = line.match(RPC_ADDRESS_REGEX);\n if (match) {\n addressSeen = true;\n return Deferred.succeed(address, match[2]);\n }\n return addressSeen ? publish(line) : Effect.void;\n }), Effect.forkScoped);\n return yield* Deferred.await(address);\n});\nexport const parseSidecarLogLine = (raw) => {\n try {\n return Schema.decodeUnknownOption(SidecarLogLineSchema)(JSON.parse(raw)).pipe(Option.getOrUndefined);\n }\n catch {\n return undefined;\n }\n};\n/**\n * Pull sidecar output from the spawner (the outer `alchemy dev` process)\n * into THIS process's Console. The exec child owns the terminal renderer —\n * Sigil patches its `console`, so lines printed here are inserted cleanly\n * above the repainting progress region instead of racing it on the shared\n * tty. Forks in the ambient scope and never fails: when no spawner is\n * configured (`ALCHEMY_RPC_SPAWNER_URL` absent — plain deploy/destroy) it is\n * a no-op, and if the connection drops the spawner's own fallback printing\n * takes over.\n */\nexport const forwardSidecarLogs = (\n/** Mirrors every forwarded line (e.g. into a dev log file). */\ntee) => Config.String(SPAWNER_URL_ENV_KEY).pipe(Effect.flatMap((spawnerUrl) => {\n const streamOnce = Effect.gen(function* () {\n const client = yield* HttpClient.HttpClient;\n const response = yield* client.get(new URL(LOGS_PATH, spawnerUrl).toString());\n yield* response.stream.pipe(Stream.decodeText, Stream.splitLines, Stream.runForEach((raw) => Effect.suspend(() => {\n const parsed = parseSidecarLogLine(raw);\n if (parsed === undefined)\n return Effect.void;\n tee?.(parsed);\n // Sidecar lines already carry the sidecar's own logger prefix\n // (timestamp/level/fiber) — print them verbatim; routing through\n // this process's logger would stamp a second prefix on top.\n return parsed.channel === \"stderr\"\n ? Console.error(parsed.line)\n : Console.log(parsed.line);\n })));\n });\n // Keep the subscription alive for the whole dev session: reconnect\n // (paced) if the stream ends or errors. While disconnected the spawner's\n // fallback printing covers the gap; the loop dies with the ambient scope.\n return streamOnce.pipe(Effect.ignore, Effect.andThen(Effect.sleep(\"1 second\")), Effect.forever);\n}), Effect.ignore, Effect.forkScoped, Effect.asVoid);\n//# sourceMappingURL=RpcSpawner.js.map","","import { exec } from \"node:child_process\";\nimport * as crypto from \"node:crypto\";\nimport * as fs from \"node:fs/promises\";\nimport * as os from \"node:os\";\nimport * as nodePath from \"node:path\";\nimport * as Effect from \"effect/Effect\";\nimport packageJson from \"../../package.json\" with { type: \"json\" };\nconst ALCHEMY_DIR = nodePath.join(os.homedir(), \".alchemy\");\nconst ID_PATH = nodePath.join(ALCHEMY_DIR, \"id\");\nconst DISABLED_PATH = nodePath.join(ALCHEMY_DIR, \"telemetry-disabled\");\nconst tryRead = (path) => Effect.tryPromise(() => fs.readFile(path, \"utf-8\").then((s) => s.trim())).pipe(Effect.orElseSucceed(() => null));\nconst sha256Hex = (input) => crypto.createHash(\"sha256\").update(input).digest(\"hex\");\nconst hashStringOrEmpty = (input) => input == null || input === \"\" ? \"\" : sha256Hex(input);\nconst execCapture = (cmd) => Effect.callback((resume) => {\n exec(cmd, { timeout: 1500 }, (err, stdout) => {\n if (err) {\n resume(Effect.succeed(null));\n return;\n }\n resume(Effect.succeed(stdout.toString().trim()));\n });\n});\nconst getOrCreateUserId = Effect.gen(function* () {\n const existing = yield* tryRead(ID_PATH);\n if (existing)\n return existing;\n const id = crypto.randomUUID();\n yield* Effect.tryPromise({\n try: async () => {\n await fs.mkdir(ALCHEMY_DIR, { recursive: true });\n await fs.writeFile(ID_PATH, id);\n },\n catch: () => null,\n }).pipe(Effect.catch(() => Effect.void));\n return id;\n});\nconst getRootCommitHash = execCapture(process.platform === \"win32\"\n ? `git rev-list --max-parents=0 HEAD | ForEach-Object { if (-not (git cat-file -p $_ | Select-String \"^parent \")) { $_ } }`\n : `git rev-list --max-parents=0 HEAD | xargs -r -I{} sh -c 'git cat-file -p {} | grep -q \"^parent \" || echo {}'`);\nconst getGitOriginUrl = execCapture(\"git config --get remote.origin.url\");\nconst getBranchName = execCapture(\"git rev-parse --abbrev-ref HEAD\");\nconst getRuntime = () => {\n const g = globalThis;\n if (typeof g.Bun !== \"undefined\") {\n return { name: \"bun\", version: g.Bun.version };\n }\n if (typeof g.Deno !== \"undefined\") {\n return { name: \"deno\", version: g.Deno.version?.deno ?? \"\" };\n }\n if (globalThis.process?.versions?.node) {\n return { name: \"node\", version: process.versions.node };\n }\n return { name: \"\", version: \"\" };\n};\nconst CI_PROVIDERS = [\n { env: \"GITHUB_ACTIONS\", provider: \"GitHub Actions\", isCI: true },\n { env: \"GITLAB_CI\", provider: \"GitLab CI\", isCI: true },\n { env: \"CIRCLECI\", provider: \"CircleCI\", isCI: true },\n { env: \"JENKINS_URL\", provider: \"Jenkins\", isCI: true },\n { env: \"TRAVIS\", provider: \"Travis CI\", isCI: true },\n { env: \"BUILDKITE\", provider: \"Buildkite\", isCI: true },\n { env: \"NOW_BUILDER\", provider: \"Vercel\", isCI: true },\n { env: \"VERCEL\", provider: \"Vercel\", isCI: false },\n];\nconst getCIEnvironment = () => {\n for (const p of CI_PROVIDERS) {\n if (process.env[p.env]) {\n return { provider: p.provider, isCI: p.isCI };\n }\n }\n return { provider: \"\", isCI: !!process.env.CI };\n};\nconst TELEMETRY_DISABLED_ENV = () => !!process.env.ALCHEMY_TELEMETRY_DISABLED ||\n !!process.env.DO_NOT_TRACK ||\n !!process.env.NO_TRACK;\n/**\n * `true` if telemetry is disabled via environment variable\n * (`DO_NOT_TRACK`, `NO_TRACK`, `ALCHEMY_TELEMETRY_DISABLED`) or via a\n * persisted opt-out file at `~/.alchemy/telemetry-disabled`.\n */\nexport const isTelemetryDisabled = Effect.gen(function* () {\n if (TELEMETRY_DISABLED_ENV())\n return true;\n const persisted = yield* tryRead(DISABLED_PATH);\n return persisted === \"true\";\n});\n/**\n * Persists an opt-out so future invocations skip telemetry without needing\n * an env var.\n */\nexport const setTelemetryDisabled = Effect.tryPromise(async () => {\n await fs.mkdir(ALCHEMY_DIR, { recursive: true });\n await fs.writeFile(DISABLED_PATH, \"true\");\n}).pipe(Effect.ignore);\nexport const setTelemetryEnabled = Effect.tryPromise(() => fs.rm(DISABLED_PATH, { force: true })).pipe(Effect.ignore);\nconst collectAttributesUncached = Effect.gen(function* () {\n const [userId, rootCommit, originUrl, branch] = yield* Effect.all([\n getOrCreateUserId,\n getRootCommitHash,\n getGitOriginUrl,\n getBranchName,\n ], { concurrency: \"unbounded\" });\n const runtime = getRuntime();\n const ci = getCIEnvironment();\n return {\n \"alchemy.user.id\": userId,\n \"alchemy.session.id\": process.env.ALCHEMY_TELEMETRY_SESSION_ID ?? crypto.randomUUID(),\n \"alchemy.version\": packageJson.version,\n \"alchemy.git.root_commit\": rootCommit ?? \"\",\n \"alchemy.git.origin_hash\": hashStringOrEmpty(originUrl),\n \"alchemy.git.branch_hash\": hashStringOrEmpty(branch),\n \"alchemy.runtime.name\": runtime.name,\n \"alchemy.runtime.version\": runtime.version,\n \"alchemy.ci.provider\": ci.provider,\n \"alchemy.ci\": ci.isCI,\n \"host.arch\": os.arch(),\n \"os.type\": os.platform(),\n \"os.version\": os.release(),\n \"host.cpus\": os.cpus().length,\n \"host.memory_mb\": Math.round(os.totalmem() / 1024 / 1024),\n };\n});\nlet cachedAttrs;\n/**\n * Resolves the {@link TelemetryAttributes} for the current process. Cached\n * so file I/O and `git` invocations only run once per CLI invocation; every\n * subsequent caller gets the same record (and therefore the same session\n * id).\n */\nexport const collectAttributes = Effect.suspend(() => cachedAttrs !== undefined\n ? Effect.succeed(cachedAttrs)\n : collectAttributesUncached.pipe(Effect.tap((a) => Effect.sync(() => {\n cachedAttrs = a;\n }))));\n//# sourceMappingURL=Attributes.js.map","import * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\";\nimport * as OtlpLogger from \"effect/unstable/observability/OtlpLogger\";\nimport * as OtlpMetrics from \"effect/unstable/observability/OtlpMetrics\";\nimport * as OtlpSerialization from \"effect/unstable/observability/OtlpSerialization\";\nimport * as OtlpTracer from \"effect/unstable/observability/OtlpTracer\";\nimport packageJson from \"../../package.json\" with { type: \"json\" };\nimport { collectAttributes, isTelemetryDisabled } from \"./Attributes.js\";\nconst TRACES_URL = \"https://otel.alchemy.run/v1/traces\";\nconst METRICS_URL = \"https://otel.alchemy.run/v1/metrics\";\nconst LOGS_URL = \"https://otel.alchemy.run/v1/logs\";\nconst SERVICE_NAME = \"alchemy-cli\";\nconst buildOtlpLayer = (attrs) => {\n const resource = {\n serviceName: SERVICE_NAME,\n serviceVersion: packageJson.version,\n attributes: attrs,\n };\n // Short export intervals so even sub-second CLI invocations flush at\n // least one batch before the process exits.\n const tracer = OtlpTracer.layer({\n url: TRACES_URL,\n resource,\n exportInterval: \"1 second\",\n });\n const metrics = OtlpMetrics.layer({\n url: METRICS_URL,\n resource,\n exportInterval: \"1 second\",\n });\n // Stack on top of whatever loggers are already installed. Entrypoints\n // provide this layer *over* their terminal/file logger layer\n // (`Layer.provideMerge(TelemetryLive, ConsoleLogLive)`), so the terminal\n // logger has already replaced Effect's default stdout logger by the time\n // this runs and the OTLP logger is simply added alongside it.\n //\n // `mergeWithExisting: false` here would make telemetry *replace* the\n // terminal logger whenever this layer happened to be merged after it —\n // exactly what silenced `alchemy dev`'s console output in the exec child.\n const logger = OtlpLogger.layer({\n url: LOGS_URL,\n resource,\n exportInterval: \"1 second\",\n mergeWithExisting: true,\n });\n return Layer.mergeAll(tracer, metrics, logger).pipe(Layer.provide(OtlpSerialization.layerJson), Layer.provide(FetchHttpClient.layer));\n};\n/**\n * The CLI's telemetry layer. Builds an OTLP HTTP exporter that ships spans\n * to {@link TRACES_URL} and metrics to {@link METRICS_URL}, attaching\n * {@link collectAttributes} as resource-level attributes so every signal\n * carries user/project/runtime context.\n *\n * The OTLP logger merges with the loggers already installed, so provide this\n * layer on top of the entrypoint's terminal/file logger layer — e.g.\n * `Layer.provideMerge(TelemetryLive, ConsoleLogLive)` — never as a sibling in\n * a `Layer.mergeAll` (the last `CurrentLoggers` in a merge wins, silently\n * dropping either the terminal output or the telemetry).\n *\n * If the user has opted out (via `DO_NOT_TRACK`, `NO_TRACK`,\n * `ALCHEMY_TELEMETRY_DISABLED`, or `~/.alchemy/telemetry-disabled`), this\n * resolves to {@link Layer.empty}. Effect's default `Tracer` is a no-op,\n * so all `withSpan`/`Effect.fn` instrumentation in core stays free.\n */\nexport const TelemetryLive = Layer.unwrap(Effect.gen(function* () {\n if (yield* isTelemetryDisabled) {\n return Layer.empty;\n }\n const attrs = yield* collectAttributes;\n return buildOtlpLayer(attrs);\n}));\n//# sourceMappingURL=Layer.js.map","import * as Effect from \"effect/Effect\";\nimport { RuntimeContext } from \"./RuntimeContext.js\";\n/**\n * Runtime context bridge that lets an {@link Action} read Resource Outputs.\n *\n * Actions are peculiar: their init Effect runs at plan/stack-eval time (before\n * any resource exists) while their body runs at apply time (after upstreams are\n * materialized). To make `yield* db.databaseId` work inside an Action we split\n * the {@link RuntimeContext} into two cooperating halves that share nothing but\n * a sanitized key:\n *\n * - {@link makeCaptureContext} is provided while the init Effect runs. Its\n * `set(key, output)` records the referenced {@link Output} (so the engine can\n * add a dependency edge and later resolve it) and its `get(key)` hands back a\n * *deferred* accessor — an Effect that re-reads whatever `RuntimeContext` is\n * ambient when it actually runs.\n * - {@link makeResolveContext} is provided around the Action body at apply\n * time. Its `get(key)` returns the already-resolved value for that key.\n *\n * Because the accessor produced at init re-reads `RuntimeContext`, yielding it\n * inside the body resolves against the apply-time context — no shared mutable\n * state, no infinite recursion (the resolve context's `get` is terminal).\n */\nconst base = (id) => ({\n Type: \"Action\",\n id,\n env: {},\n});\n/**\n * Capture context — provided while an Action's init Effect runs. Records every\n * Output referenced via `yield* output` into `captures`, keyed by the Output's\n * sanitized key, and returns deferred accessors.\n */\nexport const makeCaptureContext = (captures) => ({\n ...base(\"capture\"),\n set: (key, output) => Effect.sync(() => {\n captures[key] = output;\n return key;\n }),\n // Deferred: re-read the ambient RuntimeContext at run time. At apply this is\n // the resolve context below; its `get` returns the materialized value. The\n // `RuntimeContext` requirement is erased at the Action boundary (`Run` is\n // typed `Effect<Out, any, any>`) and satisfied by the resolve context, so\n // the accessor presents as `Effect<T | undefined>`.\n get: ((key) => Effect.flatMap(RuntimeContext, (ctx) => ctx.get(key))),\n});\n/**\n * Resolve context — provided around an Action body at apply time. `resolved`\n * maps each captured key to its value (already evaluated against the tracker).\n */\nexport const makeResolveContext = (resolved) => ({\n ...base(\"resolve\"),\n set: (key) => Effect.succeed(key),\n get: (key) => Effect.succeed(resolved[key]),\n});\n//# sourceMappingURL=ActionRuntimeContext.js.map","/**\n * The credential-demand seam for credential-free `alchemy dev`.\n *\n * A dev run whose plan is entirely local must never touch (or prompt for)\n * cloud credentials. When the plan DOES need the cloud — a resource opted\n * out of local emulation via `Alchemy.remote()`, a local Worker binding\n * that proxies to a remote resource (`dev: { remote: true }`), or the\n * deletion of a row that was last reconciled live — credentials are\n * validated up front, BEFORE apply begins: the gate resolves each demanded\n * provider's credentials through the same precedence the run will use. The\n * seam never starts a login flow: missing credentials fail with the typed\n * {@link CredentialsRequired} error naming the demanding resources and\n * pointing at `alchemy profile edit` — the profile command is the only\n * place logins happen.\n *\n * How deep the up-front resolution goes is PROVIDER-DEPENDENT — it runs\n * the provider's `read`, no more:\n *\n * - Cloudflare's `read` eagerly checks OAuth expiry, silently refreshes,\n * and persists under the profile lock — so a dead refresh token fails\n * here as a typed `NeedsReauth`, and child processes (which only ever\n * read what a parent persisted) start with a warm token.\n * - AWS's `read` returns a credentials RECIPE whose inner effect stays\n * unevaluated (SSO tokens are loaded lazily by consumers), so an\n * expired SSO token passes the gate and still surfaces mid-run. Local-mode\n * AWS providers carry a floci-scoped environment of their own (see\n * `AWS/Local/FlociServices.ts`) and ensure the emulator there.\n *\n * The demand scan keys on provider MODE, not plan action — noop live rows\n * still demand (their runtime proxies need live credentials to serve), so\n * a watch restart re-runs this resolution even for an unchanged plan.\n *\n * Non-dev runs (`alchemy deploy` / `destroy`) never enter this seam:\n * state-store init and live providers drive the pre-existing lazy\n * credential-resolution flow unchanged.\n */\nimport * as Config from \"effect/Config\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport * as Option from \"effect/Option\";\nimport * as Result from \"effect/Result\";\nimport * as Schema from \"effect/Schema\";\nimport { profileCommandHint } from \"../Util/interactive.js\";\nimport { AuthError, AuthProviders, NeedsReauth, presentEnvironment, } from \"./AuthProvider.js\";\nimport { ALCHEMY_PROFILE, DEFAULT_PROFILE_NAME, ProfileStore, SuppressMissingProviderConfig, } from \"./Profile.js\";\nimport { resolveProviderConfig } from \"./Resolve.js\";\n/**\n * A dev-mode plan needs cloud credentials and none are configured for the\n * active profile. The message names the demanding resources and the exact\n * `alchemy profile edit` invocation that fixes it.\n */\nexport class CredentialsRequired extends Data.TaggedError(\"CredentialsRequired\") {\n}\nconst describeReason = (reason) => {\n switch (reason) {\n case \"remote\":\n return \"runs against the real cloud via Alchemy.remote()\";\n case \"remote-binding\":\n return \"has a binding that proxies to a remote resource (dev: { remote: true })\";\n case \"live-delete\":\n return \"deletes an instance that was deployed to the real cloud\";\n }\n};\n/** `\"AWS.S3.Bucket\"` → `\"AWS\"` (the auth-provider name). */\nconst cloudOf = (type) => type.split(\".\")[0] ?? type;\nconst resourceLines = (demand) => demand.resources\n .map((r) => ` - ${r.fqn} (${describeReason(r.reason)})`)\n .join(\"\\n\");\n/**\n * Build the typed {@link CredentialsRequired} failure for a demand.\n * Exported so tests can pin the message format.\n */\nexport const credentialsRequired = (demand, profileName) => Effect.gen(function* () {\n const command = yield* profileCommandHint(`alchemy profile edit --profile ${profileName} --add ${demand.provider}`);\n return yield* new CredentialsRequired({\n provider: demand.provider,\n resources: demand.resources.map((r) => r.fqn),\n reason: [...new Set(demand.resources.map((r) => r.reason))].join(\", \"),\n message: `${demand.provider} credentials are required, but none are configured ` +\n `for profile '${profileName}'.\\n` +\n `These resources require ${demand.provider} credentials:\\n` +\n `${resourceLines(demand)}\\n` +\n `Run \\`${command}\\` to configure ` +\n \"credentials, or set CI=1 to use environment-variable credentials.\",\n });\n});\n/**\n * The slice of binding data the demand scan cares about: local runtimes\n * mark cloud-proxied bindings with a truthy `devRemote` entry.\n */\nconst RemoteBindingData = Schema.Struct({\n devRemote: Schema.optional(Schema.Record(Schema.String, Schema.Boolean)),\n});\nconst decodeRemoteBindingData = Schema.decodeUnknownResult(RemoteBindingData);\nconst bindingDemandsRemote = (bindings) => (bindings ?? []).some((binding) => {\n // A binding being REMOVED needs no runtime proxy — the restarted\n // local instance simply no longer carries it.\n if (binding.action === \"delete\")\n return false;\n const data = decodeRemoteBindingData(binding.data);\n return (Result.isSuccess(data) &&\n Object.values(data.success.devRemote ?? {}).some((remote) => remote === true));\n});\n/**\n * Scan a plan for rows that need live (cloud) credentials during a dev\n * run, grouped by cloud provider:\n *\n * 1. resources whose resolved provider mode is `\"live\"` (`Alchemy.remote()`)\n * 2. resources whose binding data carries a truthy `devRemote` entry\n * (the local runtime proxies that binding to the real cloud)\n * 3. planned deletions of rows stamped `providerMode: \"live\"`\n *\n * Pure and side-effect-free — callers gate on the run being a dev run\n * (in a live run every dual-provider row resolves `\"live\"` and the\n * pre-existing lazy credential flow applies instead).\n *\n * Mode-agnostic rows (`mode === undefined`, single-implementation\n * providers that run live even in dev) are deliberately NOT collected:\n * they resolve credentials lazily exactly as they do today.\n */\nexport const collectCredentialDemands = (plan) => {\n const byProvider = new Map();\n const add = (type, fqn, reason) => {\n const provider = cloudOf(type);\n const resources = byProvider.get(provider) ?? new Map();\n if (!resources.has(fqn))\n resources.set(fqn, reason);\n byProvider.set(provider, resources);\n };\n for (const [fqn, node] of Object.entries(plan.resources)) {\n if (node.mode === \"live\") {\n add(node.resource.Type, fqn, \"remote\");\n }\n else if (bindingDemandsRemote(node.bindings)) {\n add(node.resource.Type, fqn, \"remote-binding\");\n }\n }\n for (const [fqn, node] of Object.entries(plan.deletions)) {\n if (node !== undefined && node.mode === \"live\") {\n add(node.resource.Type, fqn, \"live-delete\");\n }\n }\n return [...byProvider.entries()].map(([provider, resources]) => ({\n provider,\n resources: [...resources.entries()].map(([fqn, reason]) => ({\n fqn,\n reason,\n })),\n }));\n};\n/**\n * Re-fail a warm-up resolution error with the demand attached, so the user\n * sees WHY a dev run wanted cloud credentials. Tags are preserved —\n * consumers match `NeedsReauth`/`AuthError` by tag, never by message.\n */\nconst attachDemandContext = (demand) => (self) => self.pipe(Effect.mapError((error) => {\n const message = `${error.message}\\n` +\n `These resources require ${demand.provider} credentials:\\n` +\n resourceLines(demand);\n return error._tag === \"NeedsReauth\"\n ? new NeedsReauth({\n provider: error.provider,\n profile: error.profile,\n message,\n cause: error.cause,\n })\n : new AuthError({ message, cause: error.cause });\n}));\n/**\n * Validate credentials for every demand. Never starts a login flow —\n * logging in belongs to `alchemy profile edit` exclusively:\n *\n * - configured for the active profile → resolve the credentials through\n * the exact precedence the run will use ({@link resolveProviderConfig}:\n * CI environment, explicit env vars, then the profile). Resolution\n * runs the provider's `read` — how much that validates and warms is\n * provider-dependent (see the module header): Cloudflare eagerly\n * refreshes and persists so a dead refresh token fails HERE as a\n * typed {@link NeedsReauth} naming the demanding resources, while\n * AWS's lazy credential recipe defers SSO-token failures to mid-run.\n * - missing → typed {@link CredentialsRequired} failure with the exact\n * `alchemy profile edit` invocation to run\n * - CI → validates the provider's environment credentials directly,\n * matching every other CI path without creating profile state\n *\n * Demands whose cloud has no registered auth provider are skipped (bare\n * engine runs with test providers demand nothing). All context is\n * resolved optionally, so the effect is safe to run in any environment —\n * and a plan with zero demand touches no credentials at all.\n */\nexport const demandCredentials = Effect.fn(\"Alchemy.demandCredentials\")(function* (demands) {\n if (demands.length === 0)\n return;\n const registry = Option.getOrUndefined(yield* Effect.serviceOption(AuthProviders));\n const profile = Option.getOrUndefined(yield* Effect.serviceOption(ProfileStore));\n if (registry === undefined || profile === undefined)\n return;\n const ci = yield* Config.Boolean(\"CI\").pipe(Config.withDefault(false));\n // CI credentials come exclusively from the environment. Do not require\n // or inspect a local profile first: CI runners intentionally have no\n // profile manifest, and doing so would also risk consulting a developer's\n // stored profiles when this path is exercised locally under Doppler.\n const configuredProfile = yield* Config.option(ALCHEMY_PROFILE);\n const profileName = Option.getOrElse(configuredProfile, () => DEFAULT_PROFILE_NAME);\n yield* Effect.forEach(demands, (demand) => Effect.gen(function* () {\n const auth = registry[demand.provider];\n if (auth == null)\n return;\n if (ci) {\n if (auth.readEnvironment === undefined) {\n return yield* credentialsRequired(demand, profileName);\n }\n return yield* auth.readEnvironment.pipe(attachDemandContext(demand));\n }\n // Read-only precheck of the two non-CI configuration sources the\n // resolution precedence below consults: environment credentials\n // (which win regardless of the selected profile), or a profile\n // entry. \"Nothing configured\" fails with the actionable\n // {@link CredentialsRequired} here, WITHOUT entering\n // `resolveProviderConfig`: its profile path goes through\n // `ensureProfile`, which fails a nonexistent profile with a\n // generic ProfileError that would bury which resources demanded\n // credentials and what command fixes it.\n const envUsable = auth.readEnvironment !== undefined &&\n (yield* presentEnvironment(auth.environment)) !== undefined;\n const existing = yield* profile.getProfile(profileName);\n if (existing?.providers[auth.name] == null && !envUsable) {\n return yield* credentialsRequired(demand, profileName);\n }\n // Something IS configured — resolve through the same precedence\n // the run's lazy credential flow uses, so the gate can never\n // pass something resolution would later reject (or vice versa).\n // Suppressed missing-config mode turns a check/resolve race into\n // the typed tag below instead of a generic AuthError; it also\n // mutes the env-credentials warning here — the run's own\n // resolution still emits it.\n const resolved = yield* resolveProviderConfig(demand.provider).pipe(Effect.provideService(AuthProviders, registry), Effect.provideService(ProfileStore, profile), Effect.provideService(SuppressMissingProviderConfig, true), Effect.catchTag(\"MissingProviderConfig\", () => credentialsRequired(demand, profileName)), Effect.catchTag(\"ProfileError\", (error) => new AuthError({ message: error.message, cause: error })));\n yield* resolved.resolve.pipe(attachDemandContext(demand));\n }), { concurrency: 4, discard: true });\n});\n/**\n * Plan-time seam for `Alchemy.remote()` rows. The planner probes every new\n * resource with its provider's `read` (engine-level adoption) — for a\n * live-mode row in a dev run that is a real cloud call, made BEFORE\n * {@link demandPlanCredentials} could run in apply. Demanding here first\n * turns \"nothing configured\" into the typed {@link CredentialsRequired}\n * (naming the rows and the exact `alchemy profile edit` command) instead\n * of whatever raw error the first credential-less read produces. Bindings\n * and live deletions are still gated in apply — nothing reads for them\n * during plan.\n */\nexport const demandRemoteCredentials = (resources) => {\n const byProvider = new Map();\n for (const resource of resources) {\n const provider = cloudOf(resource.Type);\n byProvider.set(provider, [\n ...(byProvider.get(provider) ?? []),\n { fqn: resource.FQN, reason: \"remote\" },\n ]);\n }\n return demandCredentials([...byProvider.entries()].map(([provider, resources]) => ({\n provider,\n resources,\n })));\n};\n/**\n * The one-call seam wired into the dev path: scan the plan for live\n * demand and, if any, run {@link demandCredentials} BEFORE apply begins.\n */\nexport const demandPlanCredentials = (plan) => demandCredentials(collectCredentialDemands(plan));\n//# sourceMappingURL=Demand.js.map","import * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as Output from \"./Output.js\";\nimport { isPlainData, isPrimitive, mapPlainData } from \"./Util/data.js\";\n/**\n * Returns true when `value` (or any nested leaf) is still an unresolved\n * plan-time expression — i.e. an `Output`/`Expr` or an `Effect` that was\n * not fully evaluated by `resolveInput` in Plan.ts.\n *\n * Use at the top of a provider `diff` to short-circuit before field access:\n *\n * ```ts\n * if (!isResolved(news)) return undefined;\n * const resolved = news as MyProps;\n * ```\n */\nexport const hasUnresolvedInputs = (value) => _hasUnresolved(value);\nexport const isResolved = (value) => !_hasUnresolved(value);\nconst _hasUnresolved = (value, seen = new WeakSet()) => {\n if (value == null || isPrimitive(value))\n return false;\n if (Output.isExpr(value) || Effect.isEffect(value))\n return true;\n // Only plain data is traversed; any other class instance (Layer, Context,\n // Date, SDK objects) is a resolved leaf — see isPlainData (#1082).\n if (isPlainData(value)) {\n if (seen.has(value))\n return false;\n seen.add(value);\n return Object.values(value).some((v) => _hasUnresolved(v, seen));\n }\n return false;\n};\n/**\n * Deeply replace every unresolved plan-time expression (an `Output`/`Expr`\n * or an un-evaluated `Effect`) with `undefined`, leaving resolved values\n * (including opaque `Redacted`/`Duration` instances) intact.\n *\n * Persisted resource state must only ever hold plain data. Durable (JSON)\n * state stores already enforce this implicitly — Output proxies are\n * function-typed, so `JSON.stringify` silently drops them — but the\n * in-memory store used by tests retains live proxies, which would later be\n * fed back into provider lifecycle operations as `olds` after an\n * interrupted apply (e.g. `read` during a destroy plan) and blow up on\n * first string coercion. Sanitizing at the commit boundary keeps both\n * store kinds consistent with the provider contract that `olds` is\n * resolved `Props`.\n */\nexport const stripUnresolved = (value) => _stripUnresolved(value);\nconst _stripUnresolved = (value, \n// Ancestor-path cycle guard: a value on its own ancestor chain is cut to\n// `undefined` (a cycle can never persist). Sync DFS, so add/delete around\n// the recursion is race-free and keeps shared diamond references intact\n// (#1082).\nancestors = new WeakSet()) => {\n if (value == null || isPrimitive(value))\n return value;\n if (Output.isExpr(value) || Effect.isEffect(value))\n return undefined;\n // Serializable leaves — the only class instances persisted state may\n // carry (StateEncoding knows Redacted/Duration; Date JSON-encodes).\n // Rebuilding them structurally would strip their prototype.\n if (Redacted.isRedacted(value) ||\n Duration.isDuration(value) ||\n value instanceof Date) {\n return value;\n }\n if (isPlainData(value)) {\n return mapPlainData(value, ancestors, (child) => _stripUnresolved(child, ancestors));\n }\n // Any other class instance (Layer, Context, SDK objects) is runtime-only\n // wiring that can't round-trip through JSON — a beta.103 Context is even\n // cyclic (#1082). Persisted state holds plain data only.\n return undefined;\n};\n/**\n * Deeply replace Effect-valued entries with `undefined`, leaving resolved\n * values AND unresolved `Output`/`Expr`s intact.\n *\n * Effect-valued props — e.g. a tagged Worker class in `env` (the\n * circular-bindings pattern) — can never be evaluated inside lifecycle\n * operations, and {@link stripUnresolved} drops them from persisted state at\n * the commit boundary. A provider `diff` that wants its structural change\n * detection to still run despite them strips them first, so `isResolved`\n * gates only on genuinely-unresolved Outputs (#874). The Effects' deploy-time\n * identity is carried by the resolved binding data instead.\n */\nexport const stripEffects = (value) => _stripEffects(value);\nconst _stripEffects = (value, \n// Ancestor-path cycle guard — see _stripUnresolved (#1082).\nancestors = new WeakSet()) => {\n if (value == null || isPrimitive(value))\n return value;\n // Output proxies are left intact (so `isResolved` still sees them); they\n // must be tested BEFORE `Effect.isEffect` because Output exprs are\n // yieldable and would otherwise be misclassified as plain Effects.\n if (Output.isExpr(value))\n return value;\n if (Effect.isEffect(value))\n return undefined;\n if (Redacted.isRedacted(value) ||\n Duration.isDuration(value) ||\n value instanceof Date) {\n return value;\n }\n if (isPlainData(value)) {\n return mapPlainData(value, ancestors, (child) => _stripEffects(child, ancestors));\n }\n // Non-plain instances (Layer, Context, SDK objects) are dropped with\n // Effects — same runtime-only rationale, and their internals may be\n // cyclic (effect ≥4.0.0-beta.103's Context — #1082).\n return undefined;\n};\nexport const somePropsAreDifferent = (olds, news, props) => {\n for (const prop of props) {\n if (olds[prop] !== news[prop]) {\n return true;\n }\n }\n return false;\n};\nexport const anyPropsAreDifferent = (olds, news) => {\n for (const prop in olds) {\n if (olds[prop] !== news[prop]) {\n return true;\n }\n }\n for (const prop in news) {\n if (!(prop in olds)) {\n return true;\n }\n }\n return false;\n};\nexport const havePropsChanged = (oldProps, newProps) => Output.hasOutputs(newProps) ||\n // Compare both sides through `stripUnresolved` so the comparison is\n // symmetric with the commit boundary: persisted props can never hold an\n // Effect or Output expr (stripped at commit / silently dropped by JSON\n // serialization), while desired props may still carry them — e.g. a tagged\n // Worker class in `env` serializes via its `toJSON` to\n // `{\"_id\":\"Effect\",...}` and would otherwise report a phantom change on\n // every plan, forever (#874). Unresolved Outputs in `newProps` are already\n // caught by the `hasOutputs` guard above, so stripping here never hides a\n // real difference.\n JSON.stringify(canonicalize(stripUnresolved(oldProps ?? {}), false)) !==\n JSON.stringify(canonicalize(stripUnresolved(newProps ?? {}), false));\n/**\n * Sort-keys deep equality for plain data (objects, arrays, primitives).\n * Use in provider `diff` handlers instead of ad-hoc `JSON.stringify` comparisons.\n *\n * By default, `null` and `undefined` are treated as distinct. Pass\n * `{ stripNullish: true }` to opt into treating them as equivalent.\n */\nexport const deepEqual = (a, b, options) => JSON.stringify(canonicalize(a, options?.stripNullish ?? false)) ===\n JSON.stringify(canonicalize(b, options?.stripNullish ?? false));\nconst canonicalize = (value, stripNullish, \n// Ancestor-path cycle guard — see _stripUnresolved (#1082).\nancestors = new WeakSet()) => {\n if (stripNullish && value == null)\n return undefined;\n if (Redacted.isRedacted(value)) {\n return {\n _tag: \"Redacted\",\n value: Redacted.value(value),\n };\n }\n // JSON-safe leaves compare by their serialized form (Duration/Date have\n // toJSON).\n if (Duration.isDuration(value) || value instanceof Date)\n return value;\n if (isPlainData(value)) {\n const rebuilt = mapPlainData(value, ancestors, (child) => canonicalize(child, stripNullish, ancestors));\n if (rebuilt === undefined || Array.isArray(rebuilt))\n return rebuilt;\n // Deterministic key order for the JSON.stringify comparison. Filtering\n // after the walk is JSON-equivalent to filtering before it —\n // undefined-valued keys are dropped by JSON.stringify either way.\n return Object.fromEntries(Object.entries(rebuilt)\n .filter(([, nested]) => !stripNullish || nested != null)\n .sort(([a], [b]) => a.localeCompare(b)));\n }\n if (value && typeof value === \"object\") {\n // Non-plain instances (Effect, Layer, Context, SDK objects) never\n // canonicalize — walking them is unsafe (cyclic on effect\n // ≥4.0.0-beta.103 — #1082) and comparing them is meaningless.\n return undefined;\n }\n return value;\n};\n/**\n * Deterministic ordering for binding rows.\n *\n * Bindings are registered by concurrently-built layers (a Function/Worker's\n * capability layers run real IO — bundling, fs — before calling `host.bind`),\n * so the registration order of `stack.bindings[fqn]` is not stable across\n * deploys. `diffBindings` itself is sid-keyed and order-insensitive, but the\n * row order flows into provider `diff`/`reconcile` inputs and persisted\n * state — any consumer that hashes or deep-compares the binding array (e.g.\n * a metadata hash over bindings) would churn on registration-order flips.\n * Sorting by `sid` at every boundary makes binding rows stable.\n */\nconst bySid = (a, b) => a.sid < b.sid ? -1 : a.sid > b.sid ? 1 : 0;\nexport const sortBindings = (bindings) => [...bindings].sort(bySid);\n/**\n * Collapse bindings that share the same `sid`, keeping the last occurrence,\n * and return them in deterministic (sid-sorted) order.\n *\n * The same binding can be recorded more than once on a target resource — e.g.\n * a KV namespace bound to both a Worker and a Workflow ends up pushed twice to\n * `stack.bindings[fqn]`. `diffBindings` already collapses these implicitly via\n * its `Map` keyed by `sid`, so the `reconcile` path never observes duplicates.\n * Use this helper to give a provider's `diff` handler the same de-duplicated\n * binding set, keeping plan-time hashing consistent with deploy-time.\n */\nexport const dedupeBindings = (bindings) => sortBindings(Array.from(new Map(bindings.map((b) => [b.sid, b])).values()));\nexport const diffBindings = (oldBindings, newBindings) => {\n const oldMap = new Map(oldBindings.map((b) => [b.sid, b]));\n const newMap = new Map(newBindings.map((b) => [b.sid, b]));\n return sortBindings([\n ...Array.from(oldMap)\n .filter(([sid]) => !newMap.has(sid))\n .map(([sid, old]) => ({\n sid,\n action: \"delete\",\n data: old.data,\n })),\n ...Array.from(newMap).map(([sid, binding]) => {\n const old = oldMap.get(sid);\n return {\n sid,\n action: (!old\n ? \"create\"\n : havePropsChanged(old.data, binding.data)\n ? \"update\"\n : \"noop\"),\n data: binding.data,\n };\n }),\n ]);\n};\n//# sourceMappingURL=Diff.js.map","import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\n/** A 16-byte (128-bit) random hex-encoded string representing an physical instance of a logical resource */\nexport class InstanceId extends Context.Service()(\"instance-id\") {\n}\n/**\n * @returns Hex-encoded instance ID (16 random bytes)\n */\nexport const generateInstanceId = () => Effect.sync(() => {\n const bytes = new Uint8Array(16);\n crypto.getRandomValues(bytes);\n return Array.from(bytes)\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\");\n});\n//# sourceMappingURL=InstanceId.js.map","import * as Deferred from \"effect/Deferred\";\nimport * as Effect from \"effect/Effect\";\nimport * as Fiber from \"effect/Fiber\";\nimport * as Scope from \"effect/Scope\";\n/**\n * A lazily evaluated, memoized effect whose computation runs in a fiber of\n * its own, owned by `scope`.\n *\n * `Effect.cached` evaluates on the fiber of whichever caller gets there\n * first. When that caller is interrupted while others are waiting — a\n * concurrent plan cancelling sibling diffs — every waiter fails\n * interrupt-only and the cache stays poisoned for the rest of the process.\n * A computation that many fibers share must not have that failure mode: here\n * it runs detached from every caller, so interrupting a waiter never touches\n * it, and only closing `scope` cancels it (its waiters then see the\n * interruption, as they should).\n *\n * Requirements are captured from the first caller, exactly as\n * `Effect.cached` does.\n */\nexport const cachedInScope = (scope) => (effect) => Effect.gen(function* () {\n const context = yield* Effect.context();\n const deferred = yield* Deferred.make();\n let started = false;\n return Effect.suspend(() => {\n if (started)\n return Deferred.await(deferred);\n started = true;\n return effect.pipe(Effect.provideContext(context), \n // `onExit` also runs on interruption, so the waiters always learn\n // how the computation ended.\n Effect.onExit((exit) => Deferred.done(deferred, exit)), \n // Not a child of the caller: the caller's interruption must not\n // reach it. The scope owns its lifetime instead.\n Effect.forkDetach, Effect.flatMap((fiber) => Scope.addFinalizer(scope, Fiber.interrupt(fiber))), Effect.andThen(Deferred.await(deferred)));\n });\n});\n//# sourceMappingURL=Memoize.js.map","import * as Effect from \"effect/Effect\";\nexport const assertDefined = (value, message) => {\n if (!value) {\n throw new Error(message);\n }\n return value;\n};\nexport const asEffect = (effect) => typeof effect?.asEffect === \"function\"\n ? effect.asEffect()\n : Effect.isEffect(effect)\n ? effect\n : Effect.succeed(effect);\n//# sourceMappingURL=types.js.map","import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport { makeCaptureContext } from \"./ActionRuntimeContext.js\";\nimport { toFqn } from \"./FQN.js\";\nimport { CurrentNamespace } from \"./Namespace.js\";\nimport * as Output from \"./Output.js\";\nimport { RuntimeContext } from \"./RuntimeContext.js\";\nimport { Stack } from \"./Stack.js\";\nexport const isAction = (value) => typeof value === \"object\" && value !== null && value?.Kind === \"action\";\nexport function Action(...args) {\n if (args.length === 0) {\n // Tagged form: Action<Self, In, Out>()(type)\n return (type) => makeActionClass(type, undefined);\n }\n // Inline form: Action(type, runnerOrInit)\n const [type, initOrRun] = args;\n return makeActionClass(type, initOrRun);\n}\nconst isRunnerEffect = (v) => Effect.isEffect(v);\nconst makeActionClass = (type, baked) => {\n // Pre-resolve baked init/runner into a single Effect<Runner, _, Req>. Use\n // Effect.cached so the init's body runs at most once per process — every\n // action instance after the first reuses the resolved runner without paying\n // the init cost (or re-yielding its dependencies).\n let resolveRunner;\n if (baked !== undefined) {\n resolveRunner = isRunnerEffect(baked)\n ? Effect.runSync(Effect.cached(baked))\n : Effect.succeed(baked);\n }\n // Tagged form needs a Context tag so the user can supply the runner\n // through a Layer. Inline form bakes the runner in and skips the tag.\n const SelfTag = baked\n ? undefined\n : Context.Service(`alchemy/Action<${type}>`);\n // Outputs referenced via `yield* output` inside the init Effect land here,\n // recorded by the capture RuntimeContext. Shared per definition — the init\n // runs at most once (Effect.cached), so captures are inherently\n // per-definition, matching how the init's `Req` bubbles per definition.\n const captures = {};\n const captureContext = makeCaptureContext(captures);\n const constructor = (...args) => {\n const [id, input] = args.length === 1 ? [type, args[0]] : args;\n return Effect.gen(function* () {\n const run = resolveRunner\n ? yield* resolveRunner.pipe(Effect.provideService(RuntimeContext, captureContext))\n : (yield* SelfTag);\n return yield* registerAction(type, id, input, run, captures);\n });\n };\n const extra = { Type: type };\n if (SelfTag) {\n extra.Self = SelfTag;\n // `.make(initOrRun)` — accepts either a direct runner or an init Effect.\n // For init form we use `Layer.effect` so the init's Req surfaces on the\n // Layer, and run it under the capture RuntimeContext so `yield* output`\n // accessors are recorded just like the inline form; for runners we use\n // `Layer.succeed` (nothing to capture).\n extra.make = (initOrRun) => isRunnerEffect(initOrRun)\n ? Layer.effect(SelfTag, initOrRun.pipe(Effect.provideService(RuntimeContext, captureContext)))\n : Layer.succeed(SelfTag, initOrRun);\n }\n return Object.assign(constructor, extra);\n};\nconst registerAction = (type, id, input, run, captures) => Effect.gen(function* () {\n const stack = yield* Stack;\n const namespace = yield* CurrentNamespace;\n const fqn = toFqn(namespace, id);\n const actions = (stack.actions ??= {});\n const existing = actions[fqn];\n if (existing)\n return Output.of(existing);\n // FQN collision check: actions share the same FQN namespace as resources\n // so the dependency graph stays unified. Rejecting overlaps here makes\n // the constraint obvious at registration time.\n if (stack.resources[fqn]) {\n return yield* Effect.die(new Error(`Action '${fqn}' collides with a Resource of the same logical id`));\n }\n const target = {\n Kind: \"action\",\n Type: type,\n Namespace: namespace,\n FQN: fqn,\n LogicalId: id,\n Input: input,\n Captures: captures,\n Run: run,\n Output: undefined,\n };\n target.toString = () => `Action<${type}>(${id})`;\n actions[fqn] = target;\n // `yield* Sync({...})` returns `Output<Out>`. The engine writes the\n // materialized value into `tracker[fqn]` during apply; `Output.of(action)`\n // resolves a ResourceExpr by looking up `outputs[fqn]` — which is\n // precisely that materialized value. Property access into the returned\n // Output chains through the standard PropExpr proxy.\n return Output.of(target);\n});\n//# sourceMappingURL=Action.js.map","import * as Duration from \"effect/Duration\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Metric from \"effect/Metric\";\n/**\n * Counter for resource lifecycle operations. Tagged per call with\n * `resource_type`, `op` (`precreate`/`create`/`update`/`delete`/`read`),\n * and `status` (`success`/`error`).\n */\nexport const resourceCounter = Metric.counter(\"alchemy.resource.operations\", {\n description: \"Number of resource lifecycle operations dispatched by alchemy apply.\",\n incremental: true,\n});\n/**\n * Histogram of how long each lifecycle operation takes.\n */\nexport const resourceDuration = Metric.timer(\"alchemy.resource.duration\", {\n description: \"Wall-clock duration of resource lifecycle operations dispatched by alchemy apply.\",\n});\n/**\n * Counter for CLI command invocations.\n */\nexport const cliCounter = Metric.counter(\"alchemy.cli.invocations\", {\n description: \"Number of alchemy CLI command invocations.\",\n incremental: true,\n});\n/**\n * Counter for Cloudflare State Store bootstrap/deploy operations.\n * Tagged per call with `op` (e.g. `deploy`) and `status`\n * (`success`/`error`) so that the deploy success rate of the\n * state store itself can be tracked separately from regular\n * resource lifecycle ops.\n */\nexport const stateStoreCounter = Metric.counter(\"alchemy.state_store.operations\", {\n description: \"Number of Cloudflare State Store deploy/bootstrap operations dispatched by alchemy.\",\n incremental: true,\n});\n/**\n * Counter for State store layer construction. Tagged with `id` (the\n * `StateService.id` slug) so we can answer \"how many distinct projects\n * are using each backend\" from the corresponding `state_store.init`\n * spans. Open-ended on purpose: third-party state stores get counted\n * automatically by setting their `StateService.id`.\n */\nexport const stateStoreInitCounter = Metric.counter(\"alchemy.state_store.inits\", {\n description: \"Number of times a State store layer is constructed.\",\n incremental: true,\n});\n/**\n * Wraps a resource lifecycle Effect to record a counter + timer entry,\n * tagged with `resource_type`, `op`, and `status` (`success`/`error`).\n *\n * Usage:\n * ```ts\n * provider.reconcile(input).pipe(recordResourceOp(node.resource.Type, \"create\"))\n * ```\n */\nexport const recordResourceOp = (resourceType, op) => (self) => Effect.suspend(() => {\n const startNs = process.hrtime.bigint();\n const baseAttrs = { resource_type: resourceType, op };\n return self.pipe(Effect.onExit((exit) => recordOutcome(baseAttrs, Exit.isSuccess(exit) ? \"success\" : \"error\", elapsed(startNs))));\n});\n/**\n * Wraps a CLI command Effect to bump {@link cliCounter} with the\n * outcome (`success`/`error`).\n */\nexport const recordCli = (command) => (self) => self.pipe(Effect.onExit((exit) => Metric.update(Metric.withAttributes(cliCounter, {\n command,\n status: Exit.isSuccess(exit) ? \"success\" : \"error\",\n}), 1)));\n/**\n * Wraps a Cloudflare State Store deploy/bootstrap Effect to bump\n * {@link stateStoreCounter} with the outcome (`success`/`error`),\n * tagged with the given `op`.\n */\nexport const recordStateStoreOp = (op) => (self) => self.pipe(Effect.onExit((exit) => Metric.update(Metric.withAttributes(stateStoreCounter, {\n op,\n status: Exit.isSuccess(exit) ? \"success\" : \"error\",\n}), 1)));\n/**\n * Wraps a State store construction Effect to:\n *\n * 1. Bump {@link stateStoreInitCounter} tagged with `id`.\n * 2. Open a `state_store.init` span carrying\n * `alchemy.state_store.id` so Axiom (which can't query metric\n * datasets via APL) can group projects by backend.\n *\n * The `id` is read off the constructed `StateService.id` field, so any\n * third-party state-store implementation gets tracked just by setting\n * a stable slug there. Apply at every `Layer.effect(State, …)` site\n * exactly once.\n */\nexport const recordStateStoreInit = (self) => \n// The debug lines bracket the first phase of a deploy that can block on\n// credential resolution (see `Auth/Lock.ts`). Without them a stalled\n// deploy produces no output at all, at any log level, and there is\n// nothing to tell \"hung\" apart from \"slow\".\nEffect.logDebug(\"state store: initializing\").pipe(Effect.andThen(self), Effect.tap((service) => Effect.all([\n Effect.logDebug(`state store: ready (${service.id})`),\n Metric.update(Metric.withAttributes(stateStoreInitCounter, { id: service.id }), 1),\n Effect.annotateCurrentSpan(\"alchemy.state_store.id\", service.id),\n], { discard: true })), Effect.withSpan(\"state_store.init\"));\nconst elapsed = (startNs) => Duration.nanos(process.hrtime.bigint() - startNs);\nconst recordOutcome = (baseAttrs, status, duration) => {\n const attrs = { ...baseAttrs, status };\n return Effect.all([\n Metric.update(Metric.withAttributes(resourceCounter, attrs), 1),\n Metric.update(Metric.withAttributes(resourceDuration, attrs), duration),\n ], { discard: true });\n};\n//# sourceMappingURL=Metrics.js.map","/**\n * Compute the strongly-connected components of a directed graph.\n *\n * Components are emitted in Tarjan completion order — the reverse\n * topological order of the condensation, so a component appears before\n * every component that has an edge into it.\n *\n * Implementation is iterative Tarjan's algorithm to avoid blowing the JS\n * call stack on very wide graphs.\n */\nexport const stronglyConnectedComponents = (nodes, successors) => {\n const output = [];\n let index = 0;\n const indexOf = new Map();\n const lowlink = new Map();\n const onStack = new Set();\n const stack = [];\n const callStack = [];\n const startNode = (node) => {\n indexOf.set(node, index);\n lowlink.set(node, index);\n index += 1;\n stack.push(node);\n onStack.add(node);\n callStack.push({ node, children: [...successors(node)], childIdx: 0 });\n };\n for (const root of nodes) {\n if (indexOf.has(root))\n continue;\n startNode(root);\n while (callStack.length > 0) {\n const frame = callStack[callStack.length - 1];\n if (frame.childIdx < frame.children.length) {\n const child = frame.children[frame.childIdx];\n frame.childIdx += 1;\n if (!indexOf.has(child)) {\n startNode(child);\n continue;\n }\n if (onStack.has(child)) {\n lowlink.set(frame.node, Math.min(lowlink.get(frame.node), indexOf.get(child)));\n }\n continue;\n }\n // All children processed: maybe close an SCC.\n if (lowlink.get(frame.node) === indexOf.get(frame.node)) {\n const scc = [];\n for (;;) {\n const w = stack.pop();\n onStack.delete(w);\n scc.push(w);\n if (w === frame.node)\n break;\n }\n output.push(scc);\n }\n // Pop frame and propagate lowlink up to the parent.\n callStack.pop();\n const parent = callStack[callStack.length - 1];\n if (parent) {\n const cur = lowlink.get(parent.node);\n const childLow = lowlink.get(frame.node);\n if (childLow < cur)\n lowlink.set(parent.node, childLow);\n }\n }\n }\n return output;\n};\n/**\n * Compute the set of graph nodes that participate in a dependency cycle.\n *\n * A node is considered \"in a cycle\" iff it sits in a strongly-connected\n * component (SCC) of size > 1, or has a self-edge (size-1 SCC that loops\n * back to itself).\n */\nexport const findCycleMembers = (edges) => {\n const cycleMembers = new Set();\n for (const scc of stronglyConnectedComponents(Object.keys(edges), (node) => edges[node] ?? [])) {\n if (scc.length > 1) {\n for (const fqn of scc)\n cycleMembers.add(fqn);\n }\n else {\n // Size-1 SCC: only counts as a cycle if it has a self-edge.\n const only = scc[0];\n if ((edges[only] ?? []).includes(only)) {\n cycleMembers.add(only);\n }\n }\n }\n return cycleMembers;\n};\n//# sourceMappingURL=scc.js.map","import * as Effect from \"effect/Effect\";\nimport { stableValue } from \"./stable.js\";\nexport const sha256 = (input) => Effect.promise(async () => {\n const digest = await crypto.subtle.digest(\"SHA-256\", toArrayBuffer(input));\n const hashArray = Array.from(new Uint8Array(digest));\n return hashArray.map((b) => b.toString(16).padStart(2, \"0\")).join(\"\");\n});\nexport const sha256Object = (input) => sha256(JSON.stringify(stableValue(input)));\n/**\n * Stable sha256 hex digest of a resolved Task input. Unlike\n * {@link sha256Object} this does not stabilize key ordering — it hashes the\n * raw `JSON.stringify(input ?? null)` so identical inputs map to identical\n * hashes for caching/equality checks.\n */\nexport const hashInput = (input) => sha256(JSON.stringify(input ?? null));\nconst toArrayBuffer = (input) => {\n if (input instanceof ArrayBuffer) {\n return input;\n }\n if (typeof input === \"string\") {\n return new TextEncoder().encode(input);\n }\n return input.buffer.slice(input.byteOffset, input.byteOffset + input.byteLength);\n};\n//# sourceMappingURL=sha256.js.map","/** @effect-diagnostics anyUnknownInErrorContext:off */\n/** @effect-diagnostics missingEffectError:off */\nimport * as Cause from \"effect/Cause\";\nimport * as Config from \"effect/Config\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Option from \"effect/Option\";\nimport * as Ref from \"effect/Ref\";\nimport { cachedInScope } from \"./Util/Memoize.js\";\nimport { asEffect } from \".//Util/types.js\";\nimport { isAction } from \"./Action.js\";\nimport { AdoptPolicy, OwnedBySomeoneElse, stripUnowned, Unowned, } from \"./AdoptPolicy.js\";\nimport { AlchemyContext } from \"./AlchemyContext.js\";\nimport { demandRemoteCredentials } from \"./Auth/Demand.js\";\nimport { Artifacts, ArtifactStore, createArtifactStore, ensureArtifactStore, makeScopedArtifacts, } from \"./Artifacts.js\";\nimport { dedupeBindings, diffBindings, havePropsChanged, isResolved, } from \"./Diff.js\";\nimport { parseFqn } from \"./FQN.js\";\nimport { generateInstanceId, InstanceId } from \"./InstanceId.js\";\nimport * as Output from \"./Output.js\";\nimport { tryFindProviderRegistrationByType, missingProviderError, Provider, providerForMode, tryFindProviderByType, } from \"./Provider.js\";\nimport { defaultProviderMode, stampedMode, } from \"./ProviderMode.js\";\nimport { Progress, } from \"./Report.js\";\nimport { isResource, missingImplementation, } from \"./Resource.js\";\nimport {} from \"./Stack.js\";\nimport { isActionState, State, } from \"./State/index.js\";\nimport { isPlainData, mapPlainData } from \"./Util/data.js\";\nimport { findCycleMembers } from \"./Util/scc.js\";\nimport { hashInput } from \"./Util/sha256.js\";\nconst describeBinding = (binding) => ({\n sid: binding.sid,\n action: binding.action,\n});\n/** The serializable row view of one resource node (see {@link describePlan}). */\nexport const describeResource = (node) => ({\n fqn: node.resource.FQN,\n logicalId: node.resource.LogicalId,\n resourceType: node.resource.Type,\n action: node.action,\n bindings: node.bindings.map(describeBinding),\n providerMode: node.mode,\n fromProviderMode: node.action === \"replace\" &&\n node.mode !== undefined &&\n node.state.providerMode !== undefined &&\n node.state.providerMode !== node.mode\n ? node.state.providerMode\n : undefined,\n});\n/** The serializable row view of one stack-action node. */\nexport const describeAction = (node) => ({\n fqn: node.def.FQN,\n logicalId: node.def.LogicalId,\n actionType: node.def.Type,\n action: node.action,\n});\n/**\n * Serializable per-row views of a plan — everything a renderer or remote\n * consumer needs without holding the native plan: resource rows with their\n * bindings and provider modes, orphan deletions, and stack actions.\n */\nexport const describePlan = (plan) => ({\n resources: [\n ...Object.values(plan.resources),\n ...Object.values(plan.deletions).filter((node) => node !== undefined),\n ].map(describeResource),\n actions: [\n ...Object.values(plan.actions ?? {}),\n ...Object.values(plan.actionDeletions ?? {}),\n ]\n .filter((node) => node !== undefined)\n .map(describeAction),\n});\nexport const make = (stack, options = {}) => \n// @ts-expect-error\nEffect.gen(function* () {\n // Per-resource plan progress and phase markers are reported through\n // the ambient Progress reporter as the work happens, so a renderer can show\n // plan computation while it runs. The default reporter is a no-op.\n const reportPlanned = yield* Progress;\n // Resolving the state service may bootstrap a remote store, and the\n // persisted-row snapshot below reads from it — both are \"loading state\".\n yield* reportPlanned({ _tag: \"plan.phase\", phase: \"loading-state\" });\n const state = yield* yield* State;\n const resources = Object.values(stack.resources);\n const actions = Object.values(stack.actions ?? {});\n // A bare platform tag yields a forward reference registered with\n // `undefined` props (and `RequiresImplementation`); its `.make(props,\n // impl)` Layer repairs the props when it builds (in either order — the\n // #874 circular env-tag pattern). Props still `undefined` after the\n // whole program evaluated means the tag was yielded but its Layer was\n // never provided — fail fast naming the class and its Layer instead of\n // letting a provider read `undefined` props (#1054). Plain resources\n // may legitimately be yielded without props (a reference to\n // already-deployed state), so the check is scoped to platform tags.\n for (const resource of resources) {\n if (resource.RequiresImplementation && resource.Props === undefined) {\n yield* Effect.die(missingImplementation(resource.Type, resource.LogicalId));\n }\n }\n // TODO(sam): rename terminology to Stack\n const stackName = stack.name;\n const stage = stack.stage;\n // Resolve the effective adoption setting for this plan. AdoptPolicy\n // (provided by the CLI or scoped via `adopt(...)`) takes precedence; if\n // unset, fall back to the AlchemyContext's `adopt` default; otherwise\n // adoption is disabled.\n const shouldAdopt = Effect.gen(function* () {\n const fromService = yield* Effect.serviceOption(AdoptPolicy);\n if (Option.isSome(fromService))\n return fromService.value;\n const ctx = yield* Effect.serviceOption(AlchemyContext);\n return Option.match(ctx, {\n onNone: () => false,\n onSome: (c) => c.adopt,\n });\n });\n // The run-level default provider mode (`alchemy dev` → \"local\",\n // `alchemy deploy` → \"live\"). A resource-scoped `remote()` (captured on\n // the resource at registration as `Mode`) opts out of local emulation.\n const runDefaultMode = yield* defaultProviderMode;\n /**\n * Resolve the effective provider mode and the concrete provider\n * service for a resource.\n *\n * The mode only \"sticks\" when the provider actually distinguishes\n * modes (registered via `ProviderLayer.dual`). Mode-agnostic providers\n * satisfy any requested mode with their single implementation — in a\n * dev run, a construct that mixes emulatable resources with live-only\n * ones (e.g. R2 buckets) just works.\n */\n const resolveProviderAndMode = Effect.fn(function* (resource) {\n const base = yield* tryFindProviderRegistrationByType(resource.Type).pipe(Effect.flatMap(Option.match({\n onNone: () => Effect.die(`Provider not found for ${resource.Type}`),\n onSome: Effect.succeed,\n })));\n const mode = base.modes !== undefined\n ? (resource.Mode ?? runDefaultMode)\n : undefined;\n const provider = yield* providerForMode(base, mode);\n return { provider, mode };\n });\n // Credential-free dev: the adoption probe below runs each new row's\n // `read` — for `Alchemy.remote()` rows that is a real cloud call, and\n // it happens before apply's demand gate. Demand those credentials up\n // front so a dev plan with nothing configured fails with the typed\n // CredentialsRequired rather than the first read's raw auth error.\n if (runDefaultMode === \"local\") {\n const remote = [];\n for (const resource of resources) {\n const { mode } = yield* resolveProviderAndMode(resource);\n if (mode === \"live\")\n remote.push(resource);\n }\n if (remote.length > 0)\n yield* demandRemoteCredentials(remote);\n }\n /**\n * Has this resource switched provider modes since it was last\n * reconciled? Rows without a persisted mode were written by a\n * pre-provider-mode engine (or a provider that only became dual-mode\n * later) — their physical resource is LIVE unless its attrs carry a\n * `dev:` identity marker proving it was reconciled locally (see\n * {@link stampedMode}). A dev run replaces unstamped live rows exactly\n * like stamped live rows; live runs replace unstamped marker rows.\n */\n const hasModeSwitched = (mode, oldState) => mode !== undefined &&\n oldState !== undefined &&\n stampedMode(oldState) !== mode;\n const resourceFqns = yield* state.list({\n stack: stackName,\n stage: stage,\n });\n const oldResources = yield* Effect.all(resourceFqns.map((fqn) => state.get({ stack: stackName, stage: stage, fqn })), { concurrency: \"unbounded\" });\n // Snapshot of every persisted row, keyed by FQN. The rename resolution\n // below reads from this map instead of issuing per-FQN `state.get`s —\n // every renamedFrom-decorated resource (each StaticSite carries one\n // forever) would otherwise add two round-trips per resource to every\n // plan against a remote state store. Plan is read-only, so the\n // snapshot cannot go stale within this run.\n const persistedRows = new Map(resourceFqns.map((fqn, i) => [fqn, oldResources[i]]));\n yield* reportPlanned({ _tag: \"plan.phase\", phase: \"computing-plan\" });\n // ── FQN renames ──────────────────────────────────────────────────────\n // Map every former FQN claimed via `renamedFrom(...)` to its claimant's\n // current FQN. Two resources claiming the same former FQN is ambiguous\n // and fatal. A former FQN MAY still be actively declared — that is the\n // \"old id reused by a new resource\" case: the rename claim wins the\n // row (it is an explicit user statement that the row was theirs), and\n // the reusing resource plans a fresh create.\n const formerFqnClaims = new Map();\n for (const resource of resources) {\n for (const formerFqn of resource.FormerFqns ?? []) {\n if (formerFqn === resource.FQN)\n continue;\n const claimant = formerFqnClaims.get(formerFqn);\n if (claimant !== undefined && claimant !== resource.FQN) {\n return yield* Effect.die(new Error(`Resources '${claimant}' and '${resource.FQN}' both claim ` +\n `former FQN '${formerFqn}' via renamedFrom(...). A former ` +\n \"FQN can migrate to exactly one resource — remove the \" +\n \"decoration from one of them.\"));\n }\n formerFqnClaims.set(formerFqn, resource.FQN);\n }\n }\n // Resolve every rename migration up-front against the state snapshot,\n // BEFORE any node is built — other resources' planning depends on the\n // outcome (a resource declared at a former FQN whose row is migrating\n // away must start from scratch).\n //\n // For each renamer, in former-id declaration order (most recent\n // first):\n //\n // - `source` is the row that defines the resource's physical identity:\n // the row at its own FQN when present AND type-matching, otherwise\n // the first type-matching former row (→ `moved`).\n // - every OTHER type-matching former row sharing `source.instanceId`\n // is a leftover from an interrupted migration (only migration copies\n // instanceIds) — collected for state-only cleanup.\n // - former rows with a different instanceId belong to someone else and\n // are left to normal orphan handling; former rows with a different\n // resourceType (modulo registered type-aliases) can never be this\n // resource's row and are skipped entirely.\n // - a FOREIGN-typed row at the renamer's own FQN blocks the migration\n // fatally: landing the migrated row there would silently abandon\n // that row's cloud resource.\n const renameMigrations = new Map();\n const migratedRowFqns = new Set();\n const resolveRenamer = Effect.fn(function* (resource) {\n const provider = Option.getOrUndefined(yield* tryFindProviderRegistrationByType(resource.Type));\n const allowedTypes = new Set([\n resource.Type,\n ...(provider?.aliases ?? []),\n ]);\n const persisted = persistedRows.get(resource.FQN);\n const persistedRow = isActionState(persisted)\n ? undefined\n : persisted;\n // A row at this resource's own FQN that a PREVIOUSLY RESOLVED\n // renamer claimed (a same-deploy shift: A→B while B→C — C took the\n // row at B) is moving away: it is not ours to keep and it does not\n // block the migration landing here.\n const rowTaken = migratedRowFqns.has(resource.FQN);\n const ownRow = !rowTaken &&\n persistedRow !== undefined &&\n allowedTypes.has(persistedRow.resourceType)\n ? persistedRow\n : undefined;\n let source = ownRow;\n let adopted = ownRow;\n const renamedFrom = [];\n for (const formerFqn of resource.FormerFqns) {\n if (formerFqnClaims.get(formerFqn) !== resource.FQN)\n continue;\n // The same former id may be listed twice (or resolve identically);\n // collect each former row once.\n if (renamedFrom.includes(formerFqn))\n continue;\n const formerPersisted = persistedRows.get(formerFqn);\n if (formerPersisted === undefined || isActionState(formerPersisted)) {\n continue;\n }\n const formerRow = formerPersisted;\n if (!allowedTypes.has(formerRow.resourceType))\n continue;\n if (source === undefined) {\n source = formerRow;\n adopted = {\n ...formerRow,\n fqn: resource.FQN,\n logicalId: resource.LogicalId,\n namespace: resource.Namespace,\n };\n renamedFrom.push(formerFqn);\n }\n else if (source.instanceId === formerRow.instanceId) {\n renamedFrom.push(formerFqn);\n }\n }\n if (renamedFrom.length === 0)\n return;\n if (persistedRow !== undefined && ownRow === undefined && !rowTaken) {\n return yield* Effect.die(new Error(`Cannot migrate '${renamedFrom[0]}' to '${resource.FQN}': a ` +\n `state row of a different type ('${persistedRow.resourceType}') ` +\n `already occupies '${resource.FQN}'. Migrating over it would ` +\n \"silently abandon that row's cloud resource. Delete or \" +\n \"rename the conflicting resource first, then re-deploy.\"));\n }\n renameMigrations.set(resource.FQN, {\n row: adopted,\n renamedFrom,\n moved: adopted !== ownRow,\n });\n for (const formerFqn of renamedFrom)\n migratedRowFqns.add(formerFqn);\n });\n // Resolve renamers in claim-dependency order: when resource R's OWN\n // FQN is claimed as a former id by resource S (a same-deploy shift:\n // A→B while B→C), S must resolve first — whether S takes R's row\n // decides whether R still owns it, or falls back to ITS former rows.\n // Iterate to fixpoint; anything left is a claim CYCLE (a swap: A⇄B),\n // which cannot be persisted safely — the migrations would overwrite\n // and delete each other's rows — and dies loudly.\n let pendingRenamers = resources.filter((r) => r.FormerFqns?.length);\n const resolvedRenamers = new Set();\n while (pendingRenamers.length > 0) {\n const ready = pendingRenamers.filter((resource) => {\n const claimant = formerFqnClaims.get(resource.FQN);\n return claimant === undefined || resolvedRenamers.has(claimant);\n });\n if (ready.length === 0) {\n return yield* Effect.die(new Error(`Rename cycle detected among [${pendingRenamers\n .map((r) => `'${r.FQN}'`)\n .join(\", \")}]: their renamedFrom(...) declarations claim each other's ` +\n \"FQNs. Swapping ids in one deploy is not supported — rename \" +\n \"through a temporary id across two deploys instead.\"));\n }\n for (const resource of ready) {\n yield* resolveRenamer(resource);\n resolvedRenamers.add(resource.FQN);\n }\n pendingRenamers = pendingRenamers.filter((r) => !resolvedRenamers.has(r.FQN));\n }\n /**\n * Fetch the persisted row for a declared resource, resolving renames\n * (see the pre-computed `renameMigrations` above):\n *\n * - a renamer plans from its migrated row (`renamedFrom` rides onto\n * the plan node; apply persists the move before any lifecycle op)\n * - a resource declared at a former FQN whose row is migrating away\n * starts from scratch — the row is NOT its state, whatever the FQN\n * says\n */\n const getPersistedRow = Effect.fn(function* (resource) {\n const migration = renameMigrations.get(resource.FQN);\n if (migration !== undefined) {\n return {\n row: migration.row,\n renamedFrom: migration.renamedFrom,\n renameMoved: migration.moved,\n };\n }\n const persisted = yield* state.get({\n stack: stackName,\n stage: stage,\n fqn: resource.FQN,\n });\n const row = isActionState(persisted)\n ? undefined\n : persisted;\n if (row !== undefined && migratedRowFqns.has(resource.FQN)) {\n return { row: undefined, renamedFrom: undefined, renameMoved: false };\n }\n return { row, renamedFrom: undefined, renameMoved: false };\n });\n // Shared resolutions run in fibers of the plan's own scope (see\n // `cachedInScope`): a diff that fails or is cancelled must not take the\n // resolution every other diff is waiting on down with it.\n const memoScope = yield* Effect.scope;\n const resolvedResources = {};\n const resolveResource = (resourceExpr) => Effect.gen(function* () {\n // Tasks share the ResourceExpr machinery but have no provider /\n // stable-properties story at plan time. Leave the expression\n // unsubstituted — Apply resolves it from the tracker at run time.\n if (isAction(resourceExpr.src)) {\n return resourceExpr;\n }\n // @ts-expect-error\n return yield* (resolvedResources[resourceExpr.src.FQN] ??=\n yield* cachedInScope(memoScope)(Effect.gen(function* () {\n const resource = resourceExpr.src;\n const { provider, mode } = yield* resolveProviderAndMode(resource);\n const props = materializeStableRefs(yield* resolveInput(resource.Props));\n // Falls back to the row at a former FQN (`renamedFrom`) so a\n // renamed resource's stable attributes keep flowing to\n // downstream diffs across the migration.\n const { row: oldState } = yield* getPersistedRow(resource);\n if (!oldState || oldState.status === \"creating\") {\n return resourceExpr;\n }\n // The resource is switching provider modes (local ⇄ live):\n // it will be replaced, so nothing about the persisted attrs\n // is stable for downstream consumers.\n if (hasModeSwitched(mode, oldState)) {\n return resourceExpr;\n }\n const oldProps = oldState.status === \"updating\"\n ? oldState.old.props\n : oldState.props;\n // Normalize both sides through `dedupeBindings` so the binding\n // sets handed to `diff` are deduped AND sid-sorted — provider\n // diffs that hash/compare the arrays never churn on\n // registration-order flips (or on legacy unsorted state).\n const oldBindings = dedupeBindings(oldState.bindings ?? []);\n const newBindings = dedupeBindings(stack.bindings[resource.FQN] ?? []);\n const diff = yield* provider.diff\n ? provider\n .diff({\n id: resource.LogicalId,\n fqn: resource.FQN,\n olds: oldProps,\n instanceId: oldState.instanceId,\n news: props,\n output: oldState.attr,\n oldBindings,\n newBindings,\n })\n .pipe(providePlanScope(resource.FQN, oldState.instanceId))\n : Effect.succeed(undefined);\n // A present `diff.stables` is authoritative for this update and\n // overrides `provider.stables`. We only fall back to the\n // provider-level \"always stable\" list when the diff does not\n // return one (e.g. no diff fn, or a diff that omits `stables`).\n const stables = diff?.stables ?? provider.stables ?? [];\n const withStables = (output) => stables.length > 0\n ? new Output.ResourceExpr(resourceExpr.src, Object.fromEntries(stables.map((stable) => [stable, output?.[stable]])))\n : // if there are no stable properties, treat every property as changed\n resourceExpr;\n if (diff == null) {\n if (havePropsChanged(oldProps, props)) {\n // the props have changed but the provider did not provide any hints as to what is stable\n // so we must assume everything has changed\n return withStables(oldState?.attr);\n }\n }\n else if (diff.action === \"update\") {\n return withStables(oldState?.attr);\n }\n else if (diff.action === \"replace\") {\n return resourceExpr;\n }\n // `--force` upgrades this resource's noop to an update (see the\n // diff mapping in the resource-graph pass below), so its\n // `reconcile` WILL re-run and may produce fresh attributes —\n // that is the point of --force. Returning the persisted attr\n // snapshot here would bake potentially-stale values into every\n // consumer's plan props and binding data, so consumers would\n // keep the stale attrs even though the upstream just\n // re-reconciled. Expose only the stable attributes and let\n // apply re-evaluate the rest against the forced reconcile's\n // fresh output.\n if (options.force) {\n return withStables(oldState?.attr);\n }\n if (oldState.status === \"created\" ||\n oldState.status === \"updated\" ||\n oldState.status === \"replaced\") {\n // we can safely return the attributes if we know they have stabilized\n return oldState?.attr;\n }\n else {\n // we must assume the resource doesn't exist if it hasn't stabilized\n return resourceExpr;\n }\n })));\n });\n /**\n * Resolve an input value as far as *truth* permits, keeping everything\n * else evaluable. A whole-resource reference to an updating upstream\n * stays a `ResourceExpr` (its stable attributes riding along): the\n * non-stable attributes are unknown at plan time and MUST be\n * re-evaluated — Apply runs `Output.evaluate(node.props, outputs)`\n * against the upstream's fresh post-reconcile attributes right before\n * `reconcile`. This is the value plan nodes carry; the diff-facing view\n * is derived from it by {@link materializeStableRefs}.\n */\n const resolveInput = (input, \n // Ancestor chain of the current walk. A value that appears on its own\n // ancestor path is a true cycle and is cut to `undefined` (a cycle can\n // never persist or serialize anyway); an immutable per-level set (not\n // a shared visited-set) keeps legitimately-shared diamond references\n // intact and is race-free under `concurrency: \"unbounded\"` (#1082).\n ancestors = new Set()) => Effect.gen(function* () {\n if (!input) {\n return input;\n }\n else if (Output.isExpr(input)) {\n return yield* resolveOutput(input);\n }\n else if (Config.isConfig(input)) {\n // Config is a lazy reference to the deploy environment. Resolve it\n // here so the concrete value flows into diffing/hashing (an opaque\n // Config hashes the same regardless of the underlying value) and so\n // providers receive a resolved value instead of a Config object.\n // `Config.Redacted` resolves to a `Redacted`, which stays opaque via\n // the branch below.\n return yield* resolveInput(yield* input, ancestors);\n }\n else if (isResource(input)) {\n // Resource objects have dynamic properties (path, hash, etc.) that are\n // created on-demand by a Proxy getter and aren't enumerable via Object.entries.\n // Resolve the ResourceExpr to get the actual resource output, then continue\n // resolving any nested outputs in the result.\n const resourceExpr = Output.of(input);\n const resolved = yield* resolveOutput(resourceExpr);\n if (Output.isResourceExpr(resolved)) {\n // Still-unresolved reference (creating, replacing, or updating\n // upstream) — keep it evaluable for Apply.\n return resolved;\n }\n return yield* resolveInput(resolved, ancestors);\n }\n else if (isPlainData(input)) {\n if (ancestors.has(input)) {\n return undefined;\n }\n const nested = new Set(ancestors).add(input);\n if (Array.isArray(input)) {\n return yield* Effect.all(input.map((item) => resolveInput(item, nested)), { concurrency: \"unbounded\" });\n }\n return Object.fromEntries(yield* Effect.all(Object.entries(input).map(([key, value]) => resolveInput(value, nested).pipe(Effect.map((value) => [key, value]))), { concurrency: \"unbounded\" }));\n }\n // Everything else is an opaque leaf returned by identity: Duration,\n // Redacted, Date, and effect runtime values (a Worker's `exports`\n // carries each DO's `constructor` Effect and captured `services`\n // Context). Rebuilding a class instance entry-by-entry would strip\n // its prototype, and effect ≥4.0.0-beta.103's Context is cyclic\n // (#1082). Redacted additionally stays wrapped to preserve the\n // secrecy boundary. This sits after `Config.isConfig` on purpose —\n // Configs are Effects but must still resolve.\n return input;\n });\n /**\n * Project a {@link resolveInput} resolution into the DIFF-facing view:\n * replace each whole-resource `ResourceExpr` that carries stable\n * attributes (an upstream being *updated* in place — see `withStables` in\n * `resolveResource`) with a plain object of those stables, so the known\n * values flow into the consumer's `diff` and `havePropsChanged` instead\n * of the whole reference looking unresolved and `isResolved`\n * short-circuiting (#670 — this forced the Neon `Branch` to hand-extract\n * `project.projectId`).\n *\n * The projection is deliberately lossy — diffs compare VALUES. Plan nodes\n * never carry it: they keep the evaluable resolution so `reconcile` sees\n * the upstream's fresh non-stable attributes (e.g. a Lambda Version's\n * `version` number — #993's alias promotion bug).\n */\n const materializeStableRefs = (input, \n // Ancestor-path cycle guard — see resolveInput (#1082). Sync DFS, so\n // add/delete around the recursion is race-free.\n ancestors = new WeakSet()) => {\n // Expr checks come first: Output proxies are callable, so a plain\n // `typeof input === \"object\"` guard would let them slip through.\n if (Output.isResourceExpr(input) && input.stables) {\n return materializeStableRefs(input.stables, ancestors);\n }\n else if (Output.isExpr(input)) {\n // Genuinely unknown (e.g. a creating upstream) — nothing to show diff.\n return input;\n }\n else if (!input || !isPlainData(input)) {\n // Primitives and non-plain instances (Duration, Redacted, Date,\n // Effect/Layer/Context) are leaves — see isPlainData (#1082).\n return input;\n }\n return mapPlainData(input, ancestors, (child) => materializeStableRefs(child, ancestors));\n };\n const resolveOutput = (expr) => Effect.gen(function* () {\n if (Output.isResourceExpr(expr)) {\n return yield* resolveResource(expr);\n }\n else if (Output.isPropExpr(expr)) {\n const upstream = yield* resolveOutput(expr.expr);\n return upstream?.[expr.identifier];\n }\n else if (Output.isApplyExpr(expr)) {\n const upstream = yield* resolveOutput(expr.expr);\n return Output.hasOutputs(upstream) ? expr : expr.f(upstream);\n }\n else if (Output.isEffectExpr(expr)) {\n const upstream = yield* resolveOutput(expr.expr);\n return Output.hasOutputs(upstream) ? expr : yield* expr.f(upstream);\n }\n else if (Output.isFlatMapExpr(expr)) {\n const upstream = yield* resolveOutput(expr.expr);\n // Source still unresolved -> keep the flatMap intact for a later pass.\n // Otherwise run `f` to produce the next Output and resolve into it.\n return Output.hasOutputs(upstream)\n ? expr\n : yield* resolveOutput(Output.asOutput(expr.f(upstream)));\n }\n else if (Output.isAllExpr(expr)) {\n return yield* Effect.all(expr.outs.map(resolveOutput), {\n concurrency: \"unbounded\",\n });\n }\n else if (Output.isLiteralExpr(expr)) {\n return expr.value;\n }\n else if (Output.isRefExpr(expr)) {\n const refStack = expr.stack ?? stackName;\n const refStage = expr.stage ?? stage;\n const refState = yield* state\n .get({\n stack: refStack,\n stage: refStage,\n fqn: expr.resourceId,\n })\n .pipe(Effect.orDie);\n if (!refState) {\n return yield* Effect.die(new Output.InvalidReferenceError({\n message: `Reference to '${expr.resourceId}' in stack '${refStack}' and stage '${refStage}' not found. Have you deployed '${refStage}' of '${refStack}'?`,\n stack: refStack,\n stage: refStage,\n resourceId: expr.resourceId,\n }));\n }\n return refState.attr ?? refState.output;\n }\n else if (Output.isStackRefExpr(expr)) {\n const refStack = expr.stack;\n const refStage = expr.stage ?? stage;\n const output = yield* state\n .getOutput({\n stack: refStack,\n stage: refStage,\n })\n .pipe(Effect.orDie);\n if (output == null) {\n return yield* Effect.die(new Output.InvalidReferenceError({\n message: `Reference to stack '${refStack}' at stage '${refStage}' not found. Have you deployed stage '${refStage}' of '${refStack}'?`,\n stack: refStack,\n stage: refStage,\n resourceId: refStack,\n }));\n }\n return output;\n }\n else if (Output.isNamedExpr(expr)) {\n return yield* resolveOutput(expr.expr);\n }\n return yield* Effect.die(new Error(\"Not implemented yet\" + expr.kind));\n });\n // map of resource FQN -> its downstream dependencies (resources that depend on it)\n const oldDownstreamDependencies = Object.fromEntries(oldResources\n .filter((resource) => !!resource)\n .map((resource) => [resource.fqn, resource.downstream]));\n // Build a set of FQNs for the new resources to detect orphans\n const newResourceFqns = new Set(resources.map((r) => r.FQN));\n const newActionFqns = new Set(actions.map((t) => t.FQN));\n // Unified set used wherever the DAG must include both kinds.\n const newNodeFqns = new Set([...newResourceFqns, ...newActionFqns]);\n // Map FQN -> list of upstream FQNs (resources this one depends on via props).\n // Tasks contribute upstream edges through their `Input` expression.\n const newUpstreamDependencies = Object.fromEntries([\n ...resources.map((resource) => [\n resource.FQN,\n Object.values(Output.upstreamAny(resource.Props)).map((r) => r.FQN),\n ]),\n ...actions.map((action) => [\n action.FQN,\n // An Action depends on the resources referenced by its Input *and*\n // any Output captured via `yield* output` inside its init Effect.\n Array.from(new Set([\n ...Object.values(Output.upstreamAny(action.Input)).map((r) => r.FQN),\n ...Object.values(Output.upstreamAny(action.Captures)).map((r) => r.FQN),\n ])),\n ]),\n ]);\n // Map FQN -> list of upstream FQNs from bindings\n const bindingUpstreamDependencies = Object.fromEntries(resources.map((resource) => [\n resource.FQN,\n Object.values(Output.upstreamAny(stack.bindings[resource.FQN] ?? [])).map((r) => r.FQN),\n ]));\n // Combined prop + binding upstream for the desired graph, including\n // references to resources outside the current graph so delete validation can\n // tell whether any surviving resource still points at an orphan.\n const rawUpstreamDependencies = Object.fromEntries([\n ...resources.map((resource) => {\n const fqn = resource.FQN;\n const propDeps = newUpstreamDependencies[fqn] ?? [];\n const bindDeps = bindingUpstreamDependencies[fqn] ?? [];\n return [fqn, [...new Set([...propDeps, ...bindDeps])]];\n }),\n // Actions have no bindings — their upstream is input + init captures,\n // both already folded into newUpstreamDependencies above.\n ...actions.map((action) => {\n const fqn = action.FQN;\n return [fqn, newUpstreamDependencies[fqn] ?? []];\n }),\n ]);\n // Combined prop + binding upstream, filtered to resources/tasks in this\n // graph for scheduling and cycle detection.\n const allUpstreamDependencies = Object.fromEntries([\n ...resources.map((resource) => {\n const fqn = resource.FQN;\n const deps = rawUpstreamDependencies[fqn] ?? [];\n return [fqn, deps.filter((dep) => newNodeFqns.has(dep))];\n }),\n ...actions.map((action) => {\n const fqn = action.FQN;\n const deps = newUpstreamDependencies[fqn] ?? [];\n return [fqn, deps.filter((dep) => newNodeFqns.has(dep))];\n }),\n ]);\n // Resources that participate in a cycle when both prop and binding\n // edges are considered. Used below to decide whether an acyclic\n // binding edge should also become a downstream edge.\n const combinedCycleMembers = findCycleMembers(allUpstreamDependencies);\n // Map FQN -> list of downstream FQNs (resources/actions that depend on\n // this one).\n //\n // Prop edges always become downstream edges — they can't form cycles\n // (the resource graph is a DAG by construction once props are fully\n // resolved). Binding edges become downstream edges too, except when\n // they participate in a cycle in the combined graph: mutual bindings\n // (A binds to B's data, B binds to A's data) intentionally do not\n // create downstream edges, so deletion does not deadlock waiting on\n // each other (see the \"binding-only cycles inside a construct\" test\n // in `plan.test.ts`).\n //\n // Including acyclic binding edges is required for cloud APIs that\n // enforce the binding at the provider level — e.g. a Cloudflare\n // Worker with a `service` binding to another Worker cannot delete\n // the upstream worker until the downstream worker's binding has been\n // removed. Without the binding edge in `downstream`, the two delete\n // concurrently and the upstream delete fails with\n // `ServiceBindingConflict`.\n //\n // Actions don't have bindings, so for action upstreams we use only\n // prop edges (which collapse to `newUpstreamDependencies` lookups).\n const computeDownstream = (upFqn) => {\n const downstream = [];\n for (const [downFqn, upstreams] of Object.entries(rawUpstreamDependencies)) {\n if (downFqn === upFqn)\n continue;\n if (!upstreams.includes(upFqn))\n continue;\n const isPropEdge = (newUpstreamDependencies[downFqn] ?? []).includes(upFqn);\n if (isPropEdge) {\n downstream.push(downFqn);\n continue;\n }\n // Binding-only edge — exclude when both endpoints sit inside\n // the same SCC of the combined graph.\n if (combinedCycleMembers.has(upFqn) &&\n combinedCycleMembers.has(downFqn)) {\n continue;\n }\n downstream.push(downFqn);\n }\n return downstream;\n };\n const newDownstreamDependencies = Object.fromEntries([\n ...resources.map((resource) => [resource.FQN, computeDownstream(resource.FQN)]),\n ...actions.map((action) => [action.FQN, computeDownstream(action.FQN)]),\n ]);\n const plannedCount = yield* Ref.make(0);\n const resourcePlanned = (node) => Ref.updateAndGet(plannedCount, (count) => count + 1).pipe(Effect.flatMap((completed) => reportPlanned({\n _tag: \"plan.resource.completed\",\n ...describeResource(node),\n completed,\n total: resources.length,\n })));\n const diffResource = Effect.fn(\"plan.diff.resource\")(function* (resource) {\n const { provider, mode } = yield* resolveProviderAndMode(resource);\n const id = resource.LogicalId;\n const fqn = resource.FQN;\n // Paired with the resource-planned completion below so renderers can\n // show what is actually in flight (diffs may read the cloud and run\n // concurrently — completions alone hide the slow tail).\n yield* reportPlanned({\n _tag: \"plan.resource.started\",\n fqn,\n logicalId: id,\n resourceType: resource.Type,\n total: resources.length,\n });\n // Apply-facing props (stored on the plan node): whole-resource\n // references to updating upstreams stay evaluable `ResourceExpr`s.\n // Apply runs `Output.evaluate(node.props, outputs)` right before\n // `reconcile`, so these references resolve to the upstream's\n // fresh post-reconcile attributes.\n const applyProps = yield* resolveInput(resource.Props);\n // Diff-facing view of the same resolution: stable attributes\n // materialized so their known values flow into `diff` /\n // `havePropsChanged`.\n const news = materializeStableRefs(applyProps);\n const downstream = newDownstreamDependencies[fqn] ?? [];\n // Apply-facing binding rows, mirroring `applyProps`: payloads\n // whose data embeds a whole-resource reference to an updating\n // upstream keep it as an evaluable `ResourceExpr`. Apply runs\n // `Output.evaluate(node.bindings, outputs)` right before\n // `reconcile`, so the host receives the upstream's fresh\n // post-reconcile attributes. Collapse duplicates by sid so the\n // binding set handed to `diff` matches what `reconcile` receives\n // (see `dedupeBindings`).\n const applyBindings = dedupeBindings(yield* resolveInput(stack.bindings[fqn] ?? []));\n // Diff-facing view of the same rows: stable attributes\n // materialized so `diffBindings` / `provider.diff` compare known\n // values. Terminal commits still persist the payload the provider\n // actually reconciled with (#874) — Apply commits the evaluated\n // `bindingOutputs`, not these plan-time shapes.\n const newBindings = materializeStableRefs(applyBindings);\n // The row is looked up at the resource's FQN with a fallback to\n // its former FQNs (`renamedFrom`); a row found under a former\n // FQN arrives here already remapped to the new identity, and\n // `renamedFrom` rides onto the plan node so apply persists the\n // move. (A Task previously holding this FQN is treated as no\n // prior state — its row is reaped by `actionDeletions` below.)\n const { row: persistedRow, renamedFrom, renameMoved, } = yield* getPersistedRow(resource);\n let oldState = persistedRow;\n // Engine-level adoption. When there is no prior state, always\n // consult `provider.read` (if implemented) so the engine — not\n // each lifecycle method — owns the existence/ownership decision.\n //\n // The provider returns one of:\n // - `undefined` → resource doesn't exist; create it\n // - plain attrs → exists and is owned by us; silent adopt\n // - `Unowned(attrs)` → exists but is *not* ours\n //\n // Routing:\n // - owned → adopt the `created` state\n // from attrs and continue\n // through the normal diff\n // path (so subsequent props\n // drift produces an update).\n // - unowned + adopt enabled → take over: adopt the\n // `created` state and let the\n // next update overwrite tags.\n // - unowned + adopt disabled → fail with\n // `OwnedBySomeoneElse`.\n //\n // Plan construction is side-effect-free: the adopted `created`\n // state is only held in-memory here (to drive the diff) and rides\n // onto the plan node as `node.state`. Persisting it to the state\n // store happens exclusively during APPLY of that node (the update\n // lifecycle commits `updating` / `updated` carrying this state).\n // If planning persisted here, a mere `alchemy plan` / `--dry-run`\n // would claim ownership of an unowned cloud resource, arming a\n // later unrelated deploy to orphan-delete it. See\n // https://github.com/alchemy-run/alchemy/issues/793.\n //\n // After a cold-start adoption (engine just discovered an\n // existing cloud resource via `read`), force the engine's\n // normal `update` path so the provider can re-sync ownership\n // tags, configuration, etc. against the desired props.\n // Adoption carries state with `props: news`, so the default\n // diff sees no drift and would noop — which would leave any\n // foreign-owned tags / divergent config in place. Forcing\n // update keeps the deploy idempotent: if cloud state already\n // matches news, the provider's update is a no-op write.\n //\n // Skip the adoption probe entirely when `news` still contains\n // unresolved upstream Outputs (e.g. a `streamArn` referencing\n // a stream being created in the same plan). Calling `read` with\n // an unresolved value would surface as `ParseError` from the\n // SDK protocol layer. Resources whose props depend on\n // not-yet-created upstreams cannot themselves be pre-existing\n // — there's nothing to adopt.\n // A resource declared at a former FQN whose row just migrated\n // away is genuinely NEW by declaration — skip the probe. Its\n // predecessor's physical resource still carries tags branded\n // with THIS logical id (the migrated row's reconcile hasn't\n // re-branded them yet), so a tag-based `read` would find it\n // and silently adopt the very resource that was renamed away.\n const reusesMigratedFqn = migratedRowFqns.has(fqn);\n let forceUpdateAfterAdoption = false;\n if (oldState === undefined &&\n provider.read &&\n isResolved(news) &&\n !reusesMigratedFqn) {\n const adoptInstanceId = yield* generateInstanceId();\n const readResult = yield* provider\n .read({\n id,\n fqn,\n instanceId: adoptInstanceId,\n olds: news,\n output: undefined,\n })\n .pipe(providePlanScope(fqn, adoptInstanceId));\n if (readResult !== undefined) {\n const isUnowned = Unowned.is(readResult);\n // A resource-scoped `adopt(...)` (captured on the resource at\n // registration) overrides the stack/CLI default.\n const adoptThis = resource.Adopt ?? (yield* shouldAdopt);\n if (isUnowned && !adoptThis) {\n return yield* new OwnedBySomeoneElse({\n message: `Cannot adopt resource '${fqn}' (${resource.Type}): ` +\n \"it exists in the cloud but is not owned by this \" +\n \"stack/stage/logical-id. Re-run with `--adopt` (or \" +\n \"wrap the effect in `adopt(true)`) to take it over.\",\n resourceType: resource.Type,\n logicalId: id,\n });\n }\n const adoptedState = {\n status: \"created\",\n fqn,\n logicalId: id,\n instanceId: adoptInstanceId,\n namespace: resource.Namespace,\n resourceType: resource.Type,\n props: news,\n attr: stripUnowned(readResult),\n providerVersion: provider.version ?? 0,\n bindings: [],\n downstream,\n removalPolicy: resource.RemovalPolicy,\n providerMode: mode,\n };\n // In-memory only — do NOT persist here. Plan.make runs for\n // `alchemy plan` / `deploy --dry-run` too, so a `state.set`\n // would mutate persistent state during a read-only preview.\n // The adopted state rides onto the plan node via `oldState`\n // (→ `node.state`) and is persisted at APPLY time by the\n // update lifecycle's `updating` / `updated` commits. See\n // https://github.com/alchemy-run/alchemy/issues/793.\n oldState = adoptedState;\n forceUpdateAfterAdoption = true;\n }\n }\n // Sid-sorted like `newBindings` (see the resolveResource note).\n const oldBindings = dedupeBindings(oldState?.bindings ?? []);\n // Actions come from the materialized comparison (`newBindings`);\n // the payloads the node carries into Apply come from the\n // apply-faithful rows, joined by sid — both are views of the same\n // deduped `stack.bindings[fqn]` rows, so action and payload can\n // never drift. `delete` rows keep the persisted old data.\n const applyBindingData = new Map(applyBindings.map((b) => [b.sid, b.data]));\n const bindingDiffs = diffBindings(oldBindings, newBindings).map((b) => b.action === \"delete\" || !applyBindingData.has(b.sid)\n ? b\n : { ...b, data: applyBindingData.get(b.sid) });\n // Local ⇄ live switch: the persisted row was reconciled by a\n // different provider mode than the one resolved for this run.\n // The two runtimes host distinct physical instances, so this is\n // always a replacement — the new instance is created with the\n // new mode's provider, and Apply deletes the old generation\n // with the provider of the mode that created it (see\n // `deleteOldGenerations` / `collectGarbage`).\n const modeSwitched = hasModeSwitched(mode, oldState);\n const Node = (node) => ({\n ...node,\n provider,\n resource,\n bindings: bindingDiffs,\n downstream,\n mode,\n renamedFrom,\n });\n // Plan against the persisted state we have, not the ideal final state we\n // hoped to reach last time. Recovery is expressed by mapping each\n // intermediate state back onto a fresh CRUD action.\n if (oldState === undefined) {\n return Node({\n action: \"create\",\n props: applyProps,\n state: oldState,\n });\n }\n else if (!modeSwitched &&\n oldState.status === \"creating\" &&\n oldState.attr === undefined) {\n // A create may have succeeded before state persistence failed. If the\n // provider can recover an attribute snapshot, keep driving the same\n // create instead of starting over blindly.\n //\n // `creating` state persists the RAW plan-time props, which may\n // still contain unresolved Output expressions (e.g. a name\n // referencing an upstream created in the same failed deploy).\n // `read` implementations derive identity from `olds` when\n // `output` is undefined (as it is here), so handing them\n // unresolved exprs crashes. Skip the probe — same behavior as\n // a read that found nothing — and re-drive the create.\n if (provider.read && isResolved(oldState.props)) {\n const attr = yield* provider\n .read({\n id,\n fqn,\n instanceId: oldState.instanceId,\n olds: oldState.props,\n output: oldState.attr,\n })\n .pipe(providePlanScope(fqn, oldState.instanceId), \n // `creating` props pass `isResolved` yet can still carry\n // holes where unresolved Outputs were stripped at commit\n // time (see stripUnresolved) — e.g. a parent reference\n // persisted as `{}`. A provider that dereferences one\n // crashes deep inside its SDK client (a SchemaError\n // defect), which would brick every subsequent plan on\n // the stage. Recovery is best-effort: degrade the defect\n // to \"nothing recovered\" and re-drive the create (#995).\n Effect.catchDefect((defect) => Effect.logWarning(`Recovery read for '${fqn}' crashed; treating the ` +\n \"interrupted create as not recoverable and \" +\n \"re-driving it.\", defect).pipe(Effect.as(undefined))));\n if (attr !== undefined) {\n // The recovered resource may be foreign: our interrupted\n // create could have lost a name race, or died before\n // stamping ownership. Route `Unowned` through the same\n // adoption table as the cold-start probe above — never\n // silently take over (and later mutate/delete) a resource\n // we cannot prove we created.\n if (Unowned.is(attr)) {\n const adoptThis = resource.Adopt ?? (yield* shouldAdopt);\n if (!adoptThis) {\n return yield* new OwnedBySomeoneElse({\n message: `Cannot resume creating resource '${fqn}' ` +\n `(${resource.Type}): a resource with its physical ` +\n \"identity exists in the cloud but is not owned by \" +\n \"this stack/stage/logical-id. Re-run with `--adopt` \" +\n \"(or wrap the effect in `adopt(true)`) to take it \" +\n \"over.\",\n resourceType: resource.Type,\n logicalId: id,\n });\n }\n }\n // Continue through the normal diff below with the recovered\n // live snapshot. Desired props may have changed while the\n // previous create was interrupted; bypassing diff here can\n // drive an immutable change through reconcile and falsely\n // persist the old physical resource as converged.\n oldState = { ...oldState, attr: stripUnowned(attr) };\n }\n }\n }\n // Diff against whatever props represent the best-known current attempt.\n // For replacement recovery that means the top-level replacement props,\n // not the older generations stored under `old`.\n const oldProps = oldState.props;\n // On a mode switch the provider diff is skipped entirely:\n // comparing props across runtimes is meaningless (and the new\n // mode's provider has never seen the old mode's state). The\n // action is a replacement by definition.\n const diff = modeSwitched\n ? {\n action: \"replace\",\n deleteFirst: false,\n }\n : yield* asEffect(provider\n ?.diff?.({\n id,\n fqn,\n olds: oldProps,\n instanceId: oldState.instanceId,\n output: oldState.attr,\n news,\n oldBindings,\n newBindings,\n })\n .pipe(providePlanScope(fqn, oldState.instanceId))).pipe(Effect.map((diff) => diff ??\n {\n action: havePropsChanged(oldProps, news) ||\n bindingDiffs.some((b) => b.action !== \"noop\")\n ? \"update\"\n : \"noop\",\n }), Effect.map((diff) => options.force && diff.action === \"noop\"\n ? {\n action: \"update\",\n }\n : diff), \n // After a cold-start adoption (silent or takeover), force at\n // least an update so the provider re-syncs ownership tags /\n // config against the desired props (otherwise the engine\n // would noop and any drift between the existing cloud\n // resource and `news` — including foreign-owned tags after a\n // takeover — would persist).\n //\n // A row that just migrated from a former FQN (`renameMoved`)\n // gets the same treatment: its cloud resource is still\n // branded with the OLD logical id's tags, and if the old id\n // is being reused by a new resource, leaving them stale\n // would let the reuser's future adoption probes match the\n // wrong physical resource.\n Effect.map((diff) => (forceUpdateAfterAdoption || renameMoved) &&\n diff.action === \"noop\"\n ? { action: \"update\" }\n : diff));\n if (oldState.status === \"creating\") {\n if (diff.action === \"noop\") {\n // we're in the creating state and props are un-changed\n // let's just continue where we left off\n return Node({\n action: \"create\",\n props: applyProps,\n state: oldState,\n });\n }\n else if (diff.action === \"update\") {\n // props have changed in a way that is updatable\n // again, just continue with the create\n // TODO(sam): should we maybe try an update instead?\n return Node({\n action: \"create\",\n props: applyProps,\n state: oldState,\n });\n }\n else {\n // props have changed in an incompatible way\n // because it's possible that an un-updatable resource has already been created\n // we must use a replace step to create a new one and delete the potential old one\n return Node({\n action: \"replace\",\n props: applyProps,\n deleteFirst: diff.deleteFirst ?? false,\n state: oldState,\n });\n }\n }\n else if (oldState.status === \"updating\") {\n // Updating already targets the live resource, so noop/update both mean\n // \"finish the interrupted update\". Only a replace diff escalates it\n // into a fresh replacement.\n if (diff.action === \"update\" || diff.action === \"noop\") {\n // we can continue where we left off\n return Node({\n action: \"update\",\n props: applyProps,\n state: oldState,\n });\n }\n else {\n // we started to update a resource but now believe we should replace it\n return Node({\n action: \"replace\",\n deleteFirst: diff.deleteFirst ?? false,\n props: applyProps,\n // TODO(sam): can Apply handle replacements when the oldState is UpdatingResourceState?\n // -> or should we do a provider.read to try and reconcile back to UpdatedResourceState?\n state: oldState,\n });\n }\n }\n else if (oldState.status === \"replacing\") {\n // The replacement candidate is still being created. Noop/update keep\n // driving the same generation; replace means that candidate itself is\n // now obsolete and must be wrapped in a new outer generation.\n if (diff.action === \"noop\") {\n // this is the stable case - noop means just continue with the replacement\n return Node({\n action: \"replace\",\n deleteFirst: oldState.deleteFirst,\n props: applyProps,\n state: oldState,\n });\n }\n else if (diff.action === \"update\") {\n // potential problem here - the props have changed since we tried to replace,\n // but not enough to trigger another replacement. the resource provider should\n // be designed as idempotent to converge to the right state when creating the new resource\n // the newly generated instanceId is intended to assist with this\n return Node({\n action: \"replace\",\n deleteFirst: oldState.deleteFirst,\n props: applyProps,\n state: oldState,\n });\n }\n else {\n // The in-flight replacement candidate itself now needs replacement.\n // Mark this as a restart so Apply creates a fresh generation instead\n // of resuming the old replacement instance.\n return Node({\n restart: true,\n action: \"replace\",\n deleteFirst: diff.deleteFirst ?? oldState.deleteFirst,\n props: applyProps,\n state: oldState,\n });\n }\n }\n else if (oldState.status === \"replaced\") {\n // The new resource already exists. Noop means \"just let GC finish\",\n // update means \"mutate the current replacement before GC finishes\",\n // and replace means \"the current replacement also became obsolete\".\n if (diff.action === \"noop\") {\n // this is the stable case - noop means just continue cleaning up the replacement\n return Node({\n action: \"replace\",\n deleteFirst: oldState.deleteFirst,\n props: applyProps,\n state: oldState,\n });\n }\n else if (diff.action === \"update\") {\n // the replacement has been created but now also needs to be updated\n // the resource provider should:\n // 1. Update the newly created replacement resource\n // 2. Then proceed as normal to delete the replaced resources (after all downstream references are updated)\n return Node({\n action: \"update\",\n props: applyProps,\n state: oldState,\n });\n }\n else {\n // Cleanup is still pending, but the current \"new\" resource has already\n // become obsolete. Start another replacement generation and preserve\n // the existing replaced node as part of the recursive old chain.\n return Node({\n restart: true,\n action: \"replace\",\n deleteFirst: diff.deleteFirst ?? oldState.deleteFirst,\n props: applyProps,\n state: oldState,\n });\n }\n }\n else if (oldState.status === \"deleting\") {\n // we're in a partially deleted state, it is unclear whether it was or was not deleted\n // so continue by re-creating it with the same instanceId and desired props\n return Node({\n action: \"create\",\n props: applyProps,\n state: {\n ...oldState,\n status: \"creating\",\n props: news,\n },\n });\n }\n else if (diff.action === \"update\") {\n // Stable created/updated resources follow the normal CRUD mapping.\n return Node({\n action: forceUpdateAfterAdoption ? \"adopted\" : \"update\",\n adopting: forceUpdateAfterAdoption,\n props: applyProps,\n state: oldState,\n });\n }\n else if (diff.action === \"replace\") {\n return Node({\n action: \"replace\",\n props: applyProps,\n state: oldState,\n deleteFirst: diff?.deleteFirst ?? false,\n });\n }\n else {\n return Node({\n action: \"noop\",\n state: oldState,\n });\n }\n });\n // Every diff runs to completion and every failure is reported. With\n // fail-fast `Effect.all`, the first exit to arrive wins the aggregate\n // cause — and when a diff is cancelled by a sibling's failure (or ends\n // interrupt-only for any other reason) that can be a bare interruption,\n // hiding the InvalidReferenceError or provider error that actually\n // broke the plan.\n const diffExits = yield* Effect.all(resources.map((resource) => Effect.exit(Effect.tap(diffResource(resource), resourcePlanned))), { concurrency: \"unbounded\" });\n const diffFailures = diffExits.filter(Exit.isFailure);\n if (diffFailures.length > 0) {\n const reasons = diffFailures.flatMap((exit) => exit.cause.reasons);\n const failures = reasons.filter((reason) => !Cause.isInterruptReason(reason));\n return yield* Effect.failCause(Cause.fromReasons(failures.length > 0 ? failures : reasons));\n }\n const resourceGraph = Object.fromEntries(diffExits\n .filter(Exit.isSuccess)\n .map((exit) => [exit.value.resource.FQN, exit.value]));\n // ── Action plan nodes ────────────────────────────────────────────────\n // Per-action plan progress, mirroring the resource pass.\n const actionCount = yield* Ref.make(0);\n const actionPlanned = (entry) => Ref.updateAndGet(actionCount, (count) => count + 1).pipe(Effect.flatMap((completed) => reportPlanned({\n _tag: \"plan.action.completed\",\n ...describeAction(entry[1]),\n completed,\n total: actions.length,\n })));\n const diffAction = Effect.fn(\"plan.diff.action\")(function* (action) {\n const fqn = action.FQN;\n const downstream = newDownstreamDependencies[fqn] ?? [];\n // The node carries the RAW input expression (evaluated at apply);\n // the drift hash uses the diff-facing view so stable upstream\n // attributes hash as their known values.\n const resolvedInput = materializeStableRefs(yield* resolveInput(action.Input));\n const inputHash = yield* hashInput(resolvedInput);\n const oldState = yield* state.get({\n stack: stackName,\n stage,\n fqn,\n });\n if (oldState && !isActionState(oldState)) {\n // FQN collision with a resource — surface as a fatal error so\n // the user resolves it before we touch anything.\n return [\n fqn,\n {\n kind: \"action\",\n action: \"run\",\n def: action,\n input: action.Input,\n state: undefined,\n downstream,\n forced: false,\n },\n ];\n }\n const prior = oldState;\n const sameInput = prior?.status === \"ran\" && prior.inputHash === inputHash;\n if (sameInput && !options.force) {\n return [\n fqn,\n {\n kind: \"action\",\n action: \"noop\",\n def: action,\n state: prior,\n downstream,\n },\n ];\n }\n return [\n fqn,\n {\n kind: \"action\",\n action: \"run\",\n def: action,\n input: action.Input,\n state: prior,\n downstream,\n forced: !!options.force,\n },\n ];\n });\n const actionGraph = Object.fromEntries((yield* Effect.all(actions.map((action) => diffAction(action).pipe(Effect.tap(actionPlanned))), { concurrency: \"unbounded\" })));\n // SCC membership of the combined upstream graph. Apply uses it to\n // decide whether an update node must publish its prior attr early to\n // break a cycle, or can simply wait for upstreams like a DAG node\n // (the common case). Computed once, above, for the downstream graph.\n const cycleMembers = combinedCycleMembers;\n // Detect unsatisfiable dependency cycles among create/replace nodes.\n // Update/noop nodes signal their Deferred before waitForDeps when in a\n // cycle so they cannot deadlock. Create/replace nodes only signal\n // early when they have a precreate handler. Simulate the concurrent\n // execution: precreate nodes are immediately \"resolved\", then\n // iteratively resolve any node whose deps are all resolved. Remaining\n // nodes would deadlock.\n {\n const createReplaceNodes = new Set(Object.entries(resourceGraph)\n .filter(([, node]) => node.action === \"create\" || node.action === \"replace\")\n .map(([fqn]) => fqn));\n if (createReplaceNodes.size > 0) {\n const hasPrecreate = new Set([...createReplaceNodes].filter((fqn) => !!resourceGraph[fqn]?.provider?.precreate));\n const resolved = new Set(hasPrecreate);\n let changed = true;\n while (changed) {\n changed = false;\n for (const fqn of createReplaceNodes) {\n if (resolved.has(fqn))\n continue;\n const deps = (allUpstreamDependencies[fqn] ?? []).filter((dep) => createReplaceNodes.has(dep));\n if (deps.every((dep) => resolved.has(dep))) {\n resolved.add(fqn);\n changed = true;\n }\n }\n }\n const deadlocked = [...createReplaceNodes].filter((fqn) => !resolved.has(fqn));\n if (deadlocked.length > 0) {\n const missingPrecreate = deadlocked.filter((fqn) => !hasPrecreate.has(fqn));\n return yield* Effect.die(new UnsatisfiedResourceCycle({\n message: `Circular dependency detected that cannot be resolved: [${deadlocked.join(\", \")}]. ` +\n `Resources lacking a precreate handler: [${missingPrecreate.join(\", \")}]. ` +\n `All resources in a dependency cycle must implement precreate to allow early signaling.`,\n cycle: deadlocked,\n missingPrecreate,\n }));\n }\n }\n }\n // Both orphan passes (task rows below, resource rows further down)\n // examine every persisted row of this stack instance.\n const persistedFqns = yield* state.list({ stack: stackName, stage });\n // Orphan progress mirrors the diff passes: every persisted row is\n // examined, but only rows that actually become deletion nodes are\n // reported — `completed` tracks examination so progress stays monotonic.\n const actionExaminedCount = yield* Ref.make(0);\n const actionDeletionPlanned = (entry) => Ref.updateAndGet(actionExaminedCount, (count) => count + 1).pipe(Effect.flatMap((completed) => entry === undefined\n ? Effect.void\n : reportPlanned({\n _tag: \"plan.action.completed\",\n ...describeAction(entry[1]),\n completed,\n total: persistedFqns.length,\n })));\n // Task deletions: state rows previously written by tasks that no\n // longer appear in the stack. The body is NOT invoked — we just drop\n // the row.\n const diffActionDeletion = Effect.fn(\"plan.diff.actionDeletion\")(function* (fqn) {\n if (newActionFqns.has(fqn) || newResourceFqns.has(fqn))\n return;\n const persisted = yield* state.get({\n stack: stackName,\n stage,\n fqn,\n });\n if (!isActionState(persisted))\n return;\n const { logicalId } = parseFqn(fqn);\n return [\n fqn,\n {\n kind: \"action\",\n action: \"delete\",\n state: persisted,\n downstream: persisted.downstream ?? [],\n def: {\n Kind: \"action\",\n Namespace: persisted.namespace,\n FQN: fqn,\n LogicalId: logicalId,\n Type: persisted.actionType,\n Input: persisted.input,\n Captures: {},\n Run: () => undefined,\n Output: undefined,\n },\n },\n ];\n });\n const actionDeletions = Object.fromEntries((yield* Effect.all(persistedFqns.map((fqn) => diffActionDeletion(fqn).pipe(Effect.tap((entry) => actionDeletionPlanned(entry ?? undefined)))), { concurrency: \"unbounded\" })).filter((v) => !!v));\n // Deletion progress mirrors the resource pass: every persisted row is\n // examined, but only rows that actually become deletion nodes are\n // reported — `completed` tracks examination so progress stays monotonic.\n const deletionCandidates = persistedFqns;\n const examinedCount = yield* Ref.make(0);\n const deletionPlanned = (entry) => Ref.updateAndGet(examinedCount, (count) => count + 1).pipe(Effect.flatMap((completed) => entry === undefined\n ? Effect.void\n : reportPlanned({\n _tag: \"plan.resource.completed\",\n ...describeResource(entry[1]),\n completed,\n total: deletionCandidates.length,\n })));\n const diffDeletion = Effect.fn(\"plan.diff.deletion\")(function* (fqn) {\n if (newResourceFqns.has(fqn) || newActionFqns.has(fqn)) {\n return;\n }\n const persisted = yield* state.get({\n stack: stackName,\n stage: stage,\n fqn,\n });\n // Tasks are routed through `actionDeletions` above.\n if (isActionState(persisted))\n return;\n const oldState = persisted;\n if (oldState) {\n // A row being migrated by a rename (`renameMigrations`) is\n // moving, not orphaned — apply drops it state-only after\n // committing the migrated row at its new FQN. Rows at former\n // FQNs that did NOT migrate (foreign type, different\n // instanceId, unclaimed) are absent from this set and fall\n // through to normal orphan deletion.\n if (migratedRowFqns.has(fqn)) {\n return;\n }\n const { logicalId } = parseFqn(fqn);\n const resourceType = oldState.resourceType;\n // A \"zombie\" row references a type with no registered provider\n // (removed from the program, or renamed without an alias).\n // That is fatal: the program and state disagree, and without\n // the provider the row's physical resource cannot be deleted\n // anyway. Die at plan time with a typed error naming the row\n // and the remediation instead of limping into a partial apply.\n //\n // Orphan deletes resolve the provider variant for the mode\n // that created the row (`providerMode`, or the `dev:` marker\n // inference for legacy unstamped rows), so e.g. a local dev\n // worker's row is deleted by the local provider even during a\n // live deploy — and vice versa. Unstamped rows are physically\n // live unless their attrs carry the marker (see stampedMode),\n // never the run default.\n const rowMode = stampedMode(oldState);\n const providerOption = yield* tryFindProviderByType(resourceType, rowMode);\n if (Option.isNone(providerOption)) {\n return yield* Effect.die(missingProviderError(resourceType, fqn));\n }\n const provider = providerOption.value;\n // NOTE: an attr-less row (interrupted create) is NOT recovered\n // here. Apply's `deleteResource` performs the authoritative\n // read-then-delete recovery — it also covers replaced-chain\n // old generations that never pass through plan, and routes\n // `Unowned` results away from `provider.delete`.\n return [\n fqn,\n {\n action: oldState.removalPolicy === \"retain\" ? \"orphaned\" : \"delete\",\n state: oldState,\n provider: provider,\n mode: oldState.providerMode,\n resource: {\n Namespace: oldState.namespace,\n FQN: fqn,\n LogicalId: logicalId,\n Type: oldState.resourceType,\n Attributes: oldState.attr,\n Props: oldState.props,\n Binding: undefined,\n Provider: Provider(resourceType),\n RemovalPolicy: oldState.removalPolicy,\n Adopt: undefined,\n RequiresImplementation: undefined,\n Mode: oldState.providerMode,\n FormerFqns: undefined,\n RuntimeContext: undefined,\n Providers: undefined,\n },\n downstream: oldDownstreamDependencies[fqn] ?? [],\n bindings: oldState.bindings.map((binding) => ({\n sid: binding.sid,\n action: \"delete\",\n data: binding.data,\n })),\n },\n ];\n }\n });\n const deletions = Object.fromEntries((yield* Effect.all(deletionCandidates.map((fqn) => diffDeletion(fqn).pipe(Effect.tap((entry) => deletionPlanned(entry ?? undefined)))), { concurrency: \"unbounded\" })).filter((v) => !!v));\n for (const resourceFqn of Object.keys(deletions)) {\n const dependencies = Object.entries(rawUpstreamDependencies)\n .filter(([survivorFqn, upstream]) => survivorFqn in resourceGraph && upstream.includes(resourceFqn))\n .map(([survivorFqn]) => survivorFqn);\n if (dependencies.length > 0) {\n return yield* new DeleteResourceHasDownstreamDependencies({\n message: `Resource ${resourceFqn} has downstream dependencies`,\n resourceId: resourceFqn,\n dependencies,\n });\n }\n }\n return {\n resources: resourceGraph,\n actions: actionGraph,\n deletions,\n actionDeletions,\n output: stack.output,\n cycleMembers,\n defaultMode: runDefaultMode,\n };\n}).pipe(\n// Owns the memoized resolutions' fibers for the plan's duration.\nEffect.scoped, ensureArtifactStore, Effect.withSpan(\"plan.make\", {\n attributes: {\n \"alchemy.stack\": stack.name,\n \"alchemy.stage\": stack.stage,\n \"alchemy.resources.count\": Object.keys(stack.resources).length,\n \"alchemy.force\": !!options.force,\n },\n}));\n/**\n * Build the plan that destroys every resource of `(stack.name, stack.stage)`.\n *\n * The spec is emptied out so every persisted resource becomes an orphan\n * deletion, and `output` is left undefined so `apply` does not overwrite the\n * last deploy's persisted stack output with an empty husk. `apply` recognizes\n * the `destroy` marker and deletes the stage's remaining persisted state (the\n * stack output record) once the destroy has converged, so `state.getOutput`\n * and `state.listStages` agree the stage is gone.\n *\n * @see https://github.com/alchemy-run/alchemy/issues/961\n */\nexport const destroy = (stack) => make({\n name: stack.name,\n stage: stack.stage,\n resources: {},\n bindings: {},\n actions: {},\n output: undefined,\n}).pipe(Effect.map((plan) => ({ ...plan, destroy: true })));\nconst providePlanScope = (fqn, instanceId) => (effect) => Effect.serviceOption(ArtifactStore).pipe(Effect.map(Option.getOrElse(createArtifactStore)), Effect.flatMap((store) => effect.pipe(Effect.provideService(Artifacts, makeScopedArtifacts(store, fqn)), Effect.provideService(InstanceId, instanceId))));\nexport class DeleteResourceHasDownstreamDependencies extends Data.TaggedError(\"DeleteResourceHasDownstreamDependencies\") {\n}\nexport class UnsatisfiedResourceCycle extends Data.TaggedError(\"UnsatisfiedResourceCycle\") {\n}\n// TODO(sam): compare props\n// oldBinding.props !== newBinding.props;\n/**\n * Print a plan in a human-readable format that shows the graph topology.\n */\nexport const printPlan = (plan) => {\n const lines = [];\n const allNodes = { ...plan.resources, ...plan.deletions };\n // Build reverse mapping: upstream -> downstream\n const upstreamMap = {};\n for (const [id] of Object.entries(allNodes)) {\n upstreamMap[id] = [];\n }\n for (const [id, node] of Object.entries(allNodes)) {\n if (!node)\n continue;\n for (const downstreamId of node.state?.downstream ?? []) {\n if (upstreamMap[downstreamId]) {\n upstreamMap[downstreamId].push(id);\n }\n }\n }\n // Action symbols\n const actionSymbol = (action) => {\n switch (action) {\n case \"create\":\n return \"+\";\n case \"update\":\n return \"~\";\n case \"adopted\":\n return \"(+)\";\n case \"delete\":\n return \"-\";\n case \"orphaned\":\n return \"(-)\";\n case \"replace\":\n return \"±\";\n case \"noop\":\n return \"=\";\n default:\n return \"?\";\n }\n };\n // Print header\n lines.push(\"╔════════════════════════════════════════════════════════════════╗\");\n lines.push(\"║ PLAN ║\");\n lines.push(\"╠════════════════════════════════════════════════════════════════╣\");\n lines.push(\"║ Legend: + create, ~ update, - delete, ± replace, = noop, ║\");\n lines.push(\"║ λ run task, · skip task ║\");\n lines.push(\"╚════════════════════════════════════════════════════════════════╝\");\n lines.push(\"\");\n // Print resources section\n lines.push(\"┌─ Resources ────────────────────────────────────────────────────┐\");\n const resourceIds = Object.keys(plan.resources).sort();\n for (const id of resourceIds) {\n const node = plan.resources[id];\n const symbol = actionSymbol(node.action);\n const type = node.resource?.type ?? \"unknown\";\n const downstream = node.state?.downstream?.length\n ? ` → [${node.state?.downstream.join(\", \")}]`\n : \"\";\n const renamed = node.renamedFrom?.length\n ? ` (renamed from ${node.renamedFrom.join(\", \")})`\n : \"\";\n lines.push(`│ [${symbol}] ${id} (${type})${downstream}${renamed}`);\n }\n if (resourceIds.length === 0) {\n lines.push(\"│ (none)\");\n }\n lines.push(\"└────────────────────────────────────────────────────────────────┘\");\n lines.push(\"\");\n // Print tasks section\n lines.push(\"┌─ Tasks ────────────────────────────────────────────────────────┐\");\n const taskIds = Object.keys(plan.actions ?? {}).sort();\n for (const id of taskIds) {\n const node = plan.actions[id];\n const symbol = node.action === \"run\" ? \"λ\" : \"·\";\n const type = node.def.Type;\n const downstream = node.downstream.length\n ? ` → [${node.downstream.join(\", \")}]`\n : \"\";\n lines.push(`│ [${symbol}] ${id} (${type})${downstream}`);\n }\n if (taskIds.length === 0) {\n lines.push(\"│ (none)\");\n }\n lines.push(\"└────────────────────────────────────────────────────────────────┘\");\n lines.push(\"\");\n // Print deletions section\n lines.push(\"┌─ Deletions ────────────────────────────────────────────────────┐\");\n const deletionIds = Object.keys(plan.deletions).sort();\n for (const id of deletionIds) {\n const node = plan.deletions[id];\n const type = node.resource?.Type ?? \"unknown\";\n const downstream = node.state.downstream?.length\n ? ` → [${node.state.downstream.join(\", \")}]`\n : \"\";\n lines.push(`│ [-] ${id} (${type})${downstream}`);\n }\n const taskDeletionIds = Object.keys(plan.actionDeletions ?? {}).sort();\n for (const id of taskDeletionIds) {\n const node = plan.actionDeletions[id];\n lines.push(`│ [-] ${id} (${node.def.Type}) [action]`);\n }\n if (deletionIds.length === 0 && taskDeletionIds.length === 0) {\n lines.push(\"│ (none)\");\n }\n lines.push(\"└────────────────────────────────────────────────────────────────┘\");\n lines.push(\"\");\n return lines.join(\"\\n\");\n};\n//# sourceMappingURL=Plan.js.map","import * as Cause from \"effect/Cause\";\nimport * as Data from \"effect/Data\";\nimport * as Deferred from \"effect/Deferred\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Option from \"effect/Option\";\nimport * as Predicate from \"effect/Predicate\";\nimport { makeResolveContext } from \"./ActionRuntimeContext.js\";\nimport { stripUnowned, Unowned } from \"./AdoptPolicy.js\";\nimport { AlchemyContext } from \"./AlchemyContext.js\";\nimport { demandPlanCredentials, } from \"./Auth/Demand.js\";\nimport { RuntimeContext } from \"./RuntimeContext.js\";\nimport { Artifacts, ArtifactStore, createArtifactStore, ensureArtifactStore, makeScopedArtifacts, } from \"./Artifacts.js\";\nimport { Cli, noopSession, } from \"./Report.js\";\nimport { havePropsChanged, stripUnresolved } from \"./Diff.js\";\nimport { generateInstanceId, InstanceId } from \"./InstanceId.js\";\nimport * as Output from \"./Output.js\";\nimport {} from \"./Plan.js\";\nimport { findProviderByType, missingProviderError, tryFindProviderByType, } from \"./Provider.js\";\nimport { stampedMode } from \"./ProviderMode.js\";\nimport { Stack } from \"./Stack.js\";\nimport { Stage } from \"./Stage.js\";\nimport { State, StateStoreError, } from \"./State/index.js\";\nimport { recordResourceOp } from \"./Telemetry/Metrics.js\";\nimport { hashInput } from \"./Util/sha256.js\";\nconst provideLifecycleScope = (fqn, instanceId) => (effect) => Effect.serviceOption(ArtifactStore).pipe(Effect.map(Option.getOrElse(createArtifactStore)), Effect.flatMap((store) => effect.pipe(Effect.provideService(Artifacts, makeScopedArtifacts(store, fqn)), Effect.provideService(InstanceId, instanceId))));\n/**\n * Instruments a single provider lifecycle call with an OTel span\n * (`provider.<op>`), the resource counter / duration histogram, and the\n * scoped artifacts/instance services normally supplied by\n * {@link provideLifecycleScope}.\n *\n * This is the only call site through which provider lifecycle methods\n * are dispatched, so wrapping it here gives us a fully-instrumented\n * toolchain without touching any individual provider implementation.\n */\nconst instrumentLifecycle = (op, fqn, resourceType, logicalId, instanceId) => (effect) => effect.pipe(provideLifecycleScope(fqn, instanceId), recordResourceOp(resourceType, op), Effect.withSpan(`provider.${op}`, {\n attributes: {\n \"alchemy.resource.fqn\": fqn,\n \"alchemy.resource.type\": resourceType,\n \"alchemy.resource.logical_id\": logicalId,\n \"alchemy.resource.instance_id\": instanceId,\n \"alchemy.resource.op\": op,\n },\n}));\nexport const apply = (plan, options = {}) => Effect.gen(function* () {\n // Credential-free dev: a dev-mode plan that needs the real cloud\n // (`Alchemy.remote()` rows, remote-proxied bindings, deletions of rows\n // stamped `providerMode: \"live\"`) demands cloud credentials exactly\n // once, up front, BEFORE any lifecycle operation runs — a fully-local\n // dev plan demands nothing. Non-dev runs never enter the seam: live\n // providers keep the pre-existing lazy credential flow. Wired here (not\n // in Deploy/Destroy) because `apply` is the single choke point every\n // path shares — CLI deploy/destroy, `Test.make` deploys, and\n // `test.provider` scratch stacks. See `Auth/Demand.ts`.\n const alchemy = yield* Effect.serviceOption(AlchemyContext);\n if (Option.isSome(alchemy) && alchemy.value.dev) {\n yield* demandPlanCredentials(plan);\n }\n // Renderer resolution: an explicit session wins, then the ambient Cli\n // renderer service (the bundled CLI, LoggingCli in tests, or a custom\n // implementation), else events are dropped.\n const session = options.session ??\n (yield* Effect.serviceOption(Cli).pipe(Effect.flatMap(Option.match({\n onNone: () => Effect.succeed(noopSession),\n onSome: (cli) => cli.startApplySession(plan, options.planDisplay),\n }))));\n // The nested gen exists so `onExit` can settle the session on every\n // exit path without introducing a scope: local dev providers start\n // long-running processes in the AMBIENT scope during reconcile, so\n // wrapping this body in Effect.scoped would kill them when apply\n // returns.\n return yield* Effect.gen(function* () {\n const state = yield* yield* State;\n const stack = yield* Stack;\n const stage = yield* Stage;\n const stackName = stack.name;\n const tracker = {};\n const terminalStatuses = new Map();\n // ── FQN migrations (renamedFrom) ──\n // Persist renames before any lifecycle operation runs: a node whose row\n // was found under a former FQN carries that row pre-remapped in\n // `node.state` (see Plan's rename resolution). Commit it at the current\n // FQN FIRST, then drop the former row — in that order, so an\n // interruption leaves rows at both FQNs with the same instanceId, which\n // the next plan recognizes as an in-flight migration (and never as an\n // orphan to delete).\n //\n // In a same-deploy shift (A→B while B→C), C's former FQN `B` is\n // simultaneously B's migration TARGET. C must NOT delete it: B's own\n // `state.set` supersedes the stale copy, and the migrations run\n // concurrently — the delete could land after B's write and destroy the\n // freshly migrated row.\n const migrationTargets = new Set(Object.values(plan.resources)\n .filter((node) => node.renamedFrom?.length && node.state !== undefined)\n .map((node) => node.resource.FQN));\n yield* Effect.forEach(Object.values(plan.resources), (node) => {\n const { renamedFrom, state: row } = node;\n return renamedFrom === undefined ||\n renamedFrom.length === 0 ||\n row === undefined\n ? Effect.void\n : Effect.gen(function* () {\n yield* state.set({\n stack: stackName,\n stage,\n fqn: node.resource.FQN,\n value: row,\n });\n yield* Effect.forEach(renamedFrom.filter((formerFqn) => !migrationTargets.has(formerFqn)), (formerFqn) => state.delete({ stack: stackName, stage, fqn: formerFqn }), { concurrency: \"unbounded\" });\n });\n }, { concurrency: \"unbounded\" });\n yield* executePlan(plan, tracker, terminalStatuses, session, state, stackName, stage);\n // TODO(sam): support roll back to previous state if errors occur during expansion\n // -> RISK: some UPDATEs may not be reversible (i.e. trigger replacements)\n // TODO(sam): should pivot be done separately? E.g shift traffic?\n yield* collectGarbage(plan, session);\n yield* converge(plan, tracker, terminalStatuses, session, state, stackName, stage);\n yield* Effect.forEach(Array.from(terminalStatuses.values()), ({ fqn, id, type, status, providerMode }) => session.emit({\n _tag: \"apply.resource.status\",\n fqn,\n id,\n type,\n status,\n providerMode,\n }), { concurrency: \"unbounded\" });\n if (plan.destroy) {\n // The destroy converged: every resource row was deleted above. Drop\n // the rest of the stage's persisted state — notably the stack output\n // record written by the last deploy — so `getOutput` returns\n // undefined and `listStages` no longer reports the stage.\n // https://github.com/alchemy-run/alchemy/issues/961\n yield* state.deleteStack({ stack: stackName, stage });\n // Invariant: a successful destroy leaves the stage EMPTY. If rows\n // survive, this destroy session could not actually see (or delete)\n // the stack's state — e.g. its plan listed an empty store while\n // committed rows existed — and reporting success here would silently\n // leak every cloud resource those rows track. Fail loudly instead so\n // the leak surfaces in the run that caused it.\n const remaining = yield* state.list({ stack: stackName, stage });\n if (remaining.length > 0) {\n return yield* Effect.fail(new StateStoreError({\n message: `destroy of ${stackName}/${stage} reported success but ${remaining.length} ` +\n `state row(s) remain (${remaining.join(\", \")}) — the destroy session could ` +\n `not see the stack's persisted state, so its cloud resources were NOT deleted`,\n }));\n }\n return undefined;\n }\n if (!plan.output) {\n return undefined;\n }\n const outputs = Object.fromEntries(Object.entries(tracker).map(([fqn, t]) => [fqn, t.output]));\n const resolved = yield* Output.evaluate(plan.output, outputs);\n // Persist the stack's evaluated outputs so cross-stack references\n // (`yield* OtherStack` / `OtherStack.stage.<name>` / `Output.stackRef`)\n // can read them back out of the state store.\n yield* state.setOutput({ stack: stackName, stage, value: resolved });\n return resolved;\n }).pipe(Effect.onExit((exit) => session.done(Exit.isSuccess(exit) ? \"success\" : \"failure\")));\n}).pipe(ensureArtifactStore, Effect.withSpan(\"apply\", {\n attributes: {\n \"alchemy.resources.count\": Object.keys(plan.resources).length,\n \"alchemy.deletions.count\": Object.keys(plan.deletions).length,\n },\n}));\n// ── Phase 1: concurrent initial execution ──────────────────────────────────\n//\n// Each resource gets a Deferred<void> that signals \"I have some output\n// available in `tracker`.\" Resources with `precreate` signal early so that\n// downstream resources can resolve stable identifiers without deadlocking.\n// The actual output lives in the mutable `tracker` map, not in the Deferred.\nconst executePlan = Effect.fn(function* (plan, tracker, terminalStatuses, session, state, stackName, stage) {\n // Resources and tasks share the same FQN namespace and DAG, so the\n // scheduler tracks them together. Each entry gets a single Deferred that\n // signals \"my output is available in `tracker`.\"\n const allNodes = {\n ...plan.resources,\n ...plan.actions,\n };\n const ready = Object.fromEntries(yield* Effect.all(Object.keys(allNodes).map((fqn) => Effect.map(Deferred.make(), (d) => [fqn, d]))));\n // `readyStable` fires only when a node has reached its TERMINAL output —\n // resources after `reconcile`, tasks after the body completes. Resource\n // precreate stubs do NOT signal `readyStable`, so any consumer that\n // requires stable inputs (e.g. Tasks) waits past the precreate phase.\n const readyStable = Object.fromEntries(yield* Effect.all(Object.keys(allNodes).map((fqn) => Effect.map(Deferred.make(), (d) => [fqn, d]))));\n const getOutputs = () => Object.fromEntries(Object.entries(tracker).map(([fqn, t]) => [fqn, t.output]));\n const waitForDeps = (fqns) => Effect.all(fqns\n .filter((fqn) => fqn in ready)\n .map((fqn) => \n // Non-cycle upstreams must be observed at their TERMINAL output\n // (`readyStable`), not their early precreate signal (`ready`). This\n // is what makes a failed upstream actually interrupt its downstream:\n // a resource with `precreate` resolves `ready` before its real\n // `reconcile` runs, so a downstream waiting on `ready` would proceed\n // (and even finish) even though the upstream's reconcile later\n // failed. Waiting on `readyStable` means the downstream's\n // `waitForDeps` short-circuits with the upstream's failure cause.\n //\n // Cycle members are the exception: peers in an SCC depend on each\n // other, so they must rendezvous on the early `ready`/precreate\n // signal to break the deadlock. Phase 3 (`converge`) re-runs them\n // against final outputs once the cycle settles.\n plan.cycleMembers.has(fqn)\n ? Deferred.await(ready[fqn])\n : Deferred.await(readyStable[fqn])), { concurrency: \"unbounded\" });\n const waitForStableDeps = (fqns) => Effect.all(fqns\n .filter((fqn) => fqn in readyStable)\n .map((fqn) => Deferred.await(readyStable[fqn])), { concurrency: \"unbounded\" });\n const failures = [];\n yield* Effect.all(Object.entries(allNodes).map(([fqn, node]) => node.kind === \"action\"\n ? executeActionNode(fqn, node, tracker, ready, readyStable, terminalStatuses, session, state, stackName, stage, getOutputs, waitForStableDeps, failures)\n : executeNode(fqn, node, tracker, ready, readyStable, terminalStatuses, session, state, stackName, stage, getOutputs, waitForDeps, failures, plan.cycleMembers.has(fqn))), { concurrency: \"unbounded\" });\n if (failures.length > 0) {\n // Aggregate every collected lifecycle failure into a single parallel Cause\n // so the apply ends with one combined error containing every distinct\n // failure / defect that occurred across the concurrent fibers.\n return yield* Effect.failCause(failures.map((f) => f.cause).reduce(Cause.combine));\n }\n});\n/**\n * First human-readable line of a lifecycle failure, for the per-resource\n * `fail` status event. The full cause is still aggregated and raised when\n * the whole apply settles — this exists so a failed row explains itself the\n * moment it fails instead of only after every sibling has finished.\n * `undefined` for interrupt-only causes (nothing failed, the run was\n * cancelled).\n */\nconst failureMessage = (cause) => {\n for (const reason of cause.reasons) {\n const error = Cause.isFailReason(reason)\n ? reason.error\n : Cause.isDieReason(reason)\n ? reason.defect\n : undefined;\n if (error === undefined)\n continue;\n const tag = Predicate.hasProperty(error, \"_tag\") && typeof error._tag === \"string\"\n ? error._tag\n : undefined;\n const message = Predicate.hasProperty(error, \"message\") &&\n typeof error.message === \"string\"\n ? error.message\n : String(error);\n const line = message.split(\"\\n\", 1)[0];\n return tag !== undefined && !line.includes(tag) ? `${tag}: ${line}` : line;\n }\n return undefined;\n};\nconst executeNode = (fqn, node, tracker, ready, readyStable, terminalStatuses, session, state, stackName, stage, getOutputs, waitForDeps, failures, inCycle) => Effect.gen(function* () {\n const logicalId = node.resource.LogicalId;\n const namespace = node.resource.Namespace;\n const commit = (value) => state.set({\n stack: stackName,\n stage,\n fqn,\n // Early commits (`creating`/`replacing`) persist plan props that may\n // still hold unresolved Output exprs; strip them so state stores only\n // plain data (see stripUnresolved in Diff.ts).\n //\n // Binding rows follow the same rule. Even the RESOLVED binding\n // payload can carry Effect leaves — a tagged Worker/Function class in\n // `env` (the circular-bindings pattern) is a function-typed Effect\n // that `Output.evaluate` passes through untouched. A JSON state store\n // would persist it via its `toJSON` as an `{\"_id\":\"Effect\",...}`\n // relic, which the next plan's `diffBindings` compares against the\n // live class stripped to `undefined` — a phantom binding \"update\" on\n // every deploy, forever. Stripping at the commit boundary keeps both\n // store kinds consistent with the comparison in `havePropsChanged`.\n value: {\n ...value,\n props: stripUnresolved(value.props),\n bindings: stripUnresolved(value.bindings),\n namespace,\n },\n });\n const scopedSession = {\n ...session,\n note: (note, options) => session.emit({\n fqn,\n id: logicalId,\n _tag: \"apply.resource.note\",\n message: note,\n kind: options?.kind,\n }),\n };\n // On a mode-switch replacement (local ⇄ live) surface the transition:\n // the old generation's stamped mode → the mode resolved for this run.\n const fromProviderMode = node.action === \"replace\" &&\n node.mode !== undefined &&\n node.state.providerMode !== undefined &&\n node.state.providerMode !== node.mode\n ? node.state.providerMode\n : undefined;\n const report = (status) => session.emit({\n _tag: \"apply.resource.status\",\n fqn,\n id: logicalId,\n type: node.resource.Type,\n status,\n providerMode: node.mode,\n fromProviderMode,\n });\n const markTerminal = (status) => Effect.gen(function* () {\n terminalStatuses.set(fqn, {\n fqn,\n id: logicalId,\n type: node.resource.Type,\n status,\n providerMode: node.mode,\n });\n // A local dev instance announces where it's serving: any\n // local-mode row whose fresh Attributes carry a string `url`\n // (Workers expose their dev-proxy URL this way) gets a\n // `[id] ready at http://localhost:1337` line.\n if (node.mode === \"local\") {\n const url = tracker[fqn]?.output?.url;\n if (typeof url === \"string\" && url.length > 0) {\n yield* scopedSession.note(`ready at ${url}`);\n }\n }\n // Emit immediately so the CLI surfaces the terminal status as soon\n // as the resource is actually done — instead of batching every\n // resource's \"created\"/\"updated\" event to the end of apply(), which\n // makes long-running siblings appear stuck in \"creating\" until the\n // entire deploy finishes.\n //\n // Cycle members are exempt: their initial pass produces an\n // intermediate result that Phase 3 (`converge`) will overwrite once\n // the SCC reaches a fixed point. Emitting \"created\"/\"updated\" here\n // would surface that intermediate state to the CLI before the real\n // terminal status is known. Their final status is flushed from\n // `terminalStatuses` after `converge` completes.\n if (inCycle)\n return;\n yield* session.emit({\n _tag: \"apply.resource.status\",\n fqn,\n id: logicalId,\n type: node.resource.Type,\n status,\n providerMode: node.mode,\n });\n });\n const signalReady = Deferred.succeed(ready[fqn], void 0);\n // Signal only after reconcile completes — never during precreate. Tasks\n // (and any other consumer that calls `waitForStableDeps`) block on this\n // so they observe the resource's final attrs rather than a stub.\n const signalReadyStable = Deferred.succeed(readyStable[fqn], void 0);\n const storeAndSignal = (t) => Effect.gen(function* () {\n tracker[fqn] = t;\n yield* signalReady;\n });\n // ── noop ──\n if (node.action === \"noop\") {\n // No work to do on the cloud resource — the persisted attr is already\n // stable. Two pieces of row METADATA can still have drifted from the\n // declaration, and this is the only pass that will ever see them:\n //\n // 1. `resourceType` — the row was persisted under a legacy type name\n // (the type was since renamed and carries the old name as an\n // alias); migrate it so the state stops depending on the alias.\n // 2. `removalPolicy` — `RemovalPolicy.retain()` / `.destroy()` is a\n // decoration on the declaration, not a prop, so changing it never\n // produces a diff. Without this commit the new policy would never\n // reach state, and the orphan delete (which reads the policy from\n // the persisted row, see `Plan.ts`'s delete node) would act on the\n // stale one — destroying a resource the user had marked `retain`.\n // See https://github.com/alchemy-run/alchemy/issues/1248.\n // 3. `downstream` — a dependent that repins from resource A to B\n // (e.g. a HostnameAssociation switching certificates) updates\n // *itself*, while A and B are both noops. Delete ordering reads the\n // persisted `downstream` of the resource being deleted, so without\n // this commit a later destroy deletes B concurrently with the\n // dependent that still references it (and needlessly waits on A).\n const policyChanged = node.state.removalPolicy !== node.resource.RemovalPolicy;\n const downstreamChanged = !sameSet(node.state.downstream ?? [], node.downstream);\n if (node.state.resourceType !== node.resource.Type ||\n policyChanged ||\n downstreamChanged) {\n yield* commit({\n ...node.state,\n resourceType: node.resource.Type,\n removalPolicy: node.resource.RemovalPolicy,\n downstream: node.downstream,\n });\n }\n // A policy flip is otherwise invisible (the row is a noop), and it is\n // exactly the change a user wants confirmation of. Legacy rows with no\n // persisted policy normalize silently — there is nothing to report.\n if (policyChanged && node.state.removalPolicy !== undefined) {\n yield* scopedSession.note(`removal policy ${node.state.removalPolicy} → ${node.resource.RemovalPolicy}`);\n }\n yield* signalReadyStable;\n yield* storeAndSignal({\n output: node.state.attr,\n props: node.state.props,\n bindings: node.state.bindings ?? [],\n instanceId: node.state.instanceId,\n });\n return;\n }\n const allUpstreamFqns = () => {\n const propDeps = Object.keys(Output.resolveUpstream(node.props));\n const bindingDeps = Object.keys(Output.resolveUpstream(node.bindings));\n return [...new Set([...propDeps, ...bindingDeps])];\n };\n // ── instance ID ──\n const instanceId = yield* Effect.gen(function* () {\n if (node.action === \"create\" && !node.state?.instanceId) {\n const id = yield* generateInstanceId();\n yield* commit({\n status: \"creating\",\n fqn,\n logicalId,\n instanceId: id,\n downstream: node.downstream,\n props: node.props,\n providerVersion: node.provider.version ?? 0,\n resourceType: node.resource.Type,\n bindings: excludeDeletedBindings(node.bindings),\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n return id;\n }\n else if (node.action === \"replace\") {\n if ((node.state.status === \"replaced\" ||\n node.state.status === \"replacing\") &&\n !node.restart) {\n // Ordinary replacement recovery keeps using the same replacement\n // generation. Only `restart` is allowed to mint a new instance id.\n return node.state.instanceId;\n }\n const id = yield* generateInstanceId();\n yield* commit({\n status: \"replacing\",\n fqn,\n logicalId,\n instanceId: id,\n downstream: node.downstream,\n props: node.props,\n providerVersion: node.provider.version ?? 0,\n resourceType: node.resource.Type,\n bindings: excludeDeletedBindings(node.bindings),\n old: node.state,\n deleteFirst: node.deleteFirst,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n return id;\n }\n else if (node.state?.instanceId) {\n return node.state.instanceId;\n }\n return yield* Effect.die(`Instance ID not found for resource '${logicalId}' and action is '${node.action}'`);\n });\n // ── lifecycle ──\n yield* Effect.gen(function* () {\n // ── create ──\n if (node.action === \"create\") {\n if (!node.state) {\n // First persistence point for a brand new logical resource. Once this is\n // written, retries know they should resume creation instead of planning\n // another fresh create from scratch.\n yield* commit({\n status: \"creating\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: node.props,\n attr: undefined,\n providerVersion: node.provider.version ?? 0,\n bindings: excludeDeletedBindings(node.bindings),\n downstream: node.downstream,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n }\n let attr = node.state?.attr;\n if (attr !== undefined) {\n // Precreate/read may already have produced a usable output snapshot. Publish\n // it early so downstream resources can start resolving against it.\n yield* storeAndSignal({\n output: attr,\n props: {},\n bindings: [],\n instanceId,\n });\n }\n if (node.provider.precreate && attr === undefined) {\n // Some resources need a placeholder physical resource before their real\n // create can finish. Persist that stub so downstream evaluation can proceed.\n yield* report(\"pre-creating\");\n attr = yield* node.provider\n .precreate({\n id: logicalId,\n fqn,\n news: node.props,\n session: scopedSession,\n instanceId,\n bindings: excludeDeletedBindings(node.bindings),\n })\n .pipe(instrumentLifecycle(\"precreate\", fqn, node.resource.Type, logicalId, instanceId));\n yield* commit({\n status: \"creating\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: node.props,\n attr,\n providerVersion: node.provider.version ?? 0,\n bindings: excludeDeletedBindings(node.bindings),\n downstream: node.downstream,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n yield* storeAndSignal({\n output: attr,\n props: {},\n bindings: [],\n instanceId,\n });\n }\n // While we're waiting on upstream outputs the resource isn't actually\n // creating anything yet — surface that as \"pending\" so the CLI doesn't\n // look stuck in \"creating\" for slow-upstream deploys.\n yield* report(\"pending\");\n // Create runs against fully resolved upstream outputs and bindings, not the\n // raw Output expressions stored in the plan.\n yield* waitForDeps(allUpstreamFqns());\n yield* report(\"creating\");\n const outputs = getOutputs();\n const news = (yield* Output.evaluate(node.props, outputs));\n const bindingOutputs = excludeDeletedBindings(yield* Output.evaluate(node.bindings, outputs));\n attr = yield* node.provider\n .reconcile({\n id: logicalId,\n fqn,\n news,\n instanceId,\n bindings: bindingOutputs,\n session: scopedSession,\n olds: undefined,\n output: attr,\n })\n .pipe(instrumentLifecycle(\"create\", fqn, node.resource.Type, logicalId, instanceId));\n yield* commit({\n status: \"created\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: news,\n attr,\n // Terminal commits persist the RESOLVED binding payload the\n // provider actually reconciled with, not the raw plan-time\n // expressions. Raw `node.bindings` may hold unresolved Outputs\n // (silently dropped by JSON state stores), so persisting them\n // makes the next plan's `diffBindings` compare a lossy stored\n // shape against fully-resolved data — a phantom binding update\n // on every plan (#874).\n bindings: bindingOutputs,\n providerVersion: node.provider.version ?? 0,\n downstream: node.downstream,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n tracker[fqn] = {\n output: attr,\n props: news,\n bindings: bindingOutputs,\n instanceId,\n };\n yield* signalReady;\n yield* signalReadyStable;\n yield* markTerminal(\"created\");\n return;\n }\n // ── update ──\n if (node.action === \"update\" || node.action === \"adopted\") {\n // Cycle members publish their previous live attr *before* waiting on\n // upstreams so the SCC can converge — peers in the cycle would\n // otherwise deadlock waiting on each other. Phase 3 (`converge`)\n // re-runs each peer's update against fresh outputs once everyone\n // has settled.\n //\n // Linear (DAG) update nodes skip this entirely and simply wait for\n // fresh upstream outputs, mirroring the create flow. This is the\n // important property: a downstream of a non-cycle update never\n // observes the upstream's stale attr, which prevents wasted/\n // destructive intermediate updates (e.g. a Worker deploying with\n // stale Build assets).\n if (inCycle) {\n yield* storeAndSignal({\n output: node.state.attr,\n props: node.state.props,\n bindings: node.state.bindings ?? [],\n instanceId,\n });\n }\n // See create-flow note: while we're waiting on upstream outputs\n // this resource isn't actually updating yet.\n yield* report(\"pending\");\n yield* waitForDeps(allUpstreamFqns());\n const outputs = getOutputs();\n const news = (yield* Output.evaluate(node.props, outputs));\n const adopting = node.adopting === true ||\n (node.state.status === \"updating\" && node.state.adopting === true);\n yield* node.state.status === \"replaced\"\n ? commit({\n // Keep the replacement wrapper intact while changing the live\n // replacement props; GC still has older generations to delete.\n ...node.state,\n attr: node.state.attr,\n props: news,\n providerMode: node.mode,\n })\n : commit({\n // For ordinary updates we snapshot the previously stable props/attrs\n // once, so retries can continue from the same baseline.\n status: \"updating\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: news,\n attr: node.state.attr,\n providerVersion: node.provider.version ?? 0,\n bindings: excludeDeletedBindings(node.bindings),\n downstream: node.downstream,\n old: node.state.status === \"updating\" ? node.state.old : node.state,\n adopting: adopting ? true : undefined,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n yield* report(node.action === \"adopted\" ? \"adopting\" : \"updating\");\n const previousProps = adopting\n ? undefined\n : node.state.status === \"created\" ||\n node.state.status === \"updated\" ||\n node.state.status === \"replaced\"\n ? node.state.props\n : node.state.old.props;\n // Providers receive the resolved binding payload for this exact pass, while\n // `previousProps` tells them what state the live resource is being updated from.\n const bindingOutputs = excludeDeletedBindings(yield* Output.evaluate(node.bindings, outputs));\n const attr = yield* node.provider\n .reconcile({\n id: logicalId,\n fqn,\n news,\n instanceId,\n bindings: bindingOutputs,\n session: scopedSession,\n olds: previousProps,\n output: node.state.attr,\n })\n .pipe(instrumentLifecycle(\"update\", fqn, node.resource.Type, logicalId, instanceId));\n if (node.state.status === \"replaced\") {\n yield* commit({\n // The live replacement changed, but cleanup of older generations still\n // has to continue afterwards.\n ...node.state,\n attr,\n props: news,\n // Resolved payload, not raw `node.bindings` — see create commit.\n bindings: bindingOutputs,\n providerMode: node.mode,\n });\n }\n else {\n yield* commit({\n status: \"updated\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: news,\n attr,\n // Resolved payload, not raw `node.bindings` — see create commit.\n bindings: bindingOutputs,\n providerVersion: node.provider.version ?? 0,\n downstream: node.downstream,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n }\n tracker[fqn] = {\n output: attr,\n props: news,\n bindings: bindingOutputs,\n instanceId,\n };\n // Signal here for the linear (non-cycle) path. For in-cycle updates\n // the deferred has already been resolved by the early `storeAndSignal`\n // above and `signalReady` is a no-op the second time.\n yield* signalReady;\n yield* signalReadyStable;\n if (node.action === \"adopted\") {\n terminalStatuses.set(fqn, {\n fqn,\n id: logicalId,\n type: node.resource.Type,\n status: \"adopted\",\n providerMode: node.mode,\n });\n if (!inCycle)\n yield* report(\"adopted\");\n }\n else {\n yield* markTerminal(\"updated\");\n }\n return;\n }\n // ── replace ──\n if (node.action === \"replace\") {\n if (node.state.status === \"replaced\" && !node.restart) {\n // The replacement already exists; this pass only needs GC to clean up\n // older generations, so expose the current replacement and stop here.\n tracker[fqn] = {\n output: node.state.attr,\n props: node.state.props,\n bindings: node.state.bindings ?? [],\n instanceId,\n };\n yield* signalReady;\n yield* signalReadyStable;\n yield* markTerminal(\"created\");\n return;\n }\n let replState;\n if (node.state.status !== \"replacing\" || node.restart) {\n // `restart` deliberately nests the previous top-level replacement state\n // into `old`, creating a new outer generation to replace it.\n replState = yield* commit({\n status: \"replacing\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: node.props,\n bindings: excludeDeletedBindings(node.bindings),\n attr: undefined,\n providerVersion: node.provider.version ?? 0,\n deleteFirst: node.deleteFirst,\n old: node.state,\n downstream: node.downstream,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n }\n else {\n // Resume the same replacement generation after an interrupted apply.\n replState = node.state;\n }\n // ── delete-first replacements ──\n //\n // By default a replacement is create-first: the new generation is\n // created here and the old generation(s) are reclaimed afterwards by\n // `collectGarbage` (Phase 2). That ordering keeps the old resource\n // alive if the create fails, but it is wrong for resources whose\n // replacement cannot coexist with the original — a fixed physical\n // name, a singleton, etc. Those providers return\n // `{ action: \"replace\", deleteFirst: true }`.\n //\n // When `deleteFirst` is set we tear the previous generation(s) down\n // BEFORE creating the new one, and commit the result as a terminal\n // `created` state (rather than `replaced`) so Phase 2 has no old chain\n // left to drain. `delete` is required to be idempotent, so a re-run\n // after an interrupted apply simply re-converges.\n const deleteOldGenerations = (old) => Effect.gen(function* () {\n const retain = node.resource.RemovalPolicy === \"retain\";\n if (old.attr !== undefined && !retain) {\n // Delete each old generation with the provider variant of the\n // mode that created it — after a local ⇄ live switch,\n // `node.provider` (the new mode) cannot tear down the other\n // runtime's instance. Unstamped rows (legacy or written by a\n // mode-agnostic provider) are physically live, unless their\n // attrs carry the `dev:` identity marker — see stampedMode.\n const oldProvider = yield* findProviderByType(node.resource.Type, stampedMode(old));\n yield* oldProvider\n .delete({\n id: logicalId,\n fqn,\n instanceId: old.instanceId,\n olds: old.props,\n output: old.attr,\n session: scopedSession,\n bindings: [],\n })\n .pipe(instrumentLifecycle(\"delete\", fqn, node.resource.Type, logicalId, old.instanceId));\n }\n if (old.status === \"replacing\" || old.status === \"replaced\") {\n yield* deleteOldGenerations(old.old);\n }\n });\n if (node.deleteFirst) {\n yield* scopedSession.note(\"Deleting previous resource before creating its replacement (deleteFirst)...\");\n yield* deleteOldGenerations(replState.old);\n }\n let attr = replState.attr;\n if (attr !== undefined) {\n // If precreate already ran, expose that intermediate output immediately so\n // downstream resources can resolve against the same in-flight replacement.\n yield* storeAndSignal({\n output: attr,\n props: {},\n bindings: [],\n instanceId,\n });\n }\n if (node.provider.precreate && attr === undefined) {\n yield* report(\"pre-creating\");\n attr = yield* node.provider\n .precreate({\n id: logicalId,\n fqn,\n news: node.props,\n session: scopedSession,\n instanceId,\n bindings: excludeDeletedBindings(node.bindings),\n })\n .pipe(instrumentLifecycle(\"precreate\", fqn, node.resource.Type, logicalId, instanceId));\n yield* commit({\n status: \"replacing\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: node.props,\n attr,\n providerVersion: node.provider.version ?? 0,\n bindings: excludeDeletedBindings(node.bindings),\n downstream: node.downstream,\n old: replState.old,\n deleteFirst: node.deleteFirst,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n yield* storeAndSignal({\n output: attr,\n props: {},\n bindings: [],\n instanceId,\n });\n }\n // See create-flow note: while we're waiting on upstream outputs\n // the replacement isn't actually being created yet.\n yield* report(\"pending\");\n // Replacement create is evaluated exactly like create, but against the new\n // generation's instance id and with the previous generations preserved in `old`.\n yield* waitForDeps(allUpstreamFqns());\n yield* report(\"creating replacement\");\n const outputs = getOutputs();\n const news = (yield* Output.evaluate(node.props, outputs));\n const bindingOutputs = excludeDeletedBindings(yield* Output.evaluate(node.bindings, outputs));\n attr = yield* node.provider\n .reconcile({\n id: logicalId,\n fqn,\n news,\n instanceId,\n bindings: bindingOutputs,\n session: scopedSession,\n olds: undefined,\n output: attr,\n })\n .pipe(instrumentLifecycle(\"create\", fqn, node.resource.Type, logicalId, instanceId));\n if (node.deleteFirst) {\n // The old generation(s) were already torn down above, so there is\n // nothing left for `collectGarbage` to drain — collapse straight to\n // the terminal `created` state.\n yield* commit({\n status: \"created\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: news,\n attr,\n providerVersion: node.provider.version ?? 0,\n // Resolved payload, not raw `node.bindings` — see create commit.\n bindings: bindingOutputs,\n downstream: node.downstream,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n }\n else {\n yield* commit({\n // Creation of the new generation succeeded; from here on the only remaining\n // work is draining the old chain via garbage collection.\n status: \"replaced\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n props: news,\n attr,\n providerVersion: node.provider.version ?? 0,\n // Resolved payload, not raw `node.bindings` — see create commit.\n bindings: bindingOutputs,\n downstream: node.downstream,\n // Preserve the remaining backlog exactly as-is. GC is responsible for\n // popping one generation at a time until the chain is exhausted.\n old: replState.old,\n deleteFirst: node.deleteFirst,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n });\n }\n tracker[fqn] = {\n output: attr,\n props: news,\n bindings: bindingOutputs,\n instanceId,\n };\n yield* signalReady;\n yield* signalReadyStable;\n // Keep progress anchored to the live replacement while GC drains the\n // previous generation(s) in the background.\n yield* markTerminal(\"created\");\n return;\n }\n return yield* Effect.die(`Unknown action: ${node.action}`);\n });\n}).pipe(Effect.catchCause((cause) => \n// Record the failure, propagate it to any downstream resources waiting on\n// our Deferred (so their waitForDeps short-circuits instead of deadlocking),\n// emit a \"fail\" status to the session, and resolve to void so Effect.all\n// does not interrupt sibling fibers. The aggregated cause is raised at\n// the end of executePlan.\nEffect.gen(function* () {\n failures.push({\n fqn,\n logicalId: node.resource.LogicalId,\n type: node.resource.Type,\n cause,\n });\n yield* Deferred.failCause(ready[fqn], cause);\n yield* Deferred.failCause(readyStable[fqn], cause);\n yield* session.emit({\n _tag: \"apply.resource.status\",\n fqn,\n id: node.resource.LogicalId,\n type: node.resource.Type,\n status: \"fail\",\n message: failureMessage(cause),\n providerMode: node.mode,\n });\n})), Effect.withSpan(\"apply.resource\", {\n attributes: {\n \"alchemy.resource.fqn\": fqn,\n \"alchemy.resource.type\": node.resource.Type,\n \"alchemy.resource.logical_id\": node.resource.LogicalId,\n \"alchemy.resource.action\": node.action,\n },\n}));\n// ── Task execution ─────────────────────────────────────────────────────────\n//\n// Tasks slot into the same scheduler as resources. They have no provider\n// lifecycle — just a single Effect that runs when inputs change (or when\n// `--force` is set). The output value is written to `tracker[fqn].output`\n// so downstream Output evaluation works identically to resource attrs.\n/**\n * Run an Action body, resolving any Outputs it captured via `yield* output`\n * during init against the current tracker and exposing them to the body through\n * the resolve {@link RuntimeContext}. See {@link makeCaptureContext}.\n */\nconst runAction = Effect.fn(\"apply.runAction\")(function* (task, input, outputs) {\n const resolved = {};\n for (const [key, output] of Object.entries(task.Captures)) {\n resolved[key] = yield* Output.evaluate(output, outputs);\n }\n return yield* task\n .Run(input)\n .pipe(Effect.provideService(RuntimeContext, makeResolveContext(resolved)));\n});\nconst executeActionNode = (fqn, node, tracker, ready, readyStable, terminalStatuses, session, state, stackName, stage, getOutputs, waitForDeps, failures) => Effect.gen(function* () {\n const task = node.def;\n const logicalId = task.LogicalId;\n const namespace = task.Namespace;\n const commit = (value) => state.set({\n stack: stackName,\n stage,\n fqn,\n value: { ...value, namespace },\n });\n const report = (status) => session.emit({\n _tag: \"apply.resource.status\",\n fqn,\n id: logicalId,\n type: task.Type,\n status,\n });\n const signalReady = Deferred.succeed(ready[fqn], void 0);\n const signalReadyStable = Deferred.succeed(readyStable[fqn], void 0);\n if (node.action === \"noop\") {\n tracker[fqn] = {\n output: node.state.output,\n props: { __input: node.state.input },\n bindings: [],\n instanceId: fqn,\n };\n yield* signalReady;\n yield* signalReadyStable;\n terminalStatuses.set(fqn, {\n fqn,\n id: logicalId,\n type: task.Type,\n status: \"skipped\",\n });\n yield* report(\"skipped\");\n return;\n }\n // ── run ──\n // Tasks wait on `waitForStableDeps` (post-reconcile attrs) for their\n // upstreams, which is often the slowest dep chain in the deploy.\n // Surface that as \"pending\" instead of having the task show no status\n // until its run actually starts.\n yield* report(\"pending\");\n yield* waitForDeps([\n ...new Set([\n ...Object.keys(Output.resolveUpstream(node.input)),\n ...Object.keys(Output.upstreamAny(task.Captures)),\n ]),\n ].filter((f) => f in readyStable));\n const outputs = getOutputs();\n const resolvedInput = (yield* Output.evaluate(node.input, outputs));\n const inputHashValue = yield* hashInput(resolvedInput);\n yield* commit({\n kind: \"action\",\n status: \"running\",\n fqn,\n logicalId,\n actionType: task.Type,\n inputHash: inputHashValue,\n input: resolvedInput,\n downstream: node.downstream,\n });\n yield* report(\"running\");\n const result = yield* runAction(task, resolvedInput, outputs);\n yield* commit({\n kind: \"action\",\n status: \"ran\",\n fqn,\n logicalId,\n actionType: task.Type,\n inputHash: inputHashValue,\n input: resolvedInput,\n output: result,\n downstream: node.downstream,\n });\n tracker[fqn] = {\n output: result,\n props: { __input: resolvedInput },\n bindings: [],\n instanceId: fqn,\n };\n yield* signalReady;\n yield* signalReadyStable;\n terminalStatuses.set(fqn, {\n fqn,\n id: logicalId,\n type: task.Type,\n status: \"ran\",\n });\n yield* report(\"ran\");\n}).pipe(Effect.catchCause((cause) => Effect.gen(function* () {\n failures.push({\n fqn,\n logicalId: node.def.LogicalId,\n type: node.def.Type,\n cause,\n });\n yield* Deferred.failCause(ready[fqn], cause);\n yield* Deferred.failCause(readyStable[fqn], cause);\n yield* session.emit({\n _tag: \"apply.resource.status\",\n fqn,\n id: node.def.LogicalId,\n type: node.def.Type,\n status: \"fail\",\n message: failureMessage(cause),\n });\n})), Effect.withSpan(\"apply.action\", {\n attributes: {\n \"alchemy.action.fqn\": fqn,\n \"alchemy.action.type\": node.def.Type,\n \"alchemy.action.logical_id\": node.def.LogicalId,\n \"alchemy.action.verb\": node.action,\n },\n}));\n// ── Phase 3: imperative convergence loop ───────────────────────────────────\n//\n// After the initial concurrent pass, some resources may have been created\n// with stale upstream values (e.g. a precreate stub instead of the final\n// output). Walk the plan and re-evaluate each resource's props/bindings\n// against the current tracker outputs. Call provider.reconcile for any\n// resource whose resolved inputs differ from what it was last applied with.\n// Repeat until no resource needs updating.\nconst converge = Effect.fn(function* (plan, tracker, terminalStatuses, session, state, stackName, stage) {\n for (;;) {\n let anyUpdated = false;\n for (const [fqn, node] of Object.entries(plan.resources)) {\n if (node.action === \"noop\")\n continue;\n if (!tracker[fqn])\n continue;\n const outputs = Object.fromEntries(Object.entries(tracker).map(([k, t]) => [k, t.output]));\n const newProps = (yield* Output.evaluate(node.props, outputs));\n const newBindings = excludeDeletedBindings(yield* Output.evaluate(node.bindings, outputs));\n const oldProps = tracker[fqn].props;\n const oldBindings = tracker[fqn].bindings;\n const propsChanged = havePropsChanged(oldProps, newProps);\n const bindingsChanged = JSON.stringify(oldBindings) !== JSON.stringify(newBindings);\n if (!propsChanged && !bindingsChanged)\n continue;\n anyUpdated = true;\n const logicalId = node.resource.LogicalId;\n const namespace = node.resource.Namespace;\n const instanceId = tracker[fqn].instanceId;\n const scopedSession = {\n ...session,\n note: (note, options) => session.emit({\n fqn,\n id: logicalId,\n _tag: \"apply.resource.note\",\n message: note,\n kind: options?.kind,\n }),\n };\n const attr = yield* node.provider\n .reconcile({\n id: logicalId,\n fqn,\n news: newProps,\n instanceId,\n bindings: newBindings,\n session: scopedSession,\n olds: oldProps,\n output: tracker[fqn].output,\n })\n .pipe(instrumentLifecycle(\"update\", fqn, node.resource.Type, logicalId, instanceId));\n tracker[fqn] = {\n output: attr,\n props: newProps,\n bindings: newBindings,\n instanceId,\n };\n yield* state.set({\n stack: stackName,\n stage,\n fqn,\n value: {\n status: \"updated\",\n fqn,\n logicalId,\n instanceId,\n resourceType: node.resource.Type,\n // This site bypasses the `commit` helper, so strip unresolved\n // leaves (Effect-valued env entries survive `Output.evaluate`)\n // the same way `commit` does — state only ever holds plain data.\n props: stripUnresolved(newProps),\n attr,\n providerVersion: node.provider.version ?? 0,\n // Resolved payload, not raw `node.bindings` — see the create\n // commit in applyResource. Stripped like the commit helper so\n // Effect leaves (e.g. tagged Worker classes in `env`) never reach\n // the state store.\n bindings: stripUnresolved(newBindings),\n downstream: node.downstream,\n namespace,\n removalPolicy: node.resource.RemovalPolicy,\n providerMode: node.mode,\n },\n });\n terminalStatuses.set(fqn, {\n fqn,\n id: logicalId,\n type: node.resource.Type,\n status: node.action === \"adopted\" ? \"adopted\" : \"updated\",\n providerMode: node.mode,\n });\n }\n // Tasks: re-run when their resolved input drifts vs. the value they\n // last applied with (e.g. an upstream resource produced new attrs in\n // this pass). Skipped (noop) tasks are not re-checked here — their\n // recorded inputHash is authoritative until the next plan.\n for (const [fqn, node] of Object.entries(plan.actions)) {\n if (node.action !== \"run\")\n continue;\n if (!tracker[fqn])\n continue;\n const outputs = Object.fromEntries(Object.entries(tracker).map(([k, t]) => [k, t.output]));\n const newInput = (yield* Output.evaluate(node.input, outputs));\n const newHash = yield* hashInput(newInput);\n const oldInput = tracker[fqn].props?.__input;\n const oldHash = yield* hashInput(oldInput);\n if (newHash === oldHash)\n continue;\n anyUpdated = true;\n yield* state.set({\n stack: stackName,\n stage,\n fqn,\n value: {\n kind: \"action\",\n status: \"running\",\n fqn,\n logicalId: node.def.LogicalId,\n namespace: node.def.Namespace,\n actionType: node.def.Type,\n inputHash: newHash,\n input: newInput,\n downstream: node.downstream,\n },\n });\n const result = yield* runAction(node.def, newInput, outputs);\n yield* state.set({\n stack: stackName,\n stage,\n fqn,\n value: {\n kind: \"action\",\n status: \"ran\",\n fqn,\n logicalId: node.def.LogicalId,\n namespace: node.def.Namespace,\n actionType: node.def.Type,\n inputHash: newHash,\n input: newInput,\n output: result,\n downstream: node.downstream,\n },\n });\n tracker[fqn] = {\n output: result,\n props: { __input: newInput },\n bindings: [],\n instanceId: fqn,\n };\n terminalStatuses.set(fqn, {\n fqn,\n id: node.def.LogicalId,\n type: node.def.Type,\n status: \"ran\",\n });\n }\n if (!anyUpdated)\n break;\n }\n});\n/**\n * Aggregate raised at the end of the deletion phase when one or more\n * resource deletes failed. Every resource whose delete did not depend on a\n * failed one was still attempted — a single failure no longer strands\n * unrelated siblings.\n */\nexport class DestroyError extends Data.TaggedError(\"DestroyError\") {\n get message() {\n return [\n `Failed to delete ${this.failures.length} resource(s)` +\n (this.blocked.length > 0\n ? ` (${this.blocked.length} more skipped because a dependent's delete failed)`\n : \"\") +\n \":\",\n ...this.failures.map((f) => ` ✗ ${f.fqn} (${f.resourceType}): ${Cause.pretty(f.cause)}`),\n ...this.blocked.map((b) => ` ⊘ ${b.fqn} (${b.resourceType}): skipped — blocked by failed delete of ${b.blockedBy.join(\", \")}`),\n ].join(\"\\n\");\n }\n}\nconst collectGarbage = Effect.fn(function* (plan, session) {\n const state = yield* yield* State;\n const stack = yield* Stack;\n const stackName = stack.name;\n const stage = yield* Stage;\n // Task deletions are pure state drops — no body is invoked. Run them in\n // parallel before resource GC; tasks never have provider-side dependencies\n // to wait on.\n yield* Effect.all(Object.entries(plan.actionDeletions ?? {}).map(([fqn, node]) => node === undefined\n ? Effect.void\n : Effect.gen(function* () {\n yield* session.emit({\n _tag: \"apply.resource.status\",\n fqn,\n id: node.def.LogicalId,\n type: node.def.Type,\n status: \"deleting\",\n });\n yield* state.delete({ stack: stackName, stage, fqn });\n yield* session.emit({\n _tag: \"apply.resource.status\",\n fqn,\n id: node.def.LogicalId,\n type: node.def.Type,\n status: \"deleted\",\n });\n })), { concurrency: \"unbounded\" });\n // Failures are collected — not propagated — so one bad delete never\n // strands unrelated siblings. `unresolved` tracks every FQN whose delete\n // failed or was blocked this run: later passes must not retry them (a\n // still-`replaced` row would otherwise spin the drain loop forever) and\n // dependencies scheduled in later passes must observe them as blocking.\n const failures = [];\n const blockedDeletes = [];\n const unresolved = new Set();\n const deleteGraph = Effect.fn(function* (deletionGraph) {\n const deletions = {};\n const deleteResource = (node, ancestors = new Set()) => Effect.gen(function* () {\n const isDeleteNode = (node) => \"action\" in node;\n const { fqn, logicalId, namespace, resourceType, instanceId, downstream, props, attr: persistedAttr, provider, providerMode, } = isDeleteNode(node)\n ? {\n // Use the persisted FQN verbatim — never recompute it from\n // `toFqn(namespace, logicalId)`. A logical ID may legitimately\n // contain the FQN separator (`/`), in which case `parseFqn`\n // truncated it and a recomputed key would miss the real state\n // row (the row would then resurface as an orphan on every\n // subsequent destroy, never getting deleted).\n fqn: node.resource.FQN,\n logicalId: node.resource.LogicalId,\n namespace: node.resource.Namespace,\n resourceType: node.resource.Type,\n instanceId: node.state.instanceId,\n downstream: node.downstream,\n props: node.state.props,\n attr: node.state.attr,\n // Plan resolved this provider for the row's persisted (or\n // marker-inferred) `providerMode` (see the deletions builder\n // in Plan.ts).\n provider: node.provider,\n providerMode: node.state.providerMode,\n }\n : {\n fqn: node.fqn,\n logicalId: node.logicalId,\n namespace: node.namespace,\n resourceType: node.old.resourceType,\n instanceId: node.old.instanceId,\n downstream: node.old.downstream,\n props: node.old.props,\n attr: node.old.attr,\n // A missing provider is fatal — plan already dies on zombie\n // rows (see the deletions builder in Plan.ts); this guards\n // the replaced-chain generations that bypass plan. The old\n // generation is torn down with the provider variant of the\n // mode that created it (local ⇄ live replacements);\n // unstamped rows are physically live unless their attrs\n // carry the `dev:` identity marker (see stampedMode).\n provider: yield* tryFindProviderByType(node.old.resourceType, stampedMode(node.old)).pipe(Effect.flatMap(Option.match({\n onNone: () => Effect.die(missingProviderError(node.old.resourceType, node.fqn)),\n onSome: Effect.succeed,\n }))),\n providerMode: node.old.providerMode,\n };\n // Mutable: an attr-less row (interrupted create) may recover its\n // attributes from `provider.read` below, right before deletion.\n let attr = persistedAttr;\n const nextAncestors = new Set(ancestors).add(fqn);\n const commit = (value) => state.set({\n stack: stackName,\n stage,\n fqn,\n // Same rule as the lifecycle commit above: state only stores\n // plain data, never unresolved Output exprs or Effect leaves.\n value: {\n ...value,\n props: stripUnresolved(value.props),\n bindings: stripUnresolved(value.bindings),\n namespace,\n },\n });\n const report = (status) => session.emit({\n _tag: \"apply.resource.status\",\n fqn,\n id: logicalId,\n type: resourceType,\n status,\n providerMode,\n });\n const scopedSession = {\n ...session,\n note: (note, options) => session.emit({\n fqn,\n id: logicalId,\n _tag: \"apply.resource.note\",\n message: note,\n kind: options?.kind,\n }),\n };\n return yield* (deletions[fqn] ??= yield* Effect.cached(Effect.gen(function* () {\n // Dependents (`downstream`) are deleted before this resource. A\n // dependent whose delete failed (or was itself blocked) may make\n // this resource legitimately undeletable (dependency violation),\n // so it is skipped with a \"blocked by\" note instead of surfacing\n // a spurious second error.\n const dependents = yield* Effect.all(downstream.map((dep) => dep !== fqn && !ancestors.has(dep)\n ? dep in deletionGraph\n ? deleteResource(deletionGraph[dep], nextAncestors).pipe(Effect.map((outcome) => ({ dep, outcome })))\n : // Not in this pass's graph — but it may have failed in\n // an earlier drain pass of the same destroy.\n Effect.sync(() => ({\n dep,\n outcome: unresolved.has(dep)\n ? \"failed\"\n : \"deleted\",\n }))\n : Effect.succeed({ dep, outcome: \"deleted\" })), { concurrency: \"unbounded\" });\n const blockedBy = dependents\n .filter(({ outcome }) => outcome !== \"deleted\")\n .map(({ dep }) => dep);\n if (blockedBy.length > 0) {\n unresolved.add(fqn);\n blockedDeletes.push({\n fqn,\n logicalId,\n resourceType,\n blockedBy,\n });\n yield* scopedSession.note(`Skipping delete — blocked by failed delete of ${blockedBy.join(\", \")}.`);\n yield* report(\"skipped\");\n return \"blocked\";\n }\n return yield* deleteResourceBody().pipe(Effect.catchCause((cause) => Effect.gen(function* () {\n unresolved.add(fqn);\n failures.push({ fqn, logicalId, resourceType, cause });\n yield* report(\"fail\");\n return \"failed\";\n })));\n })));\n function deleteResourceBody() {\n return Effect.gen(function* () {\n if (isDeleteNode(node)) {\n yield* report(node.action === \"orphaned\" ? \"orphaning\" : \"deleting\");\n if (node.action === \"orphaned\") {\n yield* state.delete({\n stack: stackName,\n stage,\n fqn,\n });\n yield* report(\"orphaned\");\n // Retention is intentional — it never blocks dependencies.\n return \"deleted\";\n }\n }\n // Honor `retain` for the old generation of a replacement, mirroring\n // the orphan-delete path above. Delete-node retain is already\n // handled with an early return; this guards the replaced\n // old-generation physical delete.\n const retainOldGeneration = !isDeleteNode(node) && node.removalPolicy === \"retain\";\n if (retainOldGeneration) {\n yield* scopedSession.note(\"Retaining replaced resource (removal policy: retain)...\");\n }\n // A row can reach deletion with `attr === undefined` when a create\n // was interrupted after the cloud-side call succeeded but before\n // `reconcile` returned Attributes (a `creating` row — or the old\n // generation of a replacement chain in the same predicament).\n // Skipping the provider's delete outright would silently orphan\n // the physical resource, so ask `read` to look it up from the\n // persisted props (providers derive the deterministic physical\n // name from id/props):\n // - plain attrs → exists and is ours; proceed to delete\n // - Unowned(attrs) → exists but is NOT ours (e.g. our create\n // actually lost a name race, or died before\n // stamping ownership) — never delete a\n // foreign resource; drop our state and say so\n // - undefined → nothing exists; dropping state is safe\n if (attr === undefined && !retainOldGeneration) {\n if (provider.read) {\n const recovered = yield* provider\n .read({\n id: logicalId,\n fqn,\n instanceId,\n olds: props,\n output: undefined,\n })\n .pipe(instrumentLifecycle(\"read\", fqn, resourceType, logicalId, instanceId), \n // The persisted props of an interrupted create can carry\n // holes where unresolved Outputs were stripped at commit\n // time (see stripUnresolved) — e.g. a parent reference\n // persisted as `{}`. A provider that dereferences one\n // crashes deep inside its SDK client (a SchemaError\n // defect), which would make the stage impossible to\n // destroy. Recovery is best-effort: degrade the defect\n // to \"nothing recovered\", surface a note, and let the\n // row be dropped (#995).\n Effect.catchDefect((defect) => scopedSession\n .note(\"Recovery read crashed while looking up this \" +\n \"resource's interrupted create \" +\n `(${String(defect)}) — if a physical resource ` +\n \"was created, it must be cleaned up manually.\")\n .pipe(Effect.as(undefined))));\n if (recovered !== undefined) {\n if (Unowned.is(recovered)) {\n yield* scopedSession.note(\"Resource exists in the cloud but is not owned by this \" +\n \"stack — leaving it in place (re-deploy with --adopt \" +\n \"to take ownership, then destroy).\");\n }\n else {\n attr = stripUnowned(recovered);\n }\n }\n }\n else {\n yield* scopedSession.note(\"No attributes were recorded for this resource (its create \" +\n \"was interrupted) and the provider does not implement \" +\n \"`read` — if a physical resource was created, it must be \" +\n \"cleaned up manually.\");\n }\n }\n if (isDeleteNode(node)) {\n yield* commit({\n status: \"deleting\",\n fqn,\n logicalId,\n instanceId,\n resourceType,\n props,\n attr,\n downstream,\n providerVersion: provider.version ?? 0,\n bindings: excludeDeletedBindings(node.bindings),\n removalPolicy: node.resource.RemovalPolicy,\n providerMode,\n });\n }\n if (attr !== undefined && !retainOldGeneration) {\n yield* provider\n .delete({\n id: logicalId,\n fqn,\n instanceId,\n olds: props,\n output: attr,\n session: scopedSession,\n bindings: [],\n })\n .pipe(instrumentLifecycle(\"delete\", fqn, resourceType, logicalId, instanceId));\n }\n if (isDeleteNode(node)) {\n yield* state.delete({\n stack: stackName,\n stage,\n fqn,\n });\n yield* report(\"deleted\");\n }\n else {\n if (!retainOldGeneration) {\n yield* scopedSession.note(\"Cleaning up replaced resource...\");\n }\n if (node.old.status === \"replacing\" ||\n node.old.status === \"replaced\") {\n // We only deleted the outermost old generation. A nested replacement\n // chain still exists, so stay in `replaced` and pop the chain forward\n // one level. The outer loop will pick this resource up again.\n yield* commit({\n status: \"replaced\",\n fqn,\n logicalId: node.logicalId,\n instanceId: node.instanceId,\n resourceType: node.resourceType,\n props: node.props,\n attr: node.attr,\n providerVersion: node.providerVersion,\n downstream: node.downstream,\n bindings: excludeDeletedBindings(node.bindings),\n old: node.old.old,\n deleteFirst: node.deleteFirst,\n removalPolicy: node.removalPolicy,\n providerMode: node.providerMode,\n });\n }\n else {\n // The old chain is fully drained, so the current replacement is now\n // the stable resource and we can collapse back to a terminal state.\n yield* commit({\n status: \"created\",\n fqn,\n logicalId: node.logicalId,\n instanceId: node.instanceId,\n resourceType: node.resourceType,\n props: node.props,\n attr: node.attr,\n providerVersion: node.providerVersion,\n downstream: node.downstream,\n bindings: excludeDeletedBindings(node.bindings),\n removalPolicy: node.removalPolicy,\n providerMode: node.providerMode,\n });\n }\n yield* scopedSession.note(retainOldGeneration\n ? \"Replaced resource retained.\"\n : \"Replaced resource cleanup complete.\");\n }\n return \"deleted\";\n });\n }\n });\n // Attempt every root. Per-node failures were recorded (and their state\n // retained) inside each node's delete effect — the effects resolve to\n // outcomes and never fail, so one bad resource never interrupts sibling\n // deletions mid-flight.\n yield* Effect.all(Object.values(deletionGraph)\n .filter((node) => node !== undefined)\n .map((node) => deleteResource(node)), { concurrency: \"unbounded\" });\n });\n // The first pass handles both planned deletions and any top-level replaced\n // resources already present in state. Later passes only drain replacement\n // chains that were re-committed as `replaced` while deleting older generations.\n let first = true;\n while (true) {\n const remainingReplacedResources = (yield* state.getReplacedResources({\n stack: stackName,\n stage,\n }))\n // A row whose drain already failed (or was blocked) this run stays\n // `replaced` in state — retrying it in a later pass would loop forever.\n // It stays behind for the next destroy; the aggregate error below\n // reports it.\n .filter((replaced) => !unresolved.has(replaced.fqn));\n if (!first && remainingReplacedResources.length === 0) {\n break;\n }\n yield* deleteGraph({\n // Orphan/resource deletions from the current plan should only run once.\n ...(first ? plan.deletions : {}),\n ...Object.fromEntries(remainingReplacedResources.map((replaced) => [\n // Key by the persisted FQN (not a recomputed one) so logical IDs\n // containing the FQN separator round-trip correctly.\n replaced.fqn,\n replaced,\n ])),\n });\n first = false;\n }\n if (failures.length > 0) {\n // Every independent delete was still attempted; now surface everything\n // that went wrong (and everything skipped as a consequence) as one\n // typed aggregate. The destroy as a whole still fails.\n return yield* Effect.fail(new DestroyError({ failures, blocked: blockedDeletes }));\n }\n});\nconst excludeDeletedBindings = (bindings) => bindings.flatMap(({ action, sid, data }) => action === \"delete\" ? [] : [{ sid, data }]);\n/** Order-insensitive equality of two FQN lists. */\nconst sameSet = (a, b) => {\n const sa = new Set(a);\n return sa.size === new Set(b).size && b.every((fqn) => sa.has(fqn));\n};\n//# sourceMappingURL=Apply.js.map","import * as Clock from \"effect/Clock\";\nimport * as Effect from \"effect/Effect\";\nimport { apply as applyPlan } from \"../../Apply.js\";\nimport * as Plan from \"../../Plan.js\";\nimport { applySession, Progress, withSpanEvents } from \"../Progress.js\";\nimport { open } from \"../Session.js\";\n/** Whether a plan proposes any cloud mutations (i.e. approval-worthy work). */\nexport const hasChanges = (summary) => summary.create +\n summary.update +\n summary.adopted +\n summary.replace +\n summary.delete +\n summary.orphaned >\n 0;\nexport const summarize = (plan) => {\n const summary = {\n create: 0,\n update: 0,\n adopted: 0,\n replace: 0,\n delete: 0,\n orphaned: 0,\n noop: 0,\n };\n for (const node of Object.values(plan.resources))\n summary[node.action]++;\n for (const node of Object.values(plan.deletions)) {\n if (node !== undefined)\n summary[node.action]++;\n }\n return summary;\n};\n/**\n * Import the stack, resolve its services, and compute a deploy or destroy\n * plan. Planning phases are reported through {@link Progress}; the returned\n * snapshot is what {@link apply} executes.\n */\nexport const plan = Effect.fn(\"Alchemist.stack.plan\")(function* (input) {\n const report = withSpanEvents(yield* Progress);\n // Everything below emits into the same flat ProgressEvent channel:\n // `open` reports importing-module / resolving-services at the real work\n // boundaries, the engine reports loading-state / computing-plan and the\n // per-node diff events. Re-providing the wrapped reporter is all the\n // route does — no translation layer.\n const session = yield* open(input.target, input).pipe(Effect.provideService(Progress, report));\n const native = (yield* (input.operation === \"destroy\"\n ? Plan.destroy(session.stack)\n : Plan.make(session.stack, { force: input.force })).pipe(Effect.provideService(Progress, report), Effect.provide(session.context)));\n yield* report({ _tag: \"plan.phase\", phase: \"plan-ready\" });\n return {\n stack: { name: session.stack.name, stage: session.stack.stage },\n summary: summarize(native),\n ...Plan.describePlan(native),\n native,\n createdAt: new Date(yield* Clock.currentTimeMillis),\n session,\n };\n});\n/**\n * Apply a computed plan. Engine apply events are reported through\n * {@link Progress} as `ApplyEvent`.\n */\nexport const apply = Effect.fn(\"Alchemist.stack.apply\")(function* (snapshot) {\n const report = withSpanEvents(yield* Progress);\n return yield* Effect.provide(applyPlan(snapshot.native, { session: applySession(report) }), snapshot.session.context);\n});\n//# sourceMappingURL=stack.js.map","import * as Schema from \"effect/Schema\";\n/** Wire format passed from the `alchemy dev` supervisor to its exec child. */\nexport const DevOptions = Schema.Struct({\n main: Schema.String,\n stage: Schema.String,\n envFile: Schema.OptionFromOptional(Schema.String),\n profile: Schema.optional(Schema.String),\n force: Schema.Boolean,\n});\n/**\n * Exit status the exec child uses to ask the supervisor for a fresh process.\n * Bun cannot evict evaluated modules, so a stack-graph change under Bun tears\n * the generation down and exits with this code instead of reloading in place.\n */\nexport const DEV_RELOAD_EXIT_CODE = 75;\n//# sourceMappingURL=DevOptions.js.map","import * as Logger from \"effect/Logger\";\nimport { ANSI_RESET, colorsEnabled } from \"./Terminal.js\";\n/** Effect pretty prefixes with selective color and untouched message styling. */\nexport const makePlainConsoleSink = (colors = colorsEnabled()) => {\n const pretty = Logger.consolePretty({ colors });\n if (!colors)\n return pretty;\n return Logger.make((options) => {\n const messages = Array.isArray(options.message)\n ? options.message\n : [options.message];\n pretty.log({\n ...options,\n // consolePretty applies bold cyan around the first string. Reset that\n // wrapper before the content; any intentional ANSI inside the message\n // still takes effect normally.\n message: [\n `${ANSI_RESET}${String(messages[0] ?? \"\")}`,\n ...messages.slice(1),\n ],\n });\n });\n};\n//# sourceMappingURL=ConsoleSink.js.map","import * as Clock from \"effect/Clock\";\nimport * as Effect from \"effect/Effect\";\nimport * as Duration from \"effect/Duration\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Logger from \"effect/Logger\";\nimport * as LogLevel from \"effect/LogLevel\";\nimport * as Option from \"effect/Option\";\nimport { Path } from \"effect/Path\";\nimport { MinimumLogLevel } from \"effect/References\";\nimport { rootDir } from \"../Auth/Paths.js\";\nimport packageJson from \"../../package.json\" with { type: \"json\" };\nimport { makePlainConsoleSink } from \"../Util/ConsoleSink.js\";\n/** Logs older than this are pruned (by mtime) on CLI start. */\nconst MAX_LOG_AGE = Duration.days(7);\n/** Same spellings `GlobalFlag.LogLevel` accepts, so the two never disagree. */\nconst logLevelChoices = {\n all: \"All\",\n trace: \"Trace\",\n debug: \"Debug\",\n info: \"Info\",\n warn: \"Warn\",\n warning: \"Warn\",\n error: \"Error\",\n fatal: \"Fatal\",\n none: \"None\",\n};\n/**\n * The console keeps its usual Info+ noise floor by default; everything below\n * it exists only for the run log, so support requests can start with \"attach\n * the file from ~/.alchemy/logs\". An explicit `--log-level` lowers the floor\n * for that run so `--log-level debug` actually puts debug records on the\n * terminal (#1231) — the run log captures Debug regardless.\n *\n * Read from argv rather than `GlobalFlag.LogLevel` because the console logger\n * is installed while the service layers are built, before the parser has\n * produced flag values (same reason `--no-input` is an argv scan). Only the\n * segment before a `--` separator is inspected; an unrecognised value falls\n * back to Info and is left for the parser to reject.\n */\nexport const consoleLogFloor = (argv) => {\n const separator = argv.indexOf(\"--\");\n const flagArgs = separator === -1 ? argv : argv.slice(0, separator);\n let floor = \"Info\";\n for (let i = 0; i < flagArgs.length; i++) {\n const arg = flagArgs[i];\n const value = arg === \"--log-level\"\n ? flagArgs[i + 1]\n : arg.startsWith(\"--log-level=\")\n ? arg.slice(\"--log-level=\".length)\n : undefined;\n if (value === undefined)\n continue;\n floor = logLevelChoices[value.toLowerCase()] ?? floor;\n }\n return floor;\n};\n/** Terminal sink: forwards records at or above `floor` to `sink`. */\nexport const makeConsoleLogger = (floor, sink = makePlainConsoleSink()) => Logger.make((options) => {\n if (LogLevel.isGreaterThanOrEqualTo(options.logLevel, floor)) {\n sink.log(options);\n }\n});\n/** Shared terminal logger for CLI entrypoints that do not need a run file. */\nexport const ConsoleLogLive = Layer.mergeAll(Logger.layer([makeConsoleLogger(consoleLogFloor(process.argv.slice(2)))]), Layer.succeed(MinimumLogLevel, \"Debug\"));\n/** Drops everything — the fallback when the log file cannot be opened. */\nconst noopLogger = Logger.make(() => { });\n/**\n * Debug run log for the whole CLI under `~/.alchemy/logs` (relocated by\n * `ALCHEMY_HOME` together with the rest of the auth state). Every run writes\n * `{timestamp}-pid{pid}.log` in logfmt at Debug level — profile/auth flows\n * and command failures record their full causes there even though the\n * terminal only shows the friendly message. Console output stays at Info+\n * unless `--log-level` lowers the floor (see {@link consoleLogFloor}).\n *\n * Commands that install their own loggers with `mergeWithExisting: true`\n * compose with this one; a replacing `Logger.layer` scopes it out for that\n * subtree only. Best-effort throughout: an unwritable `~/.alchemy` must\n * never take the CLI down with it.\n */\nexport const GlobalLogLive = Layer.unwrap(Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path;\n const dir = path.join(rootDir(), \"logs\");\n yield* fs.makeDirectory(dir, { recursive: true });\n // Prune stale run logs so the directory stays bounded.\n const now = yield* Clock.currentTimeMillis;\n const entries = yield* fs\n .readDirectory(dir)\n .pipe(Effect.catch(() => Effect.succeed([])));\n yield* Effect.forEach(entries, (entry) => Effect.gen(function* () {\n const file = path.join(dir, entry);\n const info = yield* fs.stat(file);\n const mtime = Option.getOrUndefined(info.mtime)?.getTime();\n if (mtime !== undefined &&\n now - mtime > Duration.toMillis(MAX_LOG_AGE)) {\n yield* fs.remove(file);\n }\n }).pipe(Effect.ignore), { discard: true });\n const stamp = new Date(yield* Clock.currentTimeMillis)\n .toISOString()\n .slice(0, 19)\n .replaceAll(\":\", \"-\");\n const file = path.join(dir, `${stamp}-pid${process.pid}.log`);\n return Layer.mergeAll(Logger.layer([\n makeConsoleLogger(consoleLogFloor(process.argv.slice(2))),\n Logger.formatLogFmt.pipe(Logger.toFile(file, { flag: \"a\" }), Effect.catch(() => Effect.succeed(noopLogger))),\n ]), Layer.succeed(MinimumLogLevel, \"Debug\"));\n}).pipe(Effect.catch(() => Effect.succeed(Layer.empty))));\n/** First line of every run log: enough context to read it standalone. */\nexport const logRunHeader = Effect.logDebug(`alchemy ${packageJson.version} pid=${process.pid} cwd=${process.cwd()} argv=${JSON.stringify(process.argv.slice(2))}`);\n//# sourceMappingURL=GlobalLog.js.map","import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\n/** The sole injected owner of terminal rendering and input for a CLI process. */\nexport class CliKit extends Context.Service()(\"Alchemy::CliKit\") {\n}\n/** Effectful service accessors for code that must defer acquisition to use time. */\nexport const accessors = {\n output: {\n info: (message) => Effect.flatMap(CliKit, (service) => service.output.info(message)),\n success: (message) => Effect.flatMap(CliKit, (service) => service.output.success(message)),\n warning: (message) => Effect.flatMap(CliKit, (service) => service.output.warning(message)),\n error: (message) => Effect.flatMap(CliKit, (service) => service.output.error(message)),\n },\n prompt: {\n text: (options) => Effect.flatMap(CliKit, (service) => service.prompt.text(options)),\n password: (options) => Effect.flatMap(CliKit, (service) => service.prompt.password(options)),\n confirm: (options) => Effect.flatMap(CliKit, (service) => service.prompt.confirm(options)),\n select: (options) => Effect.flatMap(CliKit, (service) => service.prompt.select(options)),\n multiSelect: (options) => Effect.flatMap(CliKit, (service) => service.prompt.multiSelect(options)),\n },\n};\nexport const ApplicationPresentation = Context.Reference(\"Alchemy::CliKit/ApplicationPresentation\", { defaultValue: () => \"inline\" });\n/** Pipeable presentation modifiers for {@link CliKit.application}. */\nexport const Application = {\n alternate: (effect) => effect.pipe(Effect.provideService(ApplicationPresentation, \"alternate\")),\n};\n//# sourceMappingURL=CliKit.js.map","import { jsx as _jsx } from \"@alchemy.run/sigil/jsx-runtime\";\n/** @jsxImportSource @alchemy.run/sigil */\nimport { useWindowSize } from \"@alchemy.run/sigil\";\nimport { createContext, useContext, useMemo } from \"@alchemy.run/sigil/react\";\nimport { glyphsFor, theme } from \"../../../Util/Theme.js\";\nconst defaults = {\n input: false,\n columns: 80,\n rows: 24,\n colors: false,\n unicode: true,\n alternateScreen: false,\n};\nconst EnvironmentContext = createContext(defaults);\nfunction ObservingEnvironment({ capabilities, children, }) {\n const window = useWindowSize();\n const environment = useMemo(() => ({ ...capabilities, columns: window.columns, rows: window.rows }), [capabilities, window.columns, window.rows]);\n return (_jsx(EnvironmentContext.Provider, { value: environment, children: children }));\n}\nexport function CliEnvironment({ capabilities, observeWindow = false, children, }) {\n return observeWindow ? (_jsx(ObservingEnvironment, { capabilities: capabilities, children: children })) : (_jsx(EnvironmentContext.Provider, { value: capabilities, children: children }));\n}\nexport const useCliEnvironment = () => useContext(EnvironmentContext);\nexport const useGlyphs = () => glyphsFor(useCliEnvironment().unicode);\n/** Border style matching the terminal's Unicode capability. */\nexport const useBorderStyle = () => useCliEnvironment().unicode ? \"single\" : \"classic\";\nconst asciiKeyHint = {\n enter: \"enter\",\n upDown: \"up/down\",\n leftRight: \"left/right\",\n escape: \"esc\",\n space: \"space\",\n tab: \"tab\",\n yesNo: \"y/n\",\n};\n/** Key-hint labels for `KeyBar` footers, honoring the ASCII fallback. */\nexport const useKeyGlyphs = () => useCliEnvironment().unicode ? theme.keyHint : asciiKeyHint;\n//# sourceMappingURL=Environment.js.map","import { jsx as _jsx } from \"@alchemy.run/sigil/jsx-runtime\";\n/** @jsxImportSource @alchemy.run/sigil */\nimport { Hyperlink as SigilHyperlink, Text as SigilText, } from \"@alchemy.run/sigil\";\nimport { theme } from \"../../../Util/Theme.js\";\nimport { useCliEnvironment } from \"./Environment.js\";\n/** CliKit typography primitive. Consumers never import Sigil directly. */\nexport function Text({ tone = \"default\", color, backgroundColor, bold, dimColor, italic, underline, strikethrough, inverse, ...props }) {\n const { colors } = useCliEnvironment();\n return (_jsx(SigilText, { ...props, color: colors\n ? (color ??\n (tone === \"default\" || tone === \"muted\"\n ? undefined\n : theme.color[tone]))\n : undefined, backgroundColor: colors ? backgroundColor : undefined, bold: colors ? bold : undefined, dimColor: colors ? (dimColor ?? tone === \"muted\") : undefined, italic: colors ? italic : undefined, underline: colors ? underline : undefined, strikethrough: colors ? strikethrough : undefined, inverse: colors ? inverse : undefined }));\n}\nexport function Link({ href, children }) {\n const { colors } = useCliEnvironment();\n const label = children ?? href;\n return (_jsx(SigilHyperlink, { url: href, fallback: label !== href, color: colors ? theme.color.info : undefined, underline: colors || undefined, children: label }));\n}\n//# sourceMappingURL=Typography.js.map","import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from \"@alchemy.run/sigil/jsx-runtime\";\n/** @jsxImportSource @alchemy.run/sigil */\nimport { Box as SigilBox } from \"@alchemy.run/sigil\";\nimport { forwardRef } from \"@alchemy.run/sigil/react\";\nimport { theme } from \"../../../Util/Theme.js\";\nimport { useCliEnvironment, useGlyphs } from \"./Environment.js\";\nimport { Text } from \"./Typography.js\";\n// Windowed list that clips to the rows its container leaves over; it draws no\n// colors of its own, so it needs no theme-aware wrapper.\nexport { VirtualList } from \"@alchemy.run/sigil\";\n/** Theme-aware Sigil container used by CliKit layouts. */\nexport const Box = forwardRef(function Box(props, ref) {\n const { colors } = useCliEnvironment();\n const { borderColor: _borderColor, borderTopColor: _borderTopColor, borderBottomColor: _borderBottomColor, borderLeftColor: _borderLeftColor, borderRightColor: _borderRightColor, borderBackgroundColor: _borderBackgroundColor, borderTopBackgroundColor: _borderTopBackgroundColor, borderBottomBackgroundColor: _borderBottomBackgroundColor, borderLeftBackgroundColor: _borderLeftBackgroundColor, borderRightBackgroundColor: _borderRightBackgroundColor, backgroundColor: _backgroundColor, borderDimColor: _borderDimColor, borderTopDimColor: _borderTopDimColor, borderBottomDimColor: _borderBottomDimColor, borderLeftDimColor: _borderLeftDimColor, borderRightDimColor: _borderRightDimColor, ...colorless } = props;\n return _jsx(SigilBox, { ...(colors ? props : colorless), ref: ref });\n});\n/** Vertical layout primitive. */\nexport function Stack({ children, gap = 0, ...props }) {\n return (_jsx(Box, { flexDirection: \"column\", gap: gap, ...props, children: children }));\n}\n/** Horizontal layout primitive. */\nexport function Row({ children, gap = 1, align = \"flex-start\", justify = \"flex-start\", ...props }) {\n return (_jsx(Box, { flexDirection: \"row\", gap: gap, alignItems: align, justifyContent: justify, ...props, children: children }));\n}\nexport function Heading({ children, glyph = true }) {\n const glyphs = useGlyphs();\n return (_jsx(Box, { children: _jsxs(Text, { bold: true, color: theme.color.brand, children: [glyph ? `${glyphs.section} ` : null, children] }) }));\n}\nexport function SectionHeading({ children, annotation }) {\n return (_jsxs(Text, { children: [_jsx(Text, { bold: true, color: theme.color.brand, children: children }), annotation === undefined ? null : (_jsxs(Text, { tone: \"muted\", children: [\" \\u00B7 \", annotation] }))] }));\n}\nexport function Gutter({ depth = 1, children }) {\n return (_jsx(Box, { paddingLeft: Math.max(0, depth) * theme.space.indent, children: _jsx(Box, { flexDirection: \"column\", flexGrow: 1, children: children }) }));\n}\n/**\n * The centering clamp shared by every windowed list: a window of `count` rows\n * over `length` items keeping `cursor` as close to the middle as the list\n * bounds allow.\n */\nexport const listWindow = (length, cursor, count) => {\n const start = Math.max(0, Math.min(cursor - Math.floor(count / 2), length - count));\n return { start, end: Math.min(length, start + count) };\n};\n/**\n * Horizontal window over variable-width items (tab chips): expands around\n * `active` — alternating right/left so the selection stays roughly centered —\n * until `available` columns are exhausted. Returns `[start, end)` like\n * {@link listWindow}; `active` is always inside the window.\n */\nexport const tabsWindow = (widths, active, available, gap = 1) => {\n if (widths.length === 0)\n return { start: 0, end: 0 };\n const cursor = Math.max(0, Math.min(active, widths.length - 1));\n let start = cursor;\n let end = cursor + 1;\n let used = widths[cursor];\n let takeRight = true;\n while (true) {\n const canRight = end < widths.length && used + gap + widths[end] <= available;\n const canLeft = start > 0 && used + gap + widths[start - 1] <= available;\n if (!canRight && !canLeft)\n break;\n if ((takeRight && canRight) || !canLeft) {\n used += gap + widths[end];\n end++;\n }\n else {\n start--;\n used += gap + widths[start];\n }\n takeRight = !takeRight;\n }\n return { start, end };\n};\n/**\n * Window for prompt lists that render \"↑ N more\"/\"↓ N more\" indicator rows:\n * reserves two of `visibleCount`'s rows for the indicators when overflowing so\n * the widget stays within the requested height.\n */\nexport const overflowListWindow = (length, cursor, visibleCount) => listWindow(length, cursor, Math.max(1, length > visibleCount ? visibleCount - 2 : visibleCount));\nexport function Viewport({ items, cursor = 0, height, renderItem, getKey, empty, }) {\n if (items.length === 0)\n return _jsx(_Fragment, { children: empty });\n const selected = Math.max(0, Math.min(cursor, items.length - 1));\n const { start, end } = listWindow(items.length, selected, Math.max(1, height));\n return (_jsx(Stack, { children: items.slice(start, end).map((item, offset) => {\n const index = start + offset;\n return (_jsx(Box, { flexDirection: \"column\", children: renderItem(item, index) }, getKey(item, index)));\n }) }));\n}\n//# sourceMappingURL=Layout.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"@alchemy.run/sigil/jsx-runtime\";\n/** @jsxImportSource @alchemy.run/sigil */\nimport { useAnimation } from \"@alchemy.run/sigil\";\nimport { stringWidth } from \"@alchemy.run/sigil/ansi\";\nimport { spinnerFramesFor, statusColor, theme, } from \"../../../Util/Theme.js\";\nimport { useBorderStyle, useCliEnvironment, useGlyphs, } from \"./Environment.js\";\nimport { Box, tabsWindow } from \"./Layout.js\";\nimport { Text } from \"./Typography.js\";\nexport function Status({ variant = \"info\", children, detail }) {\n const glyphs = useGlyphs();\n return (_jsxs(Box, { gap: 1, flexWrap: \"wrap\", children: [_jsx(Text, { color: statusColor(variant), children: glyphs[variant] }), _jsx(Text, { color: variant === \"error\" ? statusColor(variant) : undefined, children: children }), detail === undefined ? null : _jsxs(Text, { tone: \"muted\", children: [\"\\u00B7 \", detail] })] }));\n}\n/**\n * Compact application notice. Severity is carried by the status glyph and\n * its colour alone — the same vocabulary as transcript lines — so a notice\n * row never needs a rail of its own.\n */\nexport function Toast({ variant = \"info\", children, detail }) {\n return (_jsx(Status, { variant: variant, detail: detail, children: children }));\n}\n/** Glyph + bold title on one row, body indented beneath it. */\nexport function Alert({ variant = \"info\", title, children, detail, }) {\n const glyphs = useGlyphs();\n return (_jsxs(Box, { flexDirection: \"column\", children: [_jsxs(Box, { gap: 1, alignItems: \"center\", children: [_jsx(Text, { bold: true, color: statusColor(variant), children: glyphs[variant] }), title === undefined ? null : _jsx(Text, { bold: true, children: title }), detail === undefined ? null : _jsxs(Text, { tone: \"muted\", children: [\"\\u00B7 \", detail] })] }), _jsx(Box, { paddingLeft: theme.space.indent, children: _jsx(Text, { tone: \"muted\", children: children }) })] }));\n}\nexport function KeyBar({ keys, marginTop = 1, inline = false, before, after, divider = false, }) {\n const borderStyle = useBorderStyle();\n const sectionBorder = {\n borderStyle,\n borderLeft: true,\n borderRight: false,\n borderTop: false,\n borderBottom: false,\n borderColor: theme.color.muted,\n borderDimColor: true,\n marginLeft: 1,\n paddingLeft: 1,\n };\n return (_jsxs(Box, { width: inline ? undefined : \"100%\", flexWrap: \"wrap\", marginTop: marginTop, paddingLeft: before === undefined ? theme.space.indent : 0, children: [before === undefined ? null : _jsx(Box, { children: before }), _jsx(Box, { flexWrap: \"wrap\", ...(divider && before !== undefined\n ? sectionBorder\n : before === undefined\n ? {}\n : { marginLeft: 1 }), children: keys.map(([key, label], index) => (_jsxs(Box, { children: [index === 0 ? null : _jsx(Text, { tone: \"muted\", children: \" \\u2022 \" }), _jsxs(Text, { children: [_jsx(Text, { bold: true, color: theme.color.brand, children: key }), _jsxs(Text, { tone: \"muted\", children: [\" \", label] })] })] }, `${key}:${label}`))) }), after === undefined ? null : (_jsx(Box, { ...(divider\n ? sectionBorder\n : {\n marginLeft: 1,\n }), children: after }))] }));\n}\nexport const useSpinnerFrame = () => {\n const { unicode } = useCliEnvironment();\n const frames = spinnerFramesFor(unicode);\n const { frame } = useAnimation({ interval: 80 });\n return frames[frame % frames.length] ?? \"-\";\n};\nexport function SpinnerGlyph({ color }) {\n return _jsx(Text, { color: color ?? theme.color.info, children: useSpinnerFrame() });\n}\nexport function Spinner({ label, detail }) {\n return (_jsxs(Box, { gap: 1, children: [_jsx(SpinnerGlyph, {}), _jsx(Text, { children: label }), detail === undefined ? null : _jsx(Text, { tone: \"muted\", children: detail })] }));\n}\nexport function Tabs({ tabs, active }) {\n const glyphs = useGlyphs();\n const { columns } = useCliEnvironment();\n const gap = 1;\n const activeIndex = Math.max(0, tabs.findIndex((tab) => tab.id === active));\n // chip width = paddingX (2) + optional marker glyph + space + label\n const widths = tabs.map((tab) => 2 +\n stringWidth(tab.label) +\n (tab.marked ? stringWidth(glyphs.selected) + 1 : 0));\n const totalWidth = widths.reduce((sum, width) => sum + width, 0) +\n Math.max(0, tabs.length - 1) * gap;\n const contentWidth = Math.max(1, columns - theme.space.indent);\n const { start, end } = totalWidth <= contentWidth\n ? { start: 0, end: tabs.length }\n : // reserve an arrow cell + gap on each side so the window stays put\n // whether or not the edge arrows render\n tabsWindow(widths, activeIndex, Math.max(1, contentWidth - 2 * (1 + gap)), gap);\n return (_jsxs(Box, { width: \"100%\", gap: gap, paddingLeft: theme.space.indent, marginBottom: 1, \"aria-role\": \"tablist\", children: [start > 0 ? _jsx(Text, { tone: \"muted\", children: glyphs.overflowLeft }) : null, tabs.slice(start, end).map((tab) => {\n const selected = tab.id === active;\n return (_jsx(Box, { paddingX: 1, backgroundColor: selected ? theme.paint.interactive : undefined, \"aria-role\": \"tab\", \"aria-label\": tab.label, \"aria-state\": { selected }, children: _jsxs(Text, { bold: selected, color: selected ? theme.color.onAccent : undefined, dimColor: !selected, children: [tab.marked ? (_jsxs(Text, { color: selected ? theme.color.onAccent : theme.color.brand, children: [glyphs.selected, \" \"] })) : null, tab.label] }) }, tab.id));\n }), end < tabs.length ? (_jsx(Text, { tone: \"muted\", children: glyphs.overflowRight })) : null] }));\n}\n//# sourceMappingURL=Feedback.js.map","import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from \"@alchemy.run/sigil/jsx-runtime\";\n/** @jsxImportSource @alchemy.run/sigil */\nimport { measureElement, useCursor, useInput, usePaste, useStdout, } from \"@alchemy.run/sigil\";\nimport { useEffect, useLayoutEffect, useRef, useState, } from \"@alchemy.run/sigil/react\";\nimport { stringWidth } from \"@alchemy.run/sigil/ansi\";\nimport { theme } from \"../../../Util/Theme.js\";\nimport { copyToClipboard, truncate } from \"../../../Util/Terminal.js\";\nimport { useCliEnvironment, useGlyphs, useKeyGlyphs } from \"./Environment.js\";\nimport { KeyBar, Spinner } from \"./Feedback.js\";\nimport { Box, overflowListWindow } from \"./Layout.js\";\nimport { Link, Text } from \"./Typography.js\";\n/** Backend facade for custom screens; callers never need to import Sigil. */\nexport const useTerminalInput = (handler, options) => {\n return useInput((input, key) => handler(input, {\n up: key.upArrow,\n down: key.downArrow,\n left: key.leftArrow,\n right: key.rightArrow,\n home: key.home,\n end: key.end,\n pageUp: key.pageUp,\n pageDown: key.pageDown,\n enter: key.return,\n escape: key.escape,\n backspace: key.backspace,\n delete: key.delete,\n tab: key.tab,\n shift: key.shift,\n ctrl: key.ctrl,\n meta: key.meta,\n }), { isActive: options?.active ?? true });\n};\n/** Bracketed-paste input scoped the same way as {@link useTerminalInput}. */\nexport const useTerminalPaste = (handler, options) => {\n usePaste(handler, { isActive: options?.active ?? true });\n};\nexport const useTerminalSize = () => {\n const { columns, rows } = useCliEnvironment();\n return { columns, rows };\n};\nexport const useListNavigation = (length, initialIndex = 0) => {\n const [cursor, setCursor] = useState(initialIndex);\n const clamped = Math.max(0, Math.min(cursor, Math.max(0, length - 1)));\n const move = (delta) => setCursor((current) => {\n if (length === 0)\n return 0;\n // Clamp before wrapping: after a filter shrinks the list the raw state\n // can point past the end, and wrapping from there jumps arbitrarily.\n const base = Math.max(0, Math.min(current, length - 1));\n return (((base + delta) % length) + length) % length;\n });\n return { cursor: clamped, move, setCursor };\n};\n/** Step `delta` rows from `cursor`, wrapping and skipping disabled rows. */\nexport const moveSkippingDisabled = (disabled, cursor, delta) => {\n const length = disabled.length;\n if (length === 0)\n return 0;\n for (let offset = 1; offset <= length; offset++) {\n const next = (((cursor + delta * offset) % length) + length) % length;\n if (!disabled[next])\n return next;\n }\n return cursor;\n};\n/**\n * Jump to `target` (clamped, no wrap), settling on the nearest enabled row in\n * the jump direction and falling back to the other direction. Used for\n * Home/End and PageUp/PageDown in list prompts.\n */\nexport const jumpSkippingDisabled = (disabled, cursor, target) => {\n const clamped = Math.max(0, Math.min(disabled.length - 1, target));\n if (!disabled[clamped])\n return clamped;\n const direction = clamped >= cursor ? 1 : -1;\n for (let next = clamped + direction; next >= 0 && next < disabled.length; next += direction) {\n if (!disabled[next])\n return next;\n }\n for (let next = clamped - direction; next >= 0 && next < disabled.length; next -= direction) {\n if (!disabled[next])\n return next;\n }\n return cursor;\n};\n/** \"↑ N more\" / \"↓ N more\" indicator row shared by windowed prompt lists. */\nfunction OverflowRow({ direction, count, }) {\n const glyphs = useGlyphs();\n if (count <= 0)\n return null;\n return (_jsxs(Text, { tone: \"muted\", children: [\" \", direction === \"up\" ? glyphs.overflowUp : glyphs.overflowDown, \" \", count, \" \", \"more\"] }));\n}\n/**\n * List-cursor column shared by every focusable row (prompt lists, the\n * edit-accounts list, the profile dashboard): the focused row carries the\n * pointer glyph, every other row a same-width blank so labels stay aligned.\n * Focus is a shape, not a tint, so it survives ASCII and no-colour terminals.\n */\nexport function Pointer({ focused }) {\n const glyphs = useGlyphs();\n return (_jsx(Text, { color: theme.paint.focus, bold: true, children: focused ? glyphs.pointer : \" \" }));\n}\n/**\n * Focused rows paint their label in the same brand colour as the pointer so\n * the cursor reads as one block; unfocused labels stay the plain foreground,\n * leaving green to status glyphs alone.\n */\nconst focusedLabelColor = (focused) => focused ? theme.paint.focus : undefined;\n/**\n * Width of the label column when descriptions sit beside labels: the widest\n * label plus one cell, so every description starts in the same column\n * (labels and descriptions read as two columns rather than a ragged sentence).\n * Sticky/heading rows are excluded — they never carry a description.\n */\nconst labelColumnWidth = (labels) => Math.max(0, ...labels.map(({ label, sticky }) => (sticky ? 0 : stringWidth(label)))) + 1;\n/** Pure menu presentation used by select prompts and custom applications. */\nexport function Menu({ choices, cursor, selected, visibleCount = 12, empty = \"No choices.\", descriptionPlacement = \"inline\", }) {\n const glyphs = useGlyphs();\n if (choices.length === 0)\n return _jsx(Text, { tone: \"muted\", children: empty });\n // A sticky heading renders outside the window, in addition to the overflow\n // rows the shared windowing already reserves.\n const { start, end } = overflowListWindow(choices.length, cursor, visibleCount);\n const stickyIndex = start === 0\n ? -1\n : choices.findLastIndex((choice, index) => index < start && choice.sticky);\n const visible = [\n ...(stickyIndex === -1 ? [] : [stickyIndex]),\n ...Array.from({ length: end - start }, (_, offset) => start + offset),\n ];\n const alignDescriptions = descriptionPlacement === \"inline\" &&\n choices.some((choice) => choice.description !== undefined);\n const labelWidth = alignDescriptions ? labelColumnWidth(choices) : undefined;\n return (_jsxs(Box, { flexDirection: \"column\", \"aria-role\": \"listbox\", \"aria-state\": { multiselectable: selected !== undefined }, children: [_jsx(OverflowRow, { direction: \"up\", count: start }), visible.map((index) => {\n const choice = choices[index];\n if (choice === undefined)\n return null;\n const focused = index === cursor;\n const checked = selected?.has(index);\n const disabled = choice.disabled !== undefined && choice.disabled !== false;\n const previous = choices[index - 1];\n const showGroup = choice.group !== undefined &&\n (index === start || previous?.group !== choice.group);\n return (_jsxs(Box, { flexDirection: \"column\", marginTop: showGroup && index !== visible[0] ? 1 : 0, children: [showGroup ? (_jsx(Box, { paddingLeft: theme.space.indent, children: _jsx(Text, { bold: true, tone: \"muted\", children: choice.group.toUpperCase() }) })) : null, _jsxs(Box, { gap: 1, paddingRight: 1, paddingLeft: choice.indent ?? 0, \"aria-role\": \"option\", \"aria-label\": choice.label, \"aria-state\": {\n disabled,\n selected: selected === undefined ? focused : checked,\n }, children: [_jsx(Pointer, { focused: focused }), selected === undefined ? null : (_jsx(Text, { color: checked ? theme.color.success : theme.color.muted, dimColor: disabled, children: checked ? glyphs.checked : glyphs.unchecked })), _jsxs(Box, { flexDirection: descriptionPlacement === \"inline\" ? \"row\" : \"column\", flexGrow: 1, gap: descriptionPlacement === \"inline\" ? 1 : 0, children: [_jsx(Box, { width: choice.sticky ? undefined : labelWidth, flexShrink: 0, children: _jsx(Text, { bold: focused || choice.sticky || checked, color: focusedLabelColor(focused) ??\n (choice.tone === \"info\" ? theme.color.info : undefined), dimColor: disabled, children: choice.label }) }), choice.description === undefined ? null : (_jsx(Text, { tone: \"muted\", wrap: \"truncate-end\", children: choice.description }))] }), typeof choice.disabled === \"string\" ? (_jsx(Text, { tone: \"muted\", children: choice.disabled })) : null] })] }, index));\n }), _jsx(OverflowRow, { direction: \"down\", count: choices.length - end })] }));\n}\nconst graphemeSegmenter = new Intl.Segmenter();\n/**\n * Split into user-perceived characters so cursor movement and deletion never\n * land inside a surrogate pair or emoji cluster.\n */\nconst toGraphemes = (value) => Array.from(graphemeSegmenter.segment(value), (segment) => segment.segment);\n/**\n * Normalize text before inserting it into a single-line field. Sigil reports\n * bracketed paste separately, but pasted content can still contain newlines,\n * tabs or other control characters that do not belong in the value.\n */\nexport const sanitizeTextInsert = (input) => \n// eslint-disable-next-line no-control-regex\ninput.replace(/[\\u0000-\\u001f\\u007f]/g, \"\");\n/** Readline-style whitespace word boundary to the left of `cursor`. */\nconst wordBoundaryLeft = (chars, cursor) => {\n let index = cursor;\n while (index > 0 && chars[index - 1] === \" \")\n index--;\n while (index > 0 && chars[index - 1] !== \" \")\n index--;\n return index;\n};\n/** Readline-style whitespace word boundary to the right of `cursor`. */\nconst wordBoundaryRight = (chars, cursor) => {\n let index = cursor;\n while (index < chars.length && chars[index] === \" \")\n index++;\n while (index < chars.length && chars[index] !== \" \")\n index++;\n return index;\n};\n/**\n * Horizontal scroll window for a single-line field: which grapheme range fits\n * in `avail` display cells while keeping the cursor visible. One cell is\n * reserved for the cursor sitting past the last character.\n */\nconst visibleWindow = (chars, cursor, avail) => {\n const budget = Math.max(1, avail - 1);\n const widths = chars.map((char) => stringWidth(char));\n let before = 0;\n for (let index = 0; index < cursor; index++)\n before += widths[index] ?? 0;\n let start = 0;\n if (before > budget) {\n // Scrolled: pin the cursor near the right edge of the window.\n let used = 0;\n while (start < cursor && before - used > budget) {\n used += widths[start] ?? 0;\n start++;\n }\n }\n let end = start;\n let total = 0;\n while (end < chars.length && total + (widths[end] ?? 0) <= budget) {\n total += widths[end] ?? 0;\n end++;\n }\n return { start, end };\n};\n/**\n * Single-line editor with insertion, deletion, home/end, word-wise movement\n * and the common readline kill bindings (Ctrl+U/K/W, Alt+Backspace). Long\n * values scroll horizontally instead of wrapping, so the terminal cursor\n * always sits on the field's own row.\n */\nexport function TextField({ placeholder, initialValue = \"\", value: controlledValue, mask, onSubmit, onChange, onCancel, active, ariaLabel, }) {\n // Prompts are serialized by the CliKit runtime, so an enabled field owns\n // the input stream outright — no Sigil focus negotiation. (Coupling this to\n // useFocus({autoFocus}) silently disabled the field whenever any other\n // focusable was already mounted.)\n const inputActive = active ?? true;\n const [internalValue, setInternalValue] = useState(initialValue);\n const value = controlledValue ?? internalValue;\n const chars = toGraphemes(value);\n const [cursor, setCursor] = useState(() => toGraphemes(controlledValue ?? initialValue).length);\n const fieldRef = useRef(null);\n const [metrics, setMetrics] = useState({ x: 0, y: 0, measured: false });\n const { setCursorPosition } = useCursor();\n const { columns } = useCliEnvironment();\n useEffect(() => {\n setCursor((current) => Math.min(current, toGraphemes(value).length));\n }, [value]);\n const update = (nextChars, nextCursor) => {\n const next = nextChars.join(\"\");\n if (controlledValue === undefined)\n setInternalValue(next);\n setCursor(Math.max(0, Math.min(nextChars.length, nextCursor)));\n onChange?.(next);\n };\n useTerminalInput((input, key) => {\n if (key.enter)\n onSubmit(value);\n else if (key.escape)\n onCancel?.();\n else if (key.left)\n setCursor(key.ctrl || key.meta\n ? wordBoundaryLeft(chars, cursor)\n : Math.max(0, cursor - 1));\n else if (key.right)\n setCursor(key.ctrl || key.meta\n ? wordBoundaryRight(chars, cursor)\n : Math.min(chars.length, cursor + 1));\n // Sigil distinguishes physical Backspace from Delete.\n else if (key.backspace && cursor > 0) {\n const target = key.meta ? wordBoundaryLeft(chars, cursor) : cursor - 1;\n update([...chars.slice(0, target), ...chars.slice(cursor)], target);\n }\n else if (key.delete && cursor < chars.length)\n update([...chars.slice(0, cursor), ...chars.slice(cursor + 1)], cursor);\n else if (key.ctrl && input === \"d\" && cursor < chars.length)\n update([...chars.slice(0, cursor), ...chars.slice(cursor + 1)], cursor);\n else if (key.ctrl && input === \"w\" && cursor > 0) {\n const target = wordBoundaryLeft(chars, cursor);\n update([...chars.slice(0, target), ...chars.slice(cursor)], target);\n }\n else if (key.ctrl && input === \"u\")\n update(chars.slice(cursor), 0);\n else if (key.ctrl && input === \"k\")\n update(chars.slice(0, cursor), cursor);\n else if (key.home || (key.ctrl && input === \"a\"))\n setCursor(0);\n else if (key.end || (key.ctrl && input === \"e\"))\n setCursor(chars.length);\n else if (key.meta && input === \"b\")\n setCursor(wordBoundaryLeft(chars, cursor));\n else if (key.meta && input === \"f\")\n setCursor(wordBoundaryRight(chars, cursor));\n else if (!key.ctrl && !key.meta && !key.tab) {\n const inserted = toGraphemes(sanitizeTextInsert(input));\n if (inserted.length > 0) {\n update([...chars.slice(0, cursor), ...inserted, ...chars.slice(cursor)], cursor + inserted.length);\n }\n }\n }, { active: inputActive });\n useTerminalPaste((pasted) => {\n const inserted = toGraphemes(sanitizeTextInsert(pasted));\n if (inserted.length === 0)\n return;\n update([...chars.slice(0, cursor), ...inserted, ...chars.slice(cursor)], cursor + inserted.length);\n }, { active: inputActive });\n const shownChars = mask === undefined ? chars : chars.map(() => mask);\n // Available width = terminal width minus the field's left offset. The box's\n // own measured width is useless here: it shrinks to its content (flexGrow\n // only affects height in a column parent), so using it collapses the scroll\n // window to whatever is currently typed.\n const avail = Math.max(4, columns - (metrics.measured ? metrics.x : 0) - 1);\n const { start, end } = visibleWindow(shownChars, cursor, avail);\n const display = shownChars.length === 0\n ? (placeholder ?? \" \")\n : `${shownChars.slice(start, end).join(\"\")}${cursor === shownChars.length ? \" \" : \"\"}`;\n // Cursor placement must happen DURING render: useCursor only records the\n // position in a ref and propagates it to the renderer from an insertion\n // effect, which runs BEFORE layout effects in the same commit. Setting the\n // position from a layout effect therefore paints every frame with the\n // previous keystroke's cursor (off by one while typing and erasing). The\n // ref write is render-safe — propagation is commit-gated, so abandoned\n // concurrent renders never reach the terminal.\n setCursorPosition(inputActive && metrics.measured\n ? {\n x: metrics.x + stringWidth(shownChars.slice(start, cursor).join(\"\")),\n y: metrics.y,\n }\n : undefined);\n // Measuring stays post-layout: the Box ref only exists after mutation.\n // A metrics change re-renders, which re-runs the render-time cursor\n // placement above with the fresh offsets.\n useLayoutEffect(() => {\n if (fieldRef.current === null)\n return;\n const { x, y } = measureElement(fieldRef.current);\n setMetrics((current) => current.measured && current.x === x && current.y === y\n ? current\n : { x, y, measured: true });\n });\n return (_jsx(Box, { ref: fieldRef, \"aria-role\": \"textbox\", \"aria-label\": ariaLabel, children: _jsx(Text, { tone: shownChars.length === 0 ? \"muted\" : \"default\", wrap: \"truncate-end\", children: display }) }));\n}\nconst stateColor = (variant) => variant === undefined || variant === \"neutral\"\n ? undefined\n : theme.color[variant === \"error\" ? \"danger\" : variant];\nexport function CycleList({ choices, cursor, indices, visibleCount = 12, }) {\n const glyphs = useGlyphs();\n const { start, end } = overflowListWindow(choices.length, cursor, visibleCount);\n const labelWidth = labelColumnWidth(choices);\n // The state word (\"add\", \"remove\", …) gets its own column too, so the\n // descriptions line up whether or not a row's current state carries one.\n const stateWidth = Math.max(0, ...choices.flatMap((choice) => choice.states.map((state) => state.label === undefined ? 0 : stringWidth(state.label))));\n return (_jsxs(Box, { flexDirection: \"column\", children: [_jsx(OverflowRow, { direction: \"up\", count: start }), choices.slice(start, end).map((choice, offset) => {\n const index = start + offset;\n const state = choice.states[indices[index] ?? 0];\n const focused = index === cursor;\n const color = stateColor(state?.variant);\n return (_jsxs(Box, { gap: 1, paddingRight: 1, children: [_jsx(Pointer, { focused: focused }), _jsx(Text, { color: color, dimColor: color === undefined, children: state?.icon ?? glyphs.bullet }), _jsx(Box, { width: labelWidth, flexShrink: 0, children: _jsx(Text, { bold: true, color: focusedLabelColor(focused), children: choice.label }) }), stateWidth === 0 ? null : (_jsx(Box, { width: stateWidth, flexShrink: 0, children: state?.label === undefined ? null : (_jsx(Text, { color: color, children: state.label })) })), choice.description === undefined ? null : (_jsx(Text, { tone: \"muted\", children: choice.description }))] }, index));\n }), _jsx(OverflowRow, { direction: \"down\", count: choices.length - end })] }));\n}\nexport const useCycleNavigation = (stateCounts) => {\n const { cursor, move, setCursor } = useListNavigation(stateCounts.length);\n const [indices, setIndices] = useState(() => stateCounts.map(() => 0));\n const cycle = (delta) => setIndices((current) => current.map((value, index) => {\n if (index !== cursor)\n return value;\n const count = stateCounts[index] ?? 0;\n return count <= 0 ? 0 : (value + delta + count) % count;\n }));\n return { cursor, indices, move, setCursor, cycle };\n};\n/**\n * Yes/no keyboard handling shared by `InlineConfirm` and the confirm prompt\n * screen: arrows/tab toggle, Enter commits, y/n answer directly.\n */\nexport const useConfirmKeys = ({ initialValue = false, active, onSubmit, onCancel, }) => {\n const [value, setValue] = useState(initialValue);\n useTerminalInput((input, key) => {\n if (key.escape)\n onCancel?.();\n else if (key.left || key.right || key.tab || key.up || key.down)\n setValue((current) => !current);\n else if (key.enter)\n onSubmit(value);\n else if (key.ctrl || key.meta)\n return;\n else if (input.toLowerCase() === \"y\")\n onSubmit(true);\n else if (input.toLowerCase() === \"n\")\n onSubmit(false);\n }, { active: active ?? true });\n return value;\n};\nexport function InlineConfirm({ message, initialValue = false, confirmLabel = \"Yes\", cancelLabel = \"No\", active, onSubmit, onCancel, }) {\n const keys = useKeyGlyphs();\n const value = useConfirmKeys({ initialValue, active, onSubmit, onCancel });\n return (_jsxs(Box, { flexDirection: \"column\", gap: 1, children: [_jsx(Text, { bold: true, color: theme.color.brand, children: message }), _jsx(ChoiceGroup, { value: value, choices: [\n { value: true, label: confirmLabel },\n { value: false, label: cancelLabel },\n ] }), _jsx(KeyBar, { marginTop: 0, keys: [\n [\n confirmLabel === \"Yes\" && cancelLabel === \"No\"\n ? keys.yesNo\n : keys.leftRight,\n \"choose\",\n ],\n [keys.enter, \"confirm\"],\n [keys.escape, \"cancel\"],\n ] })] }));\n}\nexport function ChoiceGroup({ choices, value, orientation = \"horizontal\", active = true, onChange, }) {\n const selected = Math.max(0, choices.findIndex((choice) => choice.value === value));\n useTerminalInput((_input, key) => {\n if (onChange === undefined || choices.length === 0)\n return;\n const previous = key.tab && key.shift\n ? true\n : orientation === \"horizontal\"\n ? key.left\n : key.up;\n const next = key.tab || (orientation === \"horizontal\" ? key.right : key.down);\n if (!previous && !next)\n return;\n const delta = previous ? -1 : 1;\n const index = (selected + delta + choices.length) % choices.length;\n onChange(choices[index].value);\n }, { active: active && onChange !== undefined });\n return (_jsx(Box, { gap: orientation === \"horizontal\" ? 1 : 0, paddingLeft: theme.space.indent, flexDirection: orientation === \"horizontal\" ? \"row\" : \"column\", \"aria-role\": \"radiogroup\", children: choices.map((choice) => {\n const selected = choice.value === value;\n return (_jsxs(Box, { paddingX: 1, backgroundColor: selected ? theme.paint.interactive : undefined, \"aria-role\": \"radio\", \"aria-label\": choice.label, \"aria-state\": { checked: selected }, children: [_jsx(Text, { bold: selected, color: selected ? theme.color.onAccent : undefined, children: choice.label }), choice.description === undefined ? null : (_jsxs(Text, { tone: \"muted\", children: [\" \\u00B7 \", choice.description] }))] }, choice.label));\n }) }));\n}\n/** Browser/OAuth waiting screen with URL controls and manual-entry fallback. */\nexport function ExternalWait({ message, waitingLabel, url, code, openFailed = false, onOpen, allowManualInput = true, inputLabel, placeholder, validate, onSubmit, onCancel, }) {\n const { stdout } = useStdout();\n const glyphs = useGlyphs();\n const keyGlyphs = useKeyGlyphs();\n const [manual, setManual] = useState(false);\n const [showFull, setShowFull] = useState(false);\n const [copied, setCopied] = useState(false);\n const [browserFailed, setBrowserFailed] = useState(openFailed);\n const [error, setError] = useState();\n const copiedTimer = useRef(undefined);\n useEffect(() => () => {\n clearTimeout(copiedTimer.current);\n }, []);\n const { columns } = useTerminalSize();\n // Ctrl+C is handled centrally by the screen runner (SigilRuntime.run).\n useTerminalInput((input, key) => {\n if (manual) {\n if (key.escape) {\n setError(undefined);\n setManual(false);\n }\n return;\n }\n const shortcut = input.toLowerCase();\n if (key.enter && allowManualInput)\n setManual(true);\n else if (key.escape)\n onCancel();\n // Ctrl+C must fall through to the runner's cancel guard, not copy the URL.\n else if (key.ctrl || key.meta)\n return;\n else if (shortcut === \"u\")\n setShowFull((current) => !current);\n else if (shortcut === \"o\" && onOpen !== undefined) {\n setBrowserFailed(false);\n void onOpen().catch(() => setBrowserFailed(true));\n }\n else if (shortcut === \"c\" && (code ?? url) !== undefined) {\n copyToClipboard(code ?? url, stdout ?? process.stdout);\n setCopied(true);\n clearTimeout(copiedTimer.current);\n copiedTimer.current = setTimeout(() => setCopied(false), 2000);\n }\n });\n if (manual) {\n const manualInputLabel = inputLabel ?? \"Paste the authorization code or callback URL\";\n return (_jsx(PromptFrame, { message: manualInputLabel, layout: \"inline\", error: error, keys: [\n [keyGlyphs.enter, \"confirm\"],\n [keyGlyphs.escape, \"back to waiting\"],\n ], children: _jsx(TextField, { placeholder: placeholder, ariaLabel: manualInputLabel, onCancel: () => {\n setError(undefined);\n setManual(false);\n }, onChange: () => setError(undefined), onSubmit: (value) => {\n const problem = validate?.(value);\n if (problem !== undefined) {\n setError(problem instanceof Error ? problem.message : problem);\n }\n else {\n onSubmit(value);\n }\n } }) }));\n }\n return (_jsx(PromptFrame, { message: message, keys: [\n ...(allowManualInput\n ? [[keyGlyphs.enter, \"enter code manually\"]]\n : []),\n ...(url === undefined\n ? []\n : [\n ...(onOpen === undefined\n ? []\n : [[\"o\", \"open browser\"]]),\n [\n \"c\",\n copied\n ? `${glyphs.success} copied`\n : code === undefined\n ? \"copy URL\"\n : \"copy code\",\n ],\n [\"u\", showFull ? \"collapse URL\" : \"full URL\"],\n ]),\n [keyGlyphs.escape, \"cancel\"],\n ], children: _jsxs(Box, { flexDirection: \"column\", gap: 1, children: [_jsx(Spinner, { label: waitingLabel }), code === undefined ? null : (_jsxs(Box, { gap: 1, children: [_jsx(Text, { tone: \"muted\", children: \"Code\" }), _jsx(Text, { bold: true, color: theme.color.accentBright, children: code })] })), browserFailed ? (_jsxs(Text, { tone: \"warning\", children: [glyphs.warning, \" Could not open the browser. Copy and open the URL manually.\"] })) : null, url === undefined ? null : (_jsx(Link, { href: url, children: showFull ? url : truncate(url, Math.max(24, columns - 8)) }))] }) }));\n}\nexport function PromptFrame({ message, description, children, layout = \"stacked\", error, keys, }) {\n const glyphs = useGlyphs();\n // The active-step glyph shares the heading's brand colour: `◆ question` is\n // the step being answered, `✓ question` (AnsweredPrompt) one that is done.\n const heading = (suffix = \"\") => (_jsx(Text, { children: _jsxs(Text, { bold: true, color: theme.color.brand, children: [glyphs.active, \" \", message, suffix] }) }));\n return (_jsxs(Box, { flexDirection: \"column\", children: [layout === \"inline\" ? (_jsxs(Box, { flexDirection: \"column\", children: [_jsxs(Box, { gap: 1, children: [heading(\":\"), _jsx(Box, { flexGrow: 1, children: children })] }), description === undefined ? null : (_jsx(Box, { paddingLeft: theme.space.indent, children: _jsx(Text, { tone: \"muted\", children: description }) }))] })) : (_jsxs(_Fragment, { children: [heading(), description === undefined ? null : (_jsx(Box, { paddingLeft: theme.space.indent, children: _jsx(Text, { tone: \"muted\", children: description }) })), _jsx(Box, { paddingLeft: theme.space.indent, flexDirection: \"column\", children: children })] })), error === undefined ? null : (_jsx(Box, { marginTop: 1, paddingLeft: 2, children: _jsxs(Text, { color: theme.color.danger, children: [glyphs.error, \" \", error] }) })), keys === undefined ? null : _jsx(KeyBar, { keys: keys })] }));\n}\nexport const filterChoices = (choices, query) => {\n const normalized = query.trim().toLowerCase();\n const indexed = choices.map((choice, index) => ({ choice, index }));\n return normalized === \"\"\n ? indexed\n : indexed.filter(({ choice }) => `${choice.group ?? \"\"} ${choice.label} ${choice.description ?? \"\"}`\n .toLowerCase()\n .includes(normalized));\n};\n/** Stable selected-index set for multiselect widgets. */\nexport const useSelectedChoices = (choices, initialValues) => {\n return useState(() => new Set(initialValues.flatMap((value) => {\n const index = choices.findIndex((choice) => choice.value === value);\n return index === -1 || choices[index]?.disabled ? [] : [index];\n })));\n};\n//# sourceMappingURL=Interactive.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"@alchemy.run/sigil/jsx-runtime\";\nimport { useSyncExternalStore } from \"@alchemy.run/sigil/react\";\nimport { useGlyphs } from \"./Environment.js\";\nimport { SpinnerGlyph } from \"./Feedback.js\";\nimport { ProgressBar } from \"./ProgressBar.js\";\nimport { Box, Row, Stack } from \"./Layout.js\";\nimport { Text } from \"./Typography.js\";\nimport { theme } from \"../../../Util/Theme.js\";\n/**\n * The one status row shape shared by TaskTree and the plan/apply views:\n * glyph-or-spinner, bold label, muted detail, then any trailing cells.\n */\nexport function TaskRow({ icon, iconColor, spinning = false, label, detail, depth = 0, children, }) {\n const glyphs = useGlyphs();\n return (_jsxs(Row, { gap: 1, paddingLeft: depth * theme.space.indent, children: [spinning ? (_jsx(SpinnerGlyph, { color: iconColor })) : (_jsx(Text, { color: iconColor, children: icon ?? glyphs.bullet })), _jsx(Text, { bold: depth === 0, children: label }), detail === undefined ? null : _jsxs(Text, { tone: \"muted\", children: [\"\\u00B7 \", detail] }), children] }));\n}\nexport function ProgressGroup({ rows, width = 20, labelWidth, }) {\n return (_jsx(Stack, { children: rows.map((row) => {\n const complete = row.total > 0 && row.completed >= row.total;\n const variant = row.failed ? \"error\" : complete ? \"success\" : \"info\";\n return (_jsxs(Row, { children: [_jsx(ProgressBar, { value: row.total <= 0 ? 0 : row.completed / row.total, width: width, showPercent: false, variant: variant }), labelWidth === undefined ? (_jsx(Text, { children: row.label })) : (_jsx(Box, { width: labelWidth, flexShrink: 0, children: _jsx(Text, { wrap: \"truncate-end\", children: row.label }) })), _jsxs(Text, { bold: true, tone: variant === \"error\" ? \"danger\" : variant, children: [row.completed, \"/\", row.total] }), row.failed ? (_jsxs(Text, { tone: \"danger\", children: [\"(\", row.failed, \" failed)\"] })) : null, row.detail === undefined ? null : (_jsx(Text, { tone: \"muted\", children: row.detail }))] }, row.id));\n }) }));\n}\nexport class LiveStore {\n value;\n listeners = new Set();\n constructor(initial) {\n this.value = initial;\n }\n subscribe = (listener) => {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n };\n snapshot = () => this.value;\n set = (value) => {\n this.value = value;\n for (const listener of this.listeners)\n listener();\n };\n update = (f) => this.set(f(this.value));\n}\nexport const useLiveStore = (store) => useSyncExternalStore(store.subscribe, store.snapshot);\n//# sourceMappingURL=Live.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"@alchemy.run/sigil/jsx-runtime\";\n/** @jsxImportSource @alchemy.run/sigil */\nimport { useGlyphs } from \"./Environment.js\";\nimport { Stack } from \"./Layout.js\";\nimport { Text } from \"./Typography.js\";\nexport function AnsweredPrompt({ message, answer, below = false, }) {\n const glyphs = useGlyphs();\n return below ? (_jsxs(Stack, { children: [_jsxs(Text, { children: [_jsx(Text, { tone: \"success\", children: glyphs.success }), \" \", message] }), _jsxs(Text, { tone: \"muted\", children: [\" \", answer] })] })) : (_jsxs(Text, { children: [_jsx(Text, { tone: \"success\", children: glyphs.success }), \" \", message, \" \", _jsxs(Text, { tone: \"muted\", children: [\"\\u00B7 \", answer] })] }));\n}\nexport function CancelledPrompt({ message }) {\n const glyphs = useGlyphs();\n return (_jsxs(Text, { tone: \"muted\", children: [_jsx(Text, { tone: \"danger\", children: glyphs.error }), \" \", message, \" cancelled\"] }));\n}\n//# sourceMappingURL=Transcript.js.map","import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from \"@alchemy.run/sigil/jsx-runtime\";\n/** @jsxImportSource @alchemy.run/sigil */\nimport { useEffect, useMemo, useState } from \"@alchemy.run/sigil/react\";\nimport { useGlyphs, useKeyGlyphs } from \"../ui/Environment.js\";\nimport { Alert } from \"../ui/Feedback.js\";\nimport { ChoiceGroup, filterChoices, CycleList, ExternalWait, jumpSkippingDisabled, Menu, moveSkippingDisabled, PromptFrame, sanitizeTextInsert, TextField, useConfirmKeys, useListNavigation, useSelectedChoices, useTerminalInput, useTerminalPaste, useTerminalSize, useCycleNavigation, } from \"../ui/Interactive.js\";\nimport { Box } from \"../ui/Layout.js\";\nimport { AnsweredPrompt } from \"../ui/Transcript.js\";\nimport { Text } from \"../ui/Typography.js\";\nconst errorMessage = (value) => value instanceof Error ? value.message : value;\nconst answerText = (value, maskGlyph) => {\n if (maskGlyph !== undefined) {\n return maskGlyph.repeat(Math.min(value.length, 12));\n }\n return value || \"(empty)\";\n};\n/**\n * Escape-to-cancel for standard prompts. Ctrl+C is handled centrally by the\n * screen runner (SigilRuntime.run), so screens only wire Escape semantics.\n */\nconst useCancel = (cancel) => useTerminalInput((_input, key) => {\n if (key.escape)\n cancel();\n});\n/** One `Screen` factory shape shared by the non-generic prompt screens. */\nconst screen = (name, Component) => (options) => ({\n name,\n render: (controller) => _jsx(Component, { options: options, ...controller }),\n});\n/**\n * Scaffolding shared by the select and multi-select prompts: cursor state\n * clamped onto enabled rows, the navigation key ladder (arrows, `j`/`k` when\n * not searchable, Home/End, PageUp/PageDown), Escape-clears-filter-then-\n * cancels, filter editing, and bracketed paste into the filter. Callers run\n * their own submit/toggle keys first and delegate the rest to `handleKey`.\n */\nconst useChoiceList = ({ disabled, searchable, visibleCount, query, setQuery, onCancel, initialCursor = 0, }) => {\n const { cursor, setCursor } = useListNavigation(disabled.length, initialCursor);\n useEffect(() => {\n setCursor((current) => {\n if (disabled.length === 0)\n return 0;\n const clamped = Math.min(current, disabled.length - 1);\n if (!disabled[clamped])\n return clamped;\n const enabled = disabled.findIndex((value) => !value);\n return enabled === -1 ? clamped : enabled;\n });\n }, [disabled, setCursor]);\n const page = Math.max(1, visibleCount);\n const resetFilter = (next) => {\n setQuery(next);\n setCursor(0);\n };\n /** Returns true when the keystroke was consumed. */\n const handleKey = (input, key) => {\n const plain = !key.ctrl && !key.meta;\n if (key.up || (!searchable && plain && input === \"k\"))\n setCursor(moveSkippingDisabled(disabled, cursor, -1));\n else if (key.down || (!searchable && plain && input === \"j\"))\n setCursor(moveSkippingDisabled(disabled, cursor, 1));\n else if (key.home)\n setCursor(jumpSkippingDisabled(disabled, cursor, 0));\n else if (key.end)\n setCursor(jumpSkippingDisabled(disabled, cursor, disabled.length - 1));\n else if (key.pageUp)\n setCursor(jumpSkippingDisabled(disabled, cursor, cursor - page));\n else if (key.pageDown)\n setCursor(jumpSkippingDisabled(disabled, cursor, cursor + page));\n else if (key.escape) {\n // An active filter absorbs the first Escape; the second cancels.\n if (query !== \"\")\n resetFilter(\"\");\n else\n onCancel();\n }\n else if (searchable && (key.backspace || key.delete))\n resetFilter(query.slice(0, -1));\n else if (searchable && plain && !key.tab) {\n const typed = sanitizeTextInsert(input);\n if (typed.length === 0)\n return false;\n resetFilter(query + typed);\n }\n else\n return false;\n return true;\n };\n useTerminalPaste((pasted) => {\n const typed = sanitizeTextInsert(pasted);\n if (typed.length > 0)\n resetFilter(query + typed);\n }, { active: searchable });\n return { cursor, setCursor, handleKey };\n};\n/**\n * fzf-style query row for searchable lists: a `/` prefix, the typed text\n * with a block cursor, and a right-hand annotation (match count, selection\n * count). The row is always present so the list does not jump when the first\n * character is typed.\n */\nfunction FilterLine({ query, annotation, }) {\n return (_jsxs(Box, { gap: 2, children: [_jsxs(Text, { children: [_jsx(Text, { tone: \"muted\", children: \"/ \" }), query === \"\" ? (_jsx(Text, { tone: \"muted\", children: \"type to filter\" })) : (_jsxs(_Fragment, { children: [query, _jsx(Text, { inverse: true, children: \" \" })] }))] }), _jsx(Text, { tone: \"muted\", children: annotation })] }));\n}\nfunction TextPrompt({ options, mask, submit, cancel }) {\n const glyphs = useGlyphs();\n const keys = useKeyGlyphs();\n const maskGlyph = mask ? glyphs.mask : undefined;\n const [error, setError] = useState();\n useCancel(cancel);\n const complete = (raw) => {\n const value = raw === \"\" &&\n \"defaultValue\" in options &&\n options.defaultValue !== undefined\n ? options.defaultValue\n : raw;\n const problem = errorMessage(options.validate?.(value));\n if (problem !== undefined)\n setError(problem);\n else\n submit(value, _jsx(AnsweredPrompt, { message: options.message, answer: answerText(value, maskGlyph) }));\n };\n return (_jsx(PromptFrame, { message: options.message, description: options.description, layout: options.layout ?? \"inline\", error: error, keys: [\n [keys.enter, \"confirm\"],\n [keys.escape, \"cancel\"],\n ], children: _jsx(TextField\n // A default is the value Enter will submit, so show it in the empty\n // field when the caller did not supply more specific hint text.\n // Keep it a placeholder (rather than initialValue) so the first\n // keystroke starts a replacement instead of appending to the default.\n , { \n // A default is the value Enter will submit, so show it in the empty\n // field when the caller did not supply more specific hint text.\n // Keep it a placeholder (rather than initialValue) so the first\n // keystroke starts a replacement instead of appending to the default.\n placeholder: options.placeholder ??\n (\"defaultValue\" in options ? options.defaultValue : undefined), initialValue: \"initialValue\" in options ? options.initialValue : undefined, mask: maskGlyph, ariaLabel: options.message, onChange: () => setError(undefined), onSubmit: complete }) }));\n}\nexport const textScreen = screen(\"text input\", TextPrompt);\nexport const passwordScreen = screen(\"password input\", (props) => _jsx(TextPrompt, { ...props, mask: true }));\nfunction SelectPrompt({ options, submit, cancel, summary = true, header, footer, escapeLabel = \"cancel\", }) {\n const keys = useKeyGlyphs();\n const { rows } = useTerminalSize();\n const visibleCount = options.visibleCount ?? Math.max(3, Math.min(16, rows - 8));\n const searchable = options.searchable === true;\n const [query, setQuery] = useState(\"\");\n const filtered = useMemo(() => searchable\n ? filterChoices(options.options, query)\n : options.options.map((choice, index) => ({ choice, index })), [options.options, query, searchable]);\n const initialOriginalIndex = options.options.findIndex((choice) => choice.value === options.initialValue);\n const initialIndex = filtered.findIndex(({ index }) => index === initialOriginalIndex);\n const firstEnabled = filtered.findIndex(({ choice }) => !choice.disabled);\n const disabled = useMemo(() => filtered.map(({ choice }) => choice.disabled !== undefined && choice.disabled !== false), [filtered]);\n const { cursor, handleKey } = useChoiceList({\n disabled,\n searchable,\n visibleCount,\n query,\n setQuery,\n onCancel: cancel,\n initialCursor: initialIndex !== -1 && !filtered[initialIndex]?.choice.disabled\n ? initialIndex\n : Math.max(0, firstEnabled),\n });\n useTerminalInput((input, key) => {\n if (key.enter) {\n const choice = filtered[cursor]?.choice;\n if (choice !== undefined && !choice.disabled) {\n submit(choice.value, summary ? (_jsx(AnsweredPrompt, { message: options.message, answer: choice.label })) : undefined);\n }\n return;\n }\n handleKey(input, key);\n });\n return (_jsxs(Box, { flexDirection: \"column\", gap: 1, children: [header, _jsx(PromptFrame, { message: options.message, keys: [\n [keys.upDown, \"navigate\"],\n [keys.enter, \"select\"],\n [keys.escape, query === \"\" ? escapeLabel : \"clear filter\"],\n ], children: _jsxs(Box, { flexDirection: \"column\", children: [searchable ? (_jsx(FilterLine, { query: query, annotation: query === \"\"\n ? `${options.options.length} choices`\n : `${filtered.length} of ${options.options.length}` })) : null, _jsx(Menu, { choices: filtered.map(({ choice }) => choice), cursor: cursor, visibleCount: visibleCount, empty: \"No matching choices.\", descriptionPlacement: options.descriptionPlacement })] }) }), footer] }));\n}\nexport const selectScreen = (options) => ({\n name: \"selection\",\n render: ({ submit, cancel }) => (_jsx(SelectPrompt, { options: options, submit: submit, cancel: cancel })),\n});\nexport const menuScreen = (options) => {\n const hasBack = Object.hasOwn(options, \"back\");\n return {\n name: \"menu\",\n render: ({ submit, cancel }) => (_jsx(SelectPrompt, { options: options, submit: submit, cancel: () => (hasBack ? submit(options.back) : cancel()), summary: false, header: options.header, footer: options.footer, escapeLabel: hasBack ? \"back\" : \"exit\" })),\n };\n};\nfunction MultiSelectPrompt({ options, submit, cancel, }) {\n const keys = useKeyGlyphs();\n const { rows } = useTerminalSize();\n const visibleCount = options.visibleCount ?? Math.max(3, Math.min(16, rows - 10));\n const searchable = options.searchable === true;\n const [query, setQuery] = useState(\"\");\n const filtered = useMemo(() => searchable\n ? filterChoices(options.options, query)\n : options.options.map((choice, index) => ({ choice, index })), [options.options, searchable, query]);\n const listRows = useMemo(() => {\n const result = [];\n // Each contiguous run of a group gets its own header owning exactly the\n // run's rows — a group split by ungrouped entries must not produce two\n // headers that both toggle the whole group.\n let currentGroup;\n let currentHeader;\n for (const entry of filtered) {\n const group = entry.choice.group;\n if (group === undefined) {\n currentHeader = undefined;\n }\n else if (group !== currentGroup || currentHeader === undefined) {\n const header = {\n type: \"group\",\n label: group,\n indices: [],\n };\n result.push(header);\n currentHeader = header;\n }\n currentGroup = group;\n if (group !== undefined && currentHeader !== undefined) {\n currentHeader.indices.push(entry.index);\n }\n result.push({\n type: \"choice\",\n choice: entry.choice,\n index: entry.index,\n nested: group !== undefined,\n });\n }\n return result;\n }, [filtered]);\n const [selected, setSelected] = useSelectedChoices(options.options, options.initialValues ?? []);\n const [error, setError] = useState();\n const disabled = useMemo(() => listRows.map((row) => row.type === \"choice\"\n ? row.choice.disabled !== undefined && row.choice.disabled !== false\n : row.indices.every((index) => Boolean(options.options[index]?.disabled))), [listRows, options.options]);\n const { cursor, handleKey } = useChoiceList({\n disabled,\n searchable,\n visibleCount,\n query,\n setQuery,\n onCancel: cancel,\n });\n useTerminalInput((input, key) => {\n if (key.ctrl && input === \"a\") {\n const enabledVisible = filtered.flatMap(({ choice, index }) => choice.disabled !== undefined && choice.disabled !== false\n ? []\n : [index]);\n if (enabledVisible.length === 0)\n return;\n setSelected((current) => {\n const next = new Set(current);\n const allSelected = enabledVisible.every((index) => next.has(index));\n for (const index of enabledVisible) {\n if (allSelected)\n next.delete(index);\n else\n next.add(index);\n }\n return next;\n });\n setError(undefined);\n }\n else if (input === \" \" && !key.ctrl && !key.meta) {\n const row = listRows[cursor];\n if (row === undefined)\n return;\n const indices = row.type === \"group\"\n ? row.indices.filter((index) => !options.options[index]?.disabled)\n : row.choice.disabled\n ? []\n : [row.index];\n if (indices.length === 0)\n return;\n setSelected((current) => {\n const next = new Set(current);\n const allSelected = indices.every((index) => next.has(index));\n for (const index of indices) {\n if (allSelected)\n next.delete(index);\n else\n next.add(index);\n }\n return next;\n });\n setError(undefined);\n }\n else if (key.enter) {\n if (options.required && selected.size === 0) {\n setError(\"Select at least one option.\");\n return;\n }\n const values = options.options.flatMap((choice, index) => selected.has(index) ? [choice.value] : []);\n const labels = options.options.flatMap((choice, index) => selected.has(index) ? [choice.label] : []);\n submit(values, _jsx(AnsweredPrompt, { message: options.message, answer: labels.length === 0 ? \"none\" : labels.join(\", \") }));\n }\n else if (handleKey(input, key)) {\n setError(undefined);\n }\n });\n const visibleChoices = listRows.map((row) => row.type === \"group\"\n ? {\n value: row,\n label: row.label,\n sticky: true,\n tone: \"info\",\n }\n : {\n ...row.choice,\n value: row,\n group: undefined,\n indent: row.nested ? 2 : row.choice.indent,\n });\n const visibleSelected = new Set(listRows.flatMap((row, visibleIndex) => {\n if (row.type !== \"group\") {\n return selected.has(row.index) ? [visibleIndex] : [];\n }\n // Match the toggle semantics: disabled children are excluded there, so\n // they must not keep a fully-toggled group from rendering as selected.\n const toggleable = row.indices.filter((index) => !options.options[index]?.disabled);\n return toggleable.length > 0 &&\n toggleable.every((index) => selected.has(index))\n ? [visibleIndex]\n : [];\n }));\n return (_jsx(PromptFrame, { message: options.message, error: error, keys: [\n [keys.upDown, \"navigate\"],\n [keys.space, \"toggle\"],\n [\"ctrl+a\", \"toggle all\"],\n [keys.enter, \"confirm\"],\n [keys.escape, query === \"\" ? \"cancel\" : \"clear filter\"],\n ], children: _jsxs(Box, { flexDirection: \"column\", children: [searchable ? (_jsx(FilterLine, { query: query, annotation: query === \"\"\n ? `${selected.size} selected`\n : `${filtered.length} of ${options.options.length} · ${selected.size} selected` })) : (_jsxs(Text, { tone: \"muted\", children: [selected.size, \" selected\"] })), _jsx(Menu, { choices: visibleChoices, cursor: cursor, selected: visibleSelected, visibleCount: visibleCount, empty: \"No matching choices.\", descriptionPlacement: options.descriptionPlacement })] }) }));\n}\nexport const multiSelectScreen = (options) => ({\n name: \"multiple selection\",\n render: ({ submit, cancel }) => (_jsx(MultiSelectPrompt, { options: options, submit: submit, cancel: cancel })),\n});\nfunction CycleSelectPrompt({ options, submit, cancel, }) {\n const keys = useKeyGlyphs();\n const { rows } = useTerminalSize();\n const visibleCount = options.visibleCount ?? Math.max(3, Math.min(16, rows - 8));\n const navigation = useCycleNavigation(options.options.map((choice) => choice.states.length));\n const [unchanged, setUnchanged] = useState(false);\n useCancel(cancel);\n const last = Math.max(0, options.options.length - 1);\n const page = Math.max(1, visibleCount);\n useTerminalInput((input, key) => {\n const plain = !key.ctrl && !key.meta;\n if (key.up || (plain && input === \"k\"))\n navigation.move(-1);\n else if (key.down || (plain && input === \"j\"))\n navigation.move(1);\n else if (key.home)\n navigation.setCursor(0);\n else if (key.end)\n navigation.setCursor(last);\n else if (key.pageUp)\n navigation.setCursor(Math.max(0, navigation.cursor - page));\n else if (key.pageDown)\n navigation.setCursor(Math.min(last, navigation.cursor + page));\n else if ((plain && input === \" \") || key.right) {\n navigation.cycle(1);\n setUnchanged(false);\n }\n else if (key.left) {\n navigation.cycle(-1);\n setUnchanged(false);\n }\n else if (key.enter) {\n if (options.requireChange &&\n navigation.indices.every((index) => index === 0)) {\n setUnchanged(true);\n return;\n }\n const values = options.options.flatMap((choice, index) => {\n const state = choice.states[navigation.indices[index] ?? 0];\n return state === undefined ? [] : [state.value];\n });\n const changed = options.options.flatMap((choice, index) => {\n if ((navigation.indices[index] ?? 0) === 0)\n return [];\n const state = choice.states[navigation.indices[index] ?? 0];\n return state === undefined\n ? []\n : [`${choice.label}: ${state.label ?? \"changed\"}`];\n });\n submit(values, _jsx(AnsweredPrompt, { message: options.message, answer: changed.length === 0 ? \"no changes\" : changed.join(\", \") }));\n }\n });\n return (_jsx(PromptFrame, { message: options.message, keys: [\n [keys.upDown, \"navigate\"],\n [keys.space, \"change\"],\n [keys.enter, options.requireChange ? \"apply\" : \"confirm\"],\n [keys.escape, options.requireChange ? \"back\" : \"cancel\"],\n ], children: _jsxs(Box, { flexDirection: \"column\", children: [_jsx(CycleList, { choices: options.options, cursor: navigation.cursor, indices: navigation.indices, visibleCount: visibleCount }), unchanged ? (_jsx(Alert, { variant: \"warning\", title: \"No changes to apply\", children: options.unchangedMessage ??\n \"Press Space to change a selection, or Esc to go back.\" })) : null] }) }));\n}\nexport const cycleSelectScreen = (options) => ({\n name: \"cycle selection\",\n render: ({ submit, cancel }) => (_jsx(CycleSelectPrompt, { options: options, submit: submit, cancel: cancel })),\n});\nexport const awaitExternalScreen = screen(\"external authorization\", ({ options, submit, cancel }) => (_jsx(ExternalWait, { ...options, onSubmit: submit, onCancel: cancel })));\nfunction ConfirmPrompt({ options, submit, cancel }) {\n const keys = useKeyGlyphs();\n const complete = (answer) => submit(answer, _jsx(AnsweredPrompt, { message: options.message, answer: answer\n ? (options.confirmLabel ?? \"yes\")\n : (options.cancelLabel ?? \"no\") }));\n const value = useConfirmKeys({\n // Default to \"no\": most CLI confirms gate destructive operations, so an\n // absent-minded Enter must never approve one. Benign convenience prompts\n // opt into default-yes with an explicit `initialValue: true`.\n initialValue: options.initialValue ?? false,\n onSubmit: complete,\n onCancel: cancel,\n });\n return (_jsx(PromptFrame, { message: options.message, keys: [\n [\n options.confirmLabel === undefined &&\n options.cancelLabel === undefined\n ? keys.yesNo\n : keys.leftRight,\n \"choose\",\n ],\n [keys.enter, \"confirm\"],\n [keys.escape, \"cancel\"],\n ], children: _jsx(ChoiceGroup, { value: value, choices: [\n { value: true, label: options.confirmLabel ?? \"Yes\" },\n { value: false, label: options.cancelLabel ?? \"No\" },\n ] }) }));\n}\nexport const confirmScreen = screen(\"confirmation\", ConfirmPrompt);\n//# sourceMappingURL=Prompts.js.map","import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from \"@alchemy.run/sigil/jsx-runtime\";\n/** @jsxImportSource @alchemy.run/sigil */\nimport { stripVTControlCharacters } from \"node:util\";\nimport * as Cause from \"effect/Cause\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Semaphore from \"effect/Semaphore\";\nimport { AnsiText, Box, render, renderToString, Static, useTitle, } from \"@alchemy.run/sigil\";\nimport { useSyncExternalStore } from \"@alchemy.run/sigil/react\";\nimport { Spinner, Status } from \"../ui/Feedback.js\";\nimport { CliEnvironment } from \"../ui/Environment.js\";\nimport { useTerminalInput } from \"../ui/Interactive.js\";\nimport { LiveStore, useLiveStore } from \"../ui/Live.js\";\nimport { CancelledPrompt } from \"../ui/Transcript.js\";\nimport { Text } from \"../ui/Typography.js\";\nimport { NonInteractiveTerminal, TerminalCancelled, } from \"../../../Interaction.js\";\nimport { confirmScreen, cycleSelectScreen, awaitExternalScreen, menuScreen, multiSelectScreen, passwordScreen, selectScreen, textScreen, } from \"./Prompts.js\";\nimport { ApplicationPresentation, CliKit } from \"../../CliKit/CliKit.js\";\nimport { setNativeProgress } from \"../../../Util/Terminal.js\";\nconst InApplication = Context.Reference(\"Alchemy::CliKit/InApplication\", {\n defaultValue: () => false,\n});\nconst normalizeView = (view) => {\n if (typeof view === \"string\" ||\n typeof view === \"number\" ||\n typeof view === \"bigint\") {\n return _jsx(Text, { children: String(view) });\n }\n // Contract: an array of primitives renders as ONE Text line with the\n // elements concatenated (no separator) — matching how React renders\n // adjacent text children. Callers wanting separators must join themselves.\n if (Array.isArray(view) &&\n view.every((item) => item === null ||\n item === undefined ||\n typeof item === \"boolean\" ||\n typeof item === \"string\" ||\n typeof item === \"number\" ||\n typeof item === \"bigint\")) {\n return (_jsx(Text, { children: view\n .filter((item) => item !== null && item !== undefined && typeof item !== \"boolean\")\n .map(String)\n .join(\"\") }));\n }\n return view;\n};\nconst formatStaticView = (view, options, capabilities) => {\n const colors = options.colors ?? capabilities.colors;\n // The renderer and the components must agree on the width: components size\n // themselves from the environment's `columns`, so an explicit render width\n // has to flow into the capabilities too, not only into renderToString.\n const columns = options.columns ?? capabilities.columns;\n const output = renderToString(_jsx(CliEnvironment, { capabilities: { ...capabilities, colors, columns }, children: view }), { columns }).replace(/[\\s\\n]+$/, \"\");\n return colors ? output : stripVTControlCharacters(output);\n};\n/**\n * The single external store the React root syncs from. It only tracks WHICH\n * blocks are mounted and in what region (static scrollback, in-application\n * transcript, live region, active prompt) — block content never changes\n * after mount, so there is no update surface here.\n */\nclass TerminalStore {\n state = { staticItems: [], transcript: [], live: [] };\n listeners = new Set();\n nextKey = 0;\n subscribe = (listener) => {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n };\n snapshot = () => this.state;\n commit(state) {\n this.state = state;\n for (const listener of this.listeners)\n listener();\n }\n alloc() {\n return this.nextKey++;\n }\n append(view) {\n this.commit({\n ...this.state,\n transcript: [...this.state.transcript, { key: this.alloc(), view }],\n });\n }\n appendStatic(view) {\n this.commit({\n ...this.state,\n staticItems: [...this.state.staticItems, { key: this.alloc(), view }],\n });\n }\n addLive(key, view, placement = \"afterTranscript\") {\n this.commit({\n ...this.state,\n live: [...this.state.live, { key, view, placement }],\n });\n }\n removeLive(key) {\n this.commit({\n ...this.state,\n live: this.state.live.filter((entry) => entry.key !== key),\n });\n }\n /**\n * Move a live block into scrollback (its component renders one final time\n * from its store's final state). No-op when the row was already cleared.\n */\n completeLive(key, destination) {\n const item = this.state.live.find((entry) => entry.key === key);\n if (item === undefined)\n return;\n this.commit({\n ...this.state,\n [destination]: [\n ...this.state[destination],\n { key: this.alloc(), view: item.view },\n ],\n live: this.state.live.filter((entry) => entry.key !== key),\n });\n }\n activate(view) {\n this.commit({ ...this.state, active: { key: this.alloc(), view } });\n }\n deactivate() {\n if (this.state.active !== undefined)\n this.commit({ ...this.state, active: undefined });\n }\n clear() {\n this.commit({ ...this.state, transcript: [], live: [] });\n }\n clearStatic() {\n if (this.state.staticItems.length > 0) {\n this.commit({ ...this.state, staticItems: [] });\n }\n }\n clearTranscript() {\n if (this.state.transcript.length > 0) {\n this.commit({ ...this.state, transcript: [] });\n }\n }\n get idle() {\n return this.state.active === undefined && this.state.live.length === 0;\n }\n}\nfunction ScreenCancelGuard({ onCancel, children }) {\n useTerminalInput((input, key) => {\n if (key.ctrl && input === \"c\")\n onCancel();\n }, { active: true });\n return _jsx(_Fragment, { children: children });\n}\nfunction ItemView({ item }) {\n return _jsx(Box, { flexDirection: \"column\", children: item.view });\n}\nfunction TerminalRoot({ store }) {\n const state = useSyncExternalStore(store.subscribe, store.snapshot);\n useTerminalInput((input, key) => {\n if (!key.ctrl || input !== \"c\")\n return;\n process.kill(process.pid, \"SIGINT\");\n }, { active: state.active === undefined });\n const beforeTranscript = state.live.filter((item) => item.placement === \"beforeTranscript\");\n const afterTranscript = state.live.filter((item) => item.placement !== \"beforeTranscript\");\n return (_jsxs(Box, { flexDirection: \"column\", children: [_jsx(Static, { items: state.staticItems, children: (item) => _jsx(ItemView, { item: item }, item.key) }), beforeTranscript.map((item) => (_jsx(ItemView, { item: item }, item.key))), state.transcript.map((item) => (_jsx(ItemView, { item: item }, item.key))), afterTranscript.map((item) => (_jsx(ItemView, { item: item }, item.key))), state.active === undefined ? null : (_jsx(Box, { marginTop: state.transcript.length > 0 ? 1 : 0, children: _jsx(ItemView, { item: state.active }, state.active.key) }))] }));\n}\nfunction ProgressView({ store }) {\n const state = useLiveStore(store);\n useTitle(state.options.title);\n return state.final !== undefined ? (_jsx(Status, { variant: state.final.variant, children: state.final.message ?? state.options.label })) : state.options.spinning === false ? (_jsx(Status, { variant: \"info\", detail: state.options.detail, children: state.options.label })) : (_jsx(Spinner, { label: state.options.label, detail: state.options.detail }));\n}\nexport const makeRuntime = (options, capabilities) => {\n const stdin = options.stdin ?? process.stdin;\n const stdout = options.stdout ?? process.stdout;\n const stderr = options.stderr ?? process.stderr;\n const store = new TerminalStore();\n const rendererGate = Semaphore.makeUnsafe(1);\n const promptGate = Semaphore.makeUnsafe(1);\n // Lifecycle state. `mounted` and `unmounting` deliberately overlap: during\n // teardown the instance stays in `mounted` until re-validation passes, so\n // prints/live views racing the drain still see a live renderer (and can\n // abort the teardown). `applicationMounted` is an orthogonal axis — an\n // `app()` region pins the renderer regardless of store idleness — and\n // `disposed` is a terminal one-way latch.\n let mounted;\n let unmounting;\n let applicationMounted = false;\n let disposed = false;\n /**\n * Fails the active interaction when a screen component throws during\n * render. Without this the prompt's callback would never resume and the\n * CLI would hang with a dead renderer.\n */\n let failActive;\n /**\n * The single failure channel for renderer errors: route into the active\n * interaction when a prompt is waiting, otherwise surface on stderr. Every\n * async failure path (the exit promise, fire-and-forget mounts) funnels\n * here so no rejection ever escapes unhandled.\n */\n const failRenderer = (error) => {\n if (failActive !== undefined)\n failActive(error);\n else\n stderr.write(`CliKit renderer error: ${String(error)}\\n`);\n };\n const mount = async (alternateScreen = false) => {\n // Never overlap a new Sigil root with one that is still tearing down —\n // Sigil keys instances by stdout and two live roots corrupt the output.\n while (unmounting !== undefined)\n await unmounting;\n if (disposed || mounted !== undefined)\n return;\n const captureDirectStdio = options.captureConsole !== false;\n // Process output lives in the renderer's Static zone above every inline\n // view. Adding a static row commits it to scrollback and naturally moves\n // the live UI down, avoiding log-update's erase/restore path and its\n // render artifacts. `patchConsole: \"stdio\"` captures console, Node\n // warnings, and direct stream writes from tools such as Floci (the\n // renderer's own frames go through passthrough facades and bypass the\n // capture); `onCapturedOutput` takes ownership of each raw chunk so the\n // Static transcript renders it instead of the built-in splicing. The\n // renderer restores console and stream writes itself on unmount.\n const buffers = { stdout: \"\", stderr: \"\" };\n // A captured write that ends mid-line parks its tail here waiting for\n // the rest of the line. A real terminal would display the partial\n // immediately — so when no continuation arrives promptly, flush the\n // tail as its own row instead of holding it until unmount. Without the\n // deadline, a writer whose final chunk lacks a trailing newline (e.g.\n // a pretty-printed cause written raw to stderr) has its last line\n // appear only when the process exits. One timer PER STREAM: a chatty\n // stdout must not keep resetting the deadline of a parked stderr tail.\n const partialFlushTimers = {};\n const clearPartialFlush = (stream) => {\n const timer = partialFlushTimers[stream];\n if (timer !== undefined) {\n clearTimeout(timer);\n partialFlushTimers[stream] = undefined;\n }\n };\n const flushPartialLine = (stream) => {\n partialFlushTimers[stream] = undefined;\n if (buffers[stream] !== \"\") {\n store.appendStatic(_jsx(AnsiText, { wrap: \"none\", children: buffers[stream] }));\n buffers[stream] = \"\";\n }\n };\n const appendLines = (stream, data) => {\n const parts = `${buffers[stream]}${data}`.split(/\\r?\\n/);\n buffers[stream] = parts.pop() ?? \"\";\n for (const line of parts) {\n store.appendStatic(_jsx(AnsiText, { wrap: \"none\", children: line || \" \" }));\n }\n clearPartialFlush(stream);\n if (buffers[stream] !== \"\") {\n const timer = setTimeout(() => flushPartialLine(stream), 50);\n timer.unref?.();\n partialFlushTimers[stream] = timer;\n }\n };\n const sigil = render(_jsx(CliEnvironment, { capabilities: capabilities, observeWindow: true, children: _jsx(TerminalRoot, { store: store }) }), {\n stdin,\n stdout,\n stderr,\n exitOnCtrlC: false,\n interactive: capabilities.input,\n alternateScreen: alternateScreen,\n colorProfile: capabilities.colors ? undefined : \"none\",\n ...(captureDirectStdio\n ? {\n patchConsole: \"stdio\",\n onCapturedOutput: (stream, data) => {\n appendLines(stream, data);\n return true;\n },\n }\n : { patchConsole: false }),\n });\n const current = {\n sigil,\n alternate: alternateScreen,\n exit: Promise.resolve(),\n flushDirectStdio: captureDirectStdio\n ? () => {\n // AnsiText, matching the line and deadline paths: a trailing\n // fragment must not render color-stripped just because teardown\n // won the race against the 50ms deadline.\n for (const stream of [\"stdout\", \"stderr\"]) {\n clearPartialFlush(stream);\n if (buffers[stream] !== \"\") {\n store.appendStatic(_jsx(AnsiText, { wrap: \"none\", children: buffers[stream] }));\n buffers[stream] = \"\";\n }\n }\n }\n : undefined,\n };\n // Capture the exit promise at mount time: Sigil registers its process\n // `beforeExit` listener on the first `waitUntilExit()` call and `unmount`\n // only removes a listener that already exists, so waiting only after\n // unmount leaks one process listener per mount cycle. A rejection means a\n // component threw during render — Sigil has already unmounted itself, so\n // drop the dead instance and surface the error instead of hanging.\n current.exit = sigil.waitUntilExit().then(() => undefined, (error) => {\n // The crashed instance is dropped without the unmount path, so\n // disarm any pending partial-flush timer here too.\n current.flushDirectStdio?.();\n if (mounted === current)\n mounted = undefined;\n failRenderer(error);\n });\n mounted = current;\n };\n const ensureMounted = () => Effect.promise(() => mount());\n const waitForRender = () => mounted?.sigil.waitUntilRenderFlush().catch(() => undefined) ??\n Promise.resolve();\n /**\n * Tear down the renderer. Total (never rejects) and re-validated across its\n * awaits: output printed or live views opened while the final frame flushes\n * abort the teardown instead of being destroyed with it. `force` skips the\n * re-validation for dispose and presentation switches.\n */\n const unmount = (force = false) => {\n if (unmounting !== undefined)\n return unmounting;\n const current = mounted;\n if (current === undefined)\n return Promise.resolve();\n unmounting = (async () => {\n try {\n current.flushDirectStdio?.();\n // Drain: keep flushing until no new static output arrives between\n // flushes, so a `print` racing the teardown reaches the terminal.\n // Unbounded by design — the bound is the renderer's convergence: the\n // loop exits as soon as producers go quiet for one full flush.\n let staticCount;\n do {\n staticCount = store.snapshot().staticItems.length;\n await current.sigil.waitUntilRenderFlush();\n } while (store.snapshot().staticItems.length !== staticCount);\n // Re-validate: a prompt or live view may have re-armed the renderer\n // while the frame flushed. Their output would be destroyed by the\n // teardown, so leave the instance mounted for them instead.\n if (!force && (applicationMounted || !store.idle))\n return;\n // A captured chunk that arrived DURING the drain may have parked a\n // partial line and armed a flush timer. Flush and disarm now —\n // otherwise the timer fires after `clearStatic()` below and the\n // stale fragment replays at the top of the next mount.\n current.flushDirectStdio?.();\n mounted = undefined;\n // unmount restores the patched console and stream writes.\n current.sigil.unmount();\n await current.exit;\n current.sigil.cleanup();\n // Static output has been handed off to the terminal. Do not replay\n // it when a later live session mounts a fresh Sigil root.\n store.clearStatic();\n }\n catch {\n // Teardown must be total: a crashed instance still ends up unmounted\n // with console/stream patches restored — and with no armed partial\n // flush timer left to poke the store after clearStatic.\n if (mounted === current)\n mounted = undefined;\n try {\n current.flushDirectStdio?.();\n current.sigil.unmount();\n }\n catch {\n // Already unmounted (or unmount itself is what threw above).\n }\n }\n })().finally(() => {\n unmounting = undefined;\n });\n return unmounting;\n };\n const releaseIfIdle = () => Effect.suspend(() => applicationMounted || !store.idle\n ? Effect.void\n : Effect.promise(() => unmount()));\n const formatView = (view, renderOptions = {}) => formatStaticView(normalizeView(view), renderOptions, {\n ...capabilities,\n // Re-read the width at render time — the boot-time snapshot goes stale\n // the moment the user resizes the terminal.\n columns: stdout.columns ?? capabilities.columns,\n });\n const renderView = (view, renderOptions = {}) => Effect.sync(() => formatView(view, renderOptions));\n const print = (view, renderOptions = {}) => Effect.gen(function* () {\n const inApplication = yield* InApplication;\n view = normalizeView(view);\n if (inApplication) {\n yield* Effect.sync(() => store.append(view));\n }\n else if (mounted !== undefined) {\n yield* Effect.sync(() => store.appendStatic(view));\n }\n else {\n const output = yield* renderView(view, renderOptions);\n if (output !== \"\")\n yield* Effect.sync(() => stdout.write(`${output}\\n`));\n }\n });\n const messageOptions = (message) => (typeof message === \"string\" ? { message } : message);\n const log = (variant) => (message) => {\n const options = messageOptions(message);\n return print(_jsx(Status, { variant: variant, detail: options.detail, children: options.message }));\n };\n const run = (screen) => {\n if (!capabilities.input) {\n return Effect.fail(new NonInteractiveTerminal({\n operation: screen.name,\n message: `Cannot run ${screen.name} without an interactive terminal. Provide the equivalent command flags instead.`,\n }));\n }\n return Effect.gen(function* () {\n const inApplication = yield* InApplication;\n const interaction = promptGate.withPermits(1)(Effect.gen(function* () {\n let completedView;\n return yield* Effect.callback((resume) => {\n let settled = false;\n const finish = (result, resultView) => {\n if (settled)\n return;\n settled = true;\n failActive = undefined;\n store.deactivate();\n if (resultView !== undefined) {\n if (inApplication)\n store.append(normalizeView(resultView));\n else\n completedView = resultView;\n }\n resume(result);\n };\n const cancel = () => finish(Effect.fail(new TerminalCancelled()), _jsx(CancelledPrompt, { message: screen.name }));\n // A screen that throws during render unmounts Sigil with the error;\n // without this hook the callback would never resume and the CLI\n // would hang forever on a dead renderer.\n failActive = (error) => finish(Effect.die(error));\n store.activate(_jsx(ScreenCancelGuard, { onCancel: cancel, children: screen.render({\n submit: (value, summary) => finish(Effect.succeed(value), summary),\n cancel,\n }) }));\n // Not awaited (Effect.callback's register is synchronous), but\n // never fire-and-forget: a mount failure — e.g. a synchronous\n // throw from Sigil's render() — routes through `failRenderer`,\n // which fails this very interaction via the `failActive` hook\n // installed above instead of escaping as an unhandled rejection.\n mount().catch(failRenderer);\n // Interruption cleanup: deactivate the screen and let the caller's\n // finalizers release the renderer.\n return Effect.sync(() => {\n if (!settled) {\n settled = true;\n failActive = undefined;\n store.deactivate();\n }\n });\n }).pipe(Effect.ensuring(Effect.suspend(() => inApplication\n ? Effect.void\n : releaseIfIdle().pipe(Effect.andThen(completedView === undefined\n ? Effect.void\n : print(completedView))))));\n }));\n return yield* inApplication\n ? interaction\n : rendererGate.withPermits(1)(interaction);\n });\n };\n const menu = (options) => Effect.gen(function* () {\n if (yield* InApplication)\n yield* Effect.sync(() => store.clear());\n return yield* run(menuScreen(options));\n });\n const app = (effect) => !capabilities.input\n ? Effect.fail(new NonInteractiveTerminal({\n operation: \"application\",\n message: \"Cannot run a CLI application without terminal input. Provide the equivalent command flags instead.\",\n }))\n : Effect.gen(function* () {\n if (yield* InApplication)\n return yield* effect;\n const presentation = yield* ApplicationPresentation;\n const alternate = presentation === \"alternate\" && capabilities.alternateScreen;\n return yield* rendererGate.withPermits(1)(Effect.acquireUseRelease(Effect.promise(async () => {\n applicationMounted = true;\n store.clear();\n // Sigil cannot change `alternateScreen` on a live instance: if\n // an inline renderer (say an earlier progress row) is still\n // mounted with the wrong presentation, remount with the\n // requested one instead of silently ignoring it.\n if (mounted !== undefined && mounted.alternate !== alternate) {\n await unmount(true);\n }\n await mount(alternate);\n }), () => effect.pipe(Effect.provideService(InApplication, true)), () => Effect.promise(async () => {\n applicationMounted = false;\n store.clear();\n // Let the empty frame replace the application, then erase\n // that frame explicitly. Unmount can now restore terminal\n // modes without leaving the empty frame's newline behind.\n const current = mounted;\n if (current !== undefined) {\n await current.sigil.waitUntilRenderFlush();\n current.sigil.clear();\n }\n await unmount();\n })));\n });\n // A wizard owns the renderer when invoked standalone and reuses the\n // current application renderer when nested. Prompt serialization remains\n // centralized in `run`, so nested profile/OAuth flows suspend cleanly.\n const wizard = (effect) => Effect.gen(function* () {\n if (!(yield* InApplication))\n return yield* app(effect);\n return yield* effect.pipe(Effect.ensuring(Effect.sync(() => store.clearTranscript())));\n });\n const makeLive = (initial, options = {}) => Effect.gen(function* () {\n if (!capabilities.input) {\n yield* print(initial);\n return { close: Effect.void };\n }\n const inApplication = yield* InApplication;\n const key = store.alloc();\n let closed = false;\n yield* Effect.sync(() => store.addLive(key, normalizeView(initial), options.placement));\n yield* ensureMounted();\n return {\n close: Effect.suspend(() => {\n if (closed)\n return Effect.void;\n closed = true;\n // removeLive/completeLive no-op when the row was already cleared\n // by a menu loop or application boundary.\n if (options.persistOnClose)\n store.completeLive(key, inApplication ? \"transcript\" : \"staticItems\");\n else\n store.removeLive(key);\n return Effect.promise(waitForRender).pipe(Effect.andThen(releaseIfIdle()));\n }),\n };\n });\n /**\n * Scope-bound: the enclosing scope closes the view as a backstop, so an\n * interrupted caller can never leave an orphaned row keeping the renderer\n * mounted (and the process alive) forever.\n */\n const live = (initial, options = {}) => Effect.acquireRelease(makeLive(initial, options), (handle) => handle.close);\n /**\n * A progress row is just a live view over a runtime-owned store — the\n * handle mutates the store, React re-renders. Settling swaps the store to\n * its final state and commits the block to scrollback.\n */\n const makeProgress = (initial) => Effect.gen(function* () {\n const dynamic = capabilities.input && ((yield* InApplication) || stdout.isTTY === true);\n if (!dynamic) {\n let current = initial;\n let closed = false;\n yield* print(_jsx(Status, { variant: \"info\", detail: initial.detail, children: initial.label }));\n const settle = (variant, message) => Effect.suspend(() => {\n if (closed)\n return Effect.void;\n closed = true;\n return print(_jsx(Status, { variant: variant, children: message ?? current.label }));\n });\n return {\n update: (next) => Effect.sync(() => {\n if (!closed)\n current = next;\n }),\n succeed: (message) => settle(\"success\", message),\n fail: (message) => settle(\"error\", message),\n close: Effect.sync(() => {\n closed = true;\n }),\n };\n }\n const inApplication = yield* InApplication;\n const progressStore = new LiveStore({ options: initial });\n const key = store.alloc();\n yield* Effect.sync(() => store.addLive(key, _jsx(ProgressView, { store: progressStore })));\n yield* ensureMounted();\n let settled = false;\n const finishRow = (persist) => Effect.suspend(() => {\n if (settled)\n return Effect.void;\n settled = true;\n // completeLive/removeLive no-op when the row was already cleared\n // by a menu loop or application boundary.\n if (persist)\n store.completeLive(key, inApplication ? \"transcript\" : \"staticItems\");\n else\n store.removeLive(key);\n return Effect.promise(waitForRender).pipe(Effect.andThen(releaseIfIdle()));\n });\n const settle = (variant, message) => Effect.suspend(() => {\n if (settled)\n return Effect.void;\n progressStore.update((state) => ({\n ...state,\n final: { variant, message },\n }));\n return finishRow(true);\n });\n return {\n update: (next) => Effect.sync(() => {\n if (!settled)\n progressStore.set({ options: next });\n }),\n succeed: (message) => settle(\"success\", message),\n fail: (message) => settle(\"error\", message),\n // An unsettled close abandons the row rather than committing it.\n close: finishRow(false),\n };\n });\n const progress = (initial) => Effect.acquireRelease(makeProgress(initial), (handle) => handle.close);\n const service = {\n terminal: capabilities,\n nativeProgress: {\n set: (state, value) => Effect.sync(() => {\n if (mounted !== undefined)\n mounted.sigil.setProgress(state, value);\n else\n setNativeProgress(state, value, stdout);\n }),\n },\n output: {\n print,\n format: formatView,\n render: renderView,\n info: log(\"info\"),\n success: log(\"success\"),\n warning: log(\"warning\"),\n error: log(\"error\"),\n },\n prompt: {\n text: (inputOptions) => run(textScreen(inputOptions)),\n password: (inputOptions) => run(passwordScreen(inputOptions)),\n confirm: (confirmOptions) => run(confirmScreen(confirmOptions)),\n select: (selectOptions) => run(selectScreen(selectOptions)),\n multiSelect: (selectOptions) => run(multiSelectScreen(selectOptions)),\n cycle: (selectOptions) => run(cycleSelectScreen(selectOptions)),\n awaitExternal: (externalOptions) => run(awaitExternalScreen(externalOptions)),\n menu,\n custom: run,\n },\n wizard,\n application: app,\n live: { progress, open: live },\n task: (taskOptions, effect) => Effect.scoped(Effect.gen(function* () {\n const handle = yield* progress(taskOptions);\n return yield* effect.pipe(Effect.onExit((exit) => Exit.isSuccess(exit)\n ? handle.succeed()\n : // Interruption (Ctrl+C) is not a failure — remove the row\n // instead of painting a red error status.\n Cause.hasInterruptsOnly(exit.cause)\n ? handle.close\n : handle.fail()));\n })),\n };\n return {\n service,\n dispose: async () => {\n // After dispose the runtime must never mount again; force teardown even\n // if stray live rows were leaked.\n disposed = true;\n await unmount(true);\n },\n };\n};\n//# sourceMappingURL=Runtime.js.map","import * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport { detectCapabilities } from \"@alchemy.run/sigil/capabilities\";\nimport { isNonInteractive } from \"../../Util/interactive.js\";\nimport { CliKit } from \"./CliKit.js\";\nexport const resolveCapabilities = (options) => {\n const stdout = options.stdout ?? process.stdout;\n const stdin = options.stdin ?? process.stdin;\n const detected = detectCapabilities({ stdout });\n const input = options.input ??\n (stdin.isTTY === true && stdout.isTTY === true && !isNonInteractive());\n return {\n input,\n columns: detected.size.columns,\n rows: detected.size.rows,\n colors: options.colors ?? detected.supports.color,\n unicode: options.unicode ?? detected.supports.unicode,\n alternateScreen: detected.supports.alternateScreen,\n };\n};\n// One shared import promise per process. Concurrent dynamic imports of the\n// same module (e.g. two test files building this layer at once) can race in\n// bun and hand one caller a partially-evaluated namespace, which throws a\n// TDZ ReferenceError on `makeRuntime`; funneling every build through a\n// single import() sidesteps the race.\nlet sigilRuntime;\nconst loadSigilRuntime = () => (sigilRuntime ??= import(\"../components/view/Runtime.js\"));\n/** Provides one terminal runtime for the enclosing scope. */\nexport const layer = (options = {}) => Layer.effect(CliKit, Effect.acquireRelease(Effect.promise(async () => {\n const capabilities = resolveCapabilities(options);\n const { makeRuntime } = await loadSigilRuntime();\n return makeRuntime(options, capabilities);\n}), ({ dispose }) => Effect.promise(dispose)).pipe(Effect.map(({ service }) => service)));\n//# sourceMappingURL=layer.js.map","import * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport { Interaction } from \"../../Interaction.js\";\nimport { CliKit } from \"./CliKit.js\";\n/**\n * The CLI's implementation of the engine's {@link Interaction} capability,\n * backed by the full CliKit terminal runtime: messages and `task` render\n * through the live renderer, prompts run as real interactive screens.\n * Provided by the CLI entrypoints next to `CliKit.layer()`; every other\n * process uses `Interaction.layerNonInteractive` (or nothing at all —\n * children have no interaction capability in their graphs).\n */\nexport const CliKitInteraction = Layer.effect(Interaction, \n// CliKit's surface is a structural superset of Interaction's — the\n// terminal service IS the CLI's Interaction implementation.\nEffect.map(CliKit, (cli) => cli));\n//# sourceMappingURL=interaction.js.map","export const Screen = {\n make: (name, render) => ({ name, render }),\n};\n//# sourceMappingURL=types.js.map","export { accessors, Application, CliKit } from \"./CliKit.js\";\nexport { layer } from \"./layer.js\";\nexport { CliKitInteraction } from \"./interaction.js\";\nexport { openUrl } from \"../../Interaction.js\";\nexport { BrowserOpenFailed, NonInteractiveTerminal, TerminalCancelled, } from \"../../Interaction.js\";\nexport { glyphsFor, spinnerFramesFor, theme, } from \"../../Util/Theme.js\";\nexport { ANSI_BOLD, ANSI_DIM, ANSI_RESET, ansiFg, colorsEnabled, paint, pipedColorEnv, truncate, unicodeEnabled, } from \"../../Util/Terminal.js\";\nexport { Screen, } from \"../components/types.js\";\n//# sourceMappingURL=index.js.map","import * as Cause from \"effect/Cause\";\nimport * as Console from \"effect/Console\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport * as Schema from \"effect/Schema\";\nimport * as Runtime from \"effect/Runtime\";\nimport * as CliError from \"effect/unstable/cli/CliError\";\nimport { isUserFacing, UserFacingError } from \"../../UserFacingError.js\";\nimport { ANSI_DIM, ANSI_RESET, ansiFg, colorsEnabled, glyphsFor, theme, unicodeEnabled, } from \"../CliKit/index.js\";\nconst isTerminalCancelled = Schema.is(Schema.Struct({ _tag: Schema.Literals([\"TerminalCancelled\"]) }));\nconst isAuthErrorLike = Schema.is(Schema.Struct({\n _tag: Schema.Literals([\"AuthError\"]),\n cause: Schema.optional(Schema.Unknown),\n}));\nexport const isPromptCancellation = (error) => {\n for (let current = error, depth = 0; current != null && depth < 16; depth++) {\n if (isTerminalCancelled(current))\n return true;\n if (!isAuthErrorLike(current))\n return false;\n current = current.cause;\n }\n return false;\n};\nexport const EXIT_CANCELLED = 130;\nexport const setExitCode = (code) => Effect.sync(() => {\n process.exitCode = code;\n});\nexport const exitDeclined = setExitCode(1);\nlet interruptMessagesSuppressed = false;\nexport const suppressInterruptMessages = Effect.sync(() => {\n interruptMessagesSuppressed = true;\n});\nconst SHUTDOWN_FEEDBACK_DELAY_MS = 500;\n/**\n * Keep quick shutdowns quiet, but acknowledge cleanup that takes long enough\n * to be noticeable. The Effect runtime continues to own signal handling and\n * teardown; this listener only writes delayed feedback.\n */\nexport const installShutdownFeedback = Effect.sync(() => {\n let scheduled = false;\n const onSignal = () => {\n if (scheduled || interruptMessagesSuppressed)\n return;\n scheduled = true;\n const timer = setTimeout(() => {\n process.stderr.write(colorsEnabled()\n ? `\\n${ANSI_DIM}Shutting down${ANSI_RESET}\\n`\n : \"\\nShutting down\\n\");\n }, SHUTDOWN_FEEDBACK_DELAY_MS);\n timer.unref();\n };\n process.on(\"SIGINT\", onSignal);\n process.on(\"SIGTERM\", onSignal);\n});\nexport const handleCancellation = (self) => self.pipe(Effect.catchCause((cause) => {\n const cancelled = cause.reasons.some((reason) => {\n if (Cause.isFailReason(reason))\n return isPromptCancellation(reason.error);\n if (Cause.isDieReason(reason))\n return isPromptCancellation(reason.defect);\n return false;\n });\n return cancelled\n ? Console.log(colorsEnabled()\n ? `\\n${ANSI_DIM}Cancelled.${ANSI_RESET}`\n : \"\\nCancelled.\").pipe(Effect.andThen(setExitCode(EXIT_CANCELLED)))\n : Effect.failCause(cause);\n}), Effect.onInterrupt(() => interruptMessagesSuppressed\n ? Effect.void\n : Console.log(colorsEnabled() ? `\\n${ANSI_DIM}Exited.${ANSI_RESET}` : \"\\nExited.\")));\nclass ReportedCliError {\n cause;\n [Runtime.errorReported] = false;\n constructor(cause) {\n this.cause = cause;\n }\n}\n// `ConfigError` is effect's own class and cannot carry the `UserFacingError`\n// marker. Everything else is matched by the marker alone — new user-facing\n// errors opt in by assigning the symbol, not by growing this list.\nconst isUnmarkedUserFacingError = Schema.is(Schema.Struct({\n _tag: Schema.Literals([\"ConfigError\"]),\n message: Schema.String,\n}));\nconst isUserFacingError = (error) => isUserFacing(error) || isUnmarkedUserFacingError(error);\nexport class UserInputError extends Data.TaggedError(\"UserInputError\") {\n [UserFacingError] = true;\n}\nexport const handleUserErrors = (self) => self.pipe(Effect.catchCause((cause) => {\n for (const reason of cause.reasons) {\n const error = Cause.isFailReason(reason)\n ? reason.error\n : Cause.isDieReason(reason)\n ? reason.defect\n : undefined;\n if (isUserFacingError(error)) {\n const glyphs = glyphsFor(unicodeEnabled());\n return Console.error(`${colorsEnabled() ? `${ansiFg(theme.color.danger)}${glyphs.error} error:${ANSI_RESET}` : \"error:\"} ${error.message}`).pipe(Effect.flatMap(() => Effect.fail(new ReportedCliError(cause))));\n }\n }\n return Effect.failCause(cause);\n}));\nexport const handleCliErrors = (self) => self.pipe(handleCancellation, handleUserErrors);\nexport const failWithHelp = (commandPath) => setExitCode(1).pipe(Effect.andThen(Effect.fail(new CliError.ShowHelp({ commandPath: [...commandPath], errors: [] }))));\n//# sourceMappingURL=errors.js.map","import * as Cause from \"effect/Cause\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Option from \"effect/Option\";\nimport * as Scope from \"effect/Scope\";\nimport { Progress } from \"../../Alchemist/Progress.js\";\nimport * as Report from \"../../Report.js\";\nimport { CliKit } from \"../CliKit/CliKit.js\";\nexport const renderPlanning = (options) => (effect) => Effect.gen(function* () {\n const phaseLabel = {\n \"importing-module\": \"Importing stack module\",\n \"resolving-services\": \"Resolving stack services\",\n \"loading-state\": \"Loading stack state\",\n \"computing-plan\": options.computingLabel ?? \"Computing plan\",\n \"plan-ready\": options.readyLabel ?? \"Plan ready\",\n };\n const cli = yield* Report.Cli;\n const planning = yield* cli.startPlanningSession(phaseLabel[\"importing-module\"], options.stage, `${options.operation} · ${options.stage}`);\n const interactive = (yield* CliKit).terminal.input;\n const inFlight = new Set();\n let done = 0;\n let total = 0;\n const showCounter = (fallback) => Effect.suspend(() => {\n const current = inFlight.values().next().value ?? fallback;\n const rest = inFlight.size > 1 ? ` +${inFlight.size - 1}` : \"\";\n return planning.update(phaseLabel[\"computing-plan\"], `${done}/${total} · ${current}${rest}`);\n });\n return yield* effect.pipe(Effect.provideService(Progress, (event) => {\n switch (event._tag) {\n case \"plan.phase\":\n return event.phase === \"plan-ready\"\n ? planning.succeed(phaseLabel[\"plan-ready\"])\n : planning.update(phaseLabel[event.phase], options.stage, {\n spinning: event.phase !== \"importing-module\",\n });\n case \"state.bootstrap.started\":\n return planning.update(`Bootstrapping state store '${event.store}'`, options.stage);\n case \"state.bootstrap.completed\":\n return planning.update(phaseLabel[\"loading-state\"], options.stage);\n case \"plan.resource.started\":\n if (!interactive)\n return Effect.void;\n inFlight.add(event.fqn);\n total = Math.max(total, event.total);\n return showCounter(event.fqn);\n case \"plan.resource.completed\":\n case \"plan.action.completed\":\n if (!interactive)\n return Effect.void;\n inFlight.delete(event.fqn);\n done = event.completed;\n total = event.total;\n return showCounter(event.fqn);\n default:\n return Effect.void;\n }\n }), Effect.tapError(() => planning.fail(\"Planning failed\")), Effect.ensuring(planning.close));\n});\nexport const renderApply = (plan, options) => (effect) => Effect.gen(function* () {\n const cli = yield* Report.Cli;\n const session = yield* cli.startApplySession(plan, options);\n // Dev keeps the widget mounted after apply settles and parks in the\n // ambient scope; bind the widget's teardown to that scope so a reload\n // or Ctrl+C removes it instead of stacking it under the next one.\n if (options?.dev && session.close !== undefined) {\n const scope = yield* Effect.serviceOption(Scope.Scope);\n if (Option.isSome(scope)) {\n yield* Scope.addFinalizer(scope.value, session.close);\n }\n }\n return yield* effect.pipe(Effect.provideService(Progress, (event) => event._tag === \"apply.resource.status\" ||\n event._tag === \"apply.resource.note\"\n ? session.emit(event)\n : Effect.void), Effect.tap((value) => options?.dev && session.setOutput !== undefined\n ? session.setOutput(value)\n : Effect.void), Effect.onExit((exit) => Exit.isSuccess(exit)\n ? session.done(\"success\")\n : Cause.hasInterruptsOnly(exit.cause)\n ? Effect.void\n : session.done(\"failure\")));\n});\n//# sourceMappingURL=render.js.map","/**\n * Composable terminal layouts and interaction widgets.\n *\n * This is a separate entrypoint from `alchemy/Cli/CliKit` so importing the\n * injectable service does not eagerly load React, Sigil or Yoga.\n */\nexport { CliEnvironment, useBorderStyle, useCliEnvironment, useGlyphs, useKeyGlyphs, } from \"./Environment.js\";\nexport { Box, Gutter, Heading, Row, SectionHeading, Stack, Viewport, VirtualList, } from \"./Layout.js\";\nexport { Link, Text } from \"./Typography.js\";\nexport { Alert, KeyBar, Spinner, SpinnerGlyph, Status, Tabs, Toast, } from \"./Feedback.js\";\nexport { DescriptionList } from \"./Data.js\";\nexport { ChoiceGroup, CycleList, InlineConfirm, Pointer, PromptFrame, TextField, useCycleNavigation, useTerminalInput, useTerminalPaste, useTerminalSize, } from \"./Interactive.js\";\nexport { AnsweredPrompt, CancelledPrompt } from \"./Transcript.js\";\nexport { LiveStore, ProgressGroup, TaskRow, useLiveStore, } from \"./Live.js\";\nexport { ProgressBar } from \"./ProgressBar.js\";\n//# sourceMappingURL=index.js.map","import { jsx as _jsx } from \"@alchemy.run/sigil/jsx-runtime\";\n/** @jsxImportSource @alchemy.run/sigil */\nimport { AnsiText } from \"@alchemy.run/sigil\";\nimport { inspect } from \"node:util\";\nimport { Box, useCliEnvironment } from \"../ui/index.js\";\nexport function StackOutputs({ value, offset = 0, limit = Number.POSITIVE_INFINITY, }) {\n const { colors } = useCliEnvironment();\n const output = inspect(value, { colors });\n const lines = output.split(\"\\n\").slice(offset, offset + limit);\n return (_jsx(Box, { flexDirection: \"column\", children: lines.map((line, index) => (_jsx(AnsiText, { wrap: \"none\", children: line || \" \" }, offset + index))) }));\n}\nexport const stackOutputLineCount = (value) => inspect(value, { colors: false }).split(\"\\n\").length;\nexport const stackOutputsView = (value) => (_jsx(StackOutputs, { value: value }));\n//# sourceMappingURL=StackOutputs.js.map","import { ansiFg, theme } from \"./CliKit/index.js\";\n/** `450ms` under a second, `1.2s` at or above — shared by every renderer. */\nexport const formatElapsed = (ms) => ms < 1000 ? `${Math.max(0, Math.round(ms))}ms` : `${(ms / 1000).toFixed(1)}s`;\nexport const TAIL_COLORS = [\n ansiFg(theme.color.accent),\n ansiFg(theme.color.info),\n ansiFg(theme.color.danger),\n ansiFg(theme.color.warning),\n ansiFg(theme.color.accentBright),\n ansiFg(theme.color.muted),\n ansiFg(theme.color.accentMuted),\n ansiFg(theme.color.success),\n];\nexport const formatLocalTimestamp = (date) => {\n const y = date.getFullYear();\n const mo = String(date.getMonth() + 1).padStart(2, \"0\");\n const d = String(date.getDate()).padStart(2, \"0\");\n const h = String(date.getHours()).padStart(2, \"0\");\n const mi = String(date.getMinutes()).padStart(2, \"0\");\n const s = String(date.getSeconds()).padStart(2, \"0\");\n const ms = String(date.getMilliseconds()).padStart(3, \"0\");\n const tz = new Intl.DateTimeFormat(\"en-US\", { timeZoneName: \"short\" })\n .formatToParts(date)\n .find((part) => part.type === \"timeZoneName\")?.value ?? \"\";\n return `${y}-${mo}-${d} ${h}:${mi}:${s}.${ms} ${tz}`;\n};\n//# sourceMappingURL=Format.js.map","import { theme } from \"../../CliKit/index.js\";\nexport const actionStyle = {\n create: { color: theme.color.success, icon: \"add\" },\n update: { color: theme.color.warning, icon: \"edit\" },\n adopted: { color: theme.color.magenta, icon: \"adopt\" },\n delete: { color: theme.color.danger, icon: \"delete\" },\n orphaned: { color: theme.color.coral, icon: \"orphan\" },\n replace: { color: theme.color.magenta, icon: \"replace\" },\n noop: { color: theme.color.muted, icon: \"bullet\" },\n mixed: { color: theme.color.info, icon: \"info\" },\n run: { color: theme.color.info, icon: \"run\" },\n};\nexport const applyStatusColor = (status) => {\n switch (status) {\n case \"no change\":\n case \"pending\":\n case \"skipped\":\n return theme.color.muted;\n case \"attaching\":\n case \"post-attach\":\n case \"pre-creating\":\n return theme.color.info;\n case \"creating\":\n case \"creating replacement\":\n case \"created\":\n case \"orphaning\":\n case \"orphaned\":\n return theme.color.success;\n case \"updating\":\n case \"adopting\":\n case \"replacing\":\n case \"replaced\":\n case \"updated\":\n case \"adopted\":\n return theme.color.warning;\n case \"deleting\":\n case \"deleted\":\n return theme.color.danger;\n case \"running\":\n case \"ran\":\n return theme.color.info;\n case \"fail\":\n return theme.color.danger;\n default:\n return undefined;\n }\n};\n/** Settled states — the row will not change again. */\nexport const isTerminalStatus = (status) => status === \"created\" ||\n status === \"updated\" ||\n status === \"adopted\" ||\n status === \"deleted\" ||\n status === \"orphaned\" ||\n status === \"replaced\" ||\n status === \"ran\" ||\n status === \"skipped\" ||\n status === \"fail\";\nexport const isInProgress = (status) => status === \"attaching\" ||\n status === \"post-attach\" ||\n status === \"pre-creating\" ||\n status === \"creating\" ||\n status === \"creating replacement\" ||\n status === \"updating\" ||\n status === \"adopting\" ||\n status === \"deleting\" ||\n status === \"orphaning\" ||\n status === \"replacing\" ||\n status === \"running\";\n//# sourceMappingURL=statusStyle.js.map","/**\n * Pure formatting shared by the plan/deploy renderers (Sigil TUI +\n * non-interactive LoggingCli) for the local-vs-live provider-mode\n * indicator on a resource row.\n *\n * The rule: in a dev run every mode-stamped row shows its mode — the\n * whole point of `alchemy dev` is knowing what is emulated and what is\n * real, so `(local)` and `(remote)` are both explicit. A live deploy\n * only tags the exceptions (`local` leftovers from dev being\n * deleted/replaced) — tagging every row `remote` in a normal deploy\n * would be noise.\n *\n * - `alchemy dev` (default `\"local\"`): local rows are tagged `local`,\n * live rows are tagged `remote` — matching the `Alchemy.remote()`\n * vocabulary users see. The persisted enum stays `\"live\"`; only the\n * display says `remote`.\n * - `alchemy deploy` (default `\"live\"`): rows resolved to the local\n * provider are tagged `local`; live rows are untagged.\n * - Mode-agnostic providers have no resolved mode (`undefined`) — nothing\n * is shown.\n * - Mode-switch replacements ALWAYS annotate the transition\n * (e.g. `local → live`), regardless of the run default.\n */\n/** The display label for a mode-stamped row (`\"live\"` renders as `remote`). */\nexport const modeLabel = (mode) => mode === \"live\" ? \"remote\" : \"local\";\n/**\n * The mode note for a resource row, or `undefined` when nothing should be\n * shown (mode-agnostic rows, and live rows in a live-default run).\n *\n * @param mode the mode the node's provider was resolved for (`undefined`\n * for mode-agnostic providers — never annotated)\n * @param priorMode for replacements, the mode the old generation was\n * created with; when it differs from `mode` the transition is shown\n * @param defaultMode the run-level default (`alchemy dev` → `\"local\"`,\n * otherwise `\"live\"`); `undefined` is treated as `\"live\"`\n */\nexport const formatModeNote = (options) => {\n const { mode, priorMode } = options;\n if (mode === undefined)\n return undefined;\n // A genuine mode switch is always surfaced as the raw transition.\n if (priorMode !== undefined && priorMode !== mode) {\n return `${priorMode} → ${mode}`;\n }\n const defaultMode = options.defaultMode ?? \"live\";\n // Live-default runs stay quiet for live rows; dev runs tag everything.\n if (defaultMode === \"live\" && mode === \"live\")\n return undefined;\n return modeLabel(mode);\n};\n//# sourceMappingURL=ModeTag.js.map","import { stripVTControlCharacters } from \"node:util\";\nimport * as Effect from \"effect/Effect\";\nimport { makeLineBuffer } from \"./LineBuffer.js\";\nimport { ANSI_RESET, ansiFg, colorsEnabled } from \"./Terminal.js\";\nimport { theme } from \"./Theme.js\";\n/** Sigil-themed resource attribution shared by every append-only log path. */\nexport const formatResourceTag = (id, colors = colorsEnabled()) => colors ? `${ansiFg(theme.color.info)}[${id}]${ANSI_RESET}` : `[${id}]`;\nconst EFFECT_LOG_PREFIX = /^\\[\\d{2}:\\d{2}:\\d{2}\\.\\d{3}\\] (?:ALL|TRACE|DEBUG|INFO|WARN|ERROR|FATAL|NONE) \\(#\\d+\\)(?: [^:]+)?: /;\n/** Remove a pretty Effect prefix already rendered by a child process. */\nexport const stripChildEffectPrefix = (line) => {\n const match = stripVTControlCharacters(line).match(EFFECT_LOG_PREFIX);\n if (match === null)\n return line;\n // The match is measured against visible text. Walk the original line so\n // ANSI embedded in the child message survives while the prefix's ANSI is\n // discarded with the prefix itself.\n let visible = 0;\n let offset = 0;\n while (offset < line.length && visible < match[0].length) {\n if (line[offset] === \"\\x1b\") {\n const ansi = line.slice(offset).match(/^\\x1b\\[[0-?]*[ -/]*[@-~]/);\n if (ansi !== null) {\n offset += ansi[0].length;\n continue;\n }\n }\n offset++;\n visible++;\n }\n return line.slice(offset);\n};\n/**\n * The single terminal-output pipeline for resource-owned processes. Dev\n * servers, local workers, and deploy-time builders all use the same line\n * splitting, resource prefix, color policy, and stdout/stderr severity.\n */\nexport const makeResourceOutput = (id, console) => {\n const prefix = formatResourceTag(id);\n // stderr is a process transport, not a semantic failure: Vite and many\n // other tools write warnings, progress, and ordinary diagnostics there.\n // Sending it through Console.error makes CLIKit prepend an error glyph to\n // every line. Both streams therefore enter the renderer as plain resource\n // output; the child text retains its own ANSI severity styling.\n const writeLine = (line) => console.log(`${prefix} ${stripChildEffectPrefix(line)}`);\n return {\n stdout: makeLineBuffer(writeLine),\n stderr: makeLineBuffer(writeLine),\n };\n};\n/**\n * Effect-native output for resource-owned child processes whose streams are\n * already consumed inside an Effect. Both process channels are transport\n * details, not semantic severity, so they enter the configured logger at the\n * info level. The logger remains responsible for terminal and file sinks.\n */\nexport const makeResourceLogger = (id) => {\n const prefix = formatResourceTag(id);\n return (_channel, line) => Effect.logInfo(`${prefix} ${stripChildEffectPrefix(line)}`);\n};\n//# sourceMappingURL=ResourceOutput.js.map","import * as Effect from \"effect/Effect\";\nimport * as Redacted from \"effect/Redacted\";\nimport { havePropsChanged } from \"../Diff.js\";\nimport * as Output from \"../Output.js\";\nimport { isPlainData } from \"../Util/data.js\";\nimport { stringify } from \"yaml\";\nconst unifiedDriftLines = (expected, actual, depth = 0) => {\n const padding = \" \".repeat(depth);\n if (JSON.stringify(expected) === JSON.stringify(actual)) {\n return indent(formatYamlLines(expected), depth);\n }\n if (expected !== null &&\n actual !== null &&\n !Array.isArray(expected) &&\n !Array.isArray(actual) &&\n typeof expected === \"object\" &&\n typeof actual === \"object\") {\n const lines = [];\n for (const key of [\n ...new Set([...Object.keys(expected), ...Object.keys(actual)]),\n ].sort((a, b) => a.localeCompare(b))) {\n const hasExpected = Object.hasOwn(expected, key);\n const hasActual = Object.hasOwn(actual, key);\n const expectedValue = hasExpected ? expected[key] : UNDEFINED;\n const actualValue = hasActual ? actual[key] : UNDEFINED;\n if (hasExpected &&\n hasActual &&\n expectedValue !== null &&\n actualValue !== null &&\n !Array.isArray(expectedValue) &&\n !Array.isArray(actualValue) &&\n typeof expectedValue === \"object\" &&\n typeof actualValue === \"object\" &&\n JSON.stringify(expectedValue) !== JSON.stringify(actualValue)) {\n lines.push(`${padding}${key}:`);\n lines.push(...unifiedDriftLines(expectedValue, actualValue, depth + 2));\n }\n else if (JSON.stringify(expectedValue) === JSON.stringify(actualValue)) {\n lines.push(...indent(formatYamlLines({ [key]: expectedValue }), depth));\n }\n else {\n if (hasExpected) {\n lines.push(...indent(formatYamlLines({ [key]: expectedValue }), depth).map(mark(\"-\")));\n }\n if (hasActual) {\n lines.push(...indent(formatYamlLines({ [key]: actualValue }), depth).map(mark(\"+\")));\n }\n }\n }\n return lines;\n }\n return [\n ...indent(formatYamlLines(expected), depth).map(mark(\"-\")),\n ...indent(formatYamlLines(actual), depth).map(mark(\"+\")),\n ];\n};\nconst mark = (marker) => (line) => {\n return `${marker} ${line}`;\n};\n/** Match a `- `/`+ ` change marker emitted by {@link unifiedDriftLines}. */\nexport const matchYamlChange = (line) => {\n const match = line.match(/^([+-]) (.*)$/);\n return match === null\n ? undefined\n : { marker: match[1], content: match[2] };\n};\n/** Match an `indent` + `key:` + rest display-YAML line for colorizing. */\nexport const matchYamlKey = (line) => {\n const match = line.match(/^(\\s*)([A-Za-z_][\\w .-]*:)(.*)$/);\n return match === null\n ? undefined\n : { indent: match[1], key: match[2], value: match[3] };\n};\n/** Format the changed cloud attributes carried by a drift-repair plan. */\nexport const formatDriftPropertyYaml = (expected, actual, missing = false) => {\n const expectedValue = toYamlDisplayValue(expected);\n const actualValue = missing ? \"(missing)\" : toYamlDisplayValue(actual);\n return {\n kind: \"drift\",\n lines: unifiedDriftLines(expectedValue, actualValue),\n };\n};\nconst REDACTED = \"(redacted)\";\nconst KNOWN_AFTER_APPLY = \"(known after apply)\";\nconst COMPUTED = \"(computed)\";\nconst UNDEFINED = \"(undefined)\";\nconst OPAQUE = \"(opaque)\";\nconst CIRCULAR = \"(circular)\";\n/**\n * Turn arbitrary declared inputs or persisted state into safe, deterministic\n * plain data for terminal display. Deferred values are described, never run,\n * and Redacted values are replaced before their contents can reach YAML.\n */\nexport const toYamlDisplayValue = (value, ancestors = new WeakSet()) => {\n // Output expressions are Effects too, so this order is security-sensitive.\n if (Redacted.isRedacted(value))\n return REDACTED;\n if (Output.isExpr(value))\n return KNOWN_AFTER_APPLY;\n if (Effect.isEffect(value) || typeof value === \"function\")\n return COMPUTED;\n if (value === undefined)\n return UNDEFINED;\n if (value === null || typeof value === \"string\")\n return value;\n if (typeof value === \"boolean\" || typeof value === \"number\")\n return value;\n if (typeof value === \"bigint\")\n return `${value}n`;\n if (!isPlainData(value))\n return OPAQUE;\n if (ancestors.has(value))\n return CIRCULAR;\n ancestors.add(value);\n try {\n if (Array.isArray(value)) {\n return value.map((item) => toYamlDisplayValue(item, ancestors));\n }\n return Object.fromEntries(Object.keys(value)\n .sort((a, b) => a.localeCompare(b))\n .map((key) => [\n key,\n toYamlDisplayValue(value[key], ancestors),\n ]));\n }\n finally {\n ancestors.delete(value);\n }\n};\n/** Format a value as stable, unadorned YAML lines for terminal renderers. */\nexport const formatYamlLines = (value) => {\n const yaml = stringify(toYamlDisplayValue(value), {\n lineWidth: 0,\n sortMapEntries: true,\n });\n return (yaml || `${UNDEFINED}\\n`).trimEnd().split(\"\\n\");\n};\n/**\n * Build the detailed property document for a plan resource. This compares\n * persisted declared props to desired declared props; it is not cloud drift.\n */\nexport const formatDeclaredPropertyYaml = (oldProps, newProps, action) => {\n const desired = newProps ?? {};\n if (action === \"create\") {\n return {\n kind: \"create\",\n lines: [\"properties:\", ...indent(formatYamlLines(desired))],\n };\n }\n if (!havePropsChanged((oldProps ?? {}), desired)) {\n return undefined;\n }\n return {\n kind: \"change\",\n lines: [\n \"properties:\",\n ...unifiedDriftLines(toYamlDisplayValue(oldProps ?? {}), toYamlDisplayValue(desired), 2),\n ],\n };\n};\nconst indent = (lines, spaces = 2) => lines.map((line) => `${\" \".repeat(spaces)}${line}`);\n//# sourceMappingURL=PropertyDiff.js.map","import { toPath } from \"../FQN.js\";\nimport { formatDeclaredPropertyYaml, formatDriftPropertyYaml, } from \"./PropertyDiff.js\";\n/** No-op actions are dependency markers, not work the user needs to review. */\nexport const actionHasPlannedWork = (item) => item.action !== \"noop\";\n/** Count every resource and task, plus binding changes, for the Plan summary. */\nexport const buildPlanSummary = (plan) => {\n const allItems = [\n ...Object.values(plan.resources),\n ...Object.values(plan.deletions),\n ].filter((item) => item !== undefined);\n const counts = {\n create: 0,\n update: 0,\n adopted: 0,\n delete: 0,\n orphaned: 0,\n noop: 0,\n replace: 0,\n };\n for (const item of allItems) {\n counts[item.action]++;\n }\n const taskCounts = { run: 0, noop: 0, delete: 0 };\n for (const item of [\n ...Object.values(plan.actions ?? {}),\n ...Object.values(plan.actionDeletions ?? {}),\n ].filter((task) => task !== undefined)) {\n taskCounts[item.action]++;\n }\n const bindingChanges = allItems.reduce((count, item) => count +\n item.bindings.filter((binding) => binding.action !== \"noop\").length, 0);\n return { counts, taskCounts, bindingChanges };\n};\nexport function buildNamespaceTree(items, actions = []) {\n const root = {\n id: \"\",\n path: [],\n children: new Map(),\n resources: [],\n actions: [],\n };\n const getNode = (path) => {\n let current = root;\n for (let i = 0; i < path.length; i++) {\n const segment = path[i];\n let child = current.children.get(segment);\n if (!child) {\n child = {\n id: segment,\n path: path.slice(0, i + 1),\n children: new Map(),\n resources: [],\n actions: [],\n };\n current.children.set(segment, child);\n }\n current = child;\n }\n return current;\n };\n for (const item of items) {\n getNode(toPath(item.resource.Namespace)).resources.push(item);\n }\n for (const action of actions) {\n getNode(toPath(action.def.Namespace)).actions.push(action);\n }\n return root;\n}\nfunction deriveNamespaceAction(node) {\n const actions = new Set();\n for (const resource of node.resources) {\n actions.add(deriveResourceChildrenAction(resource, node));\n }\n for (const action of node.actions) {\n // Map task actions onto the resource action space for the rollup:\n // run → create, delete → delete, noop → noop.\n actions.add(action.action === \"run\"\n ? \"create\"\n : action.action === \"delete\"\n ? \"delete\"\n : \"noop\");\n }\n for (const child of node.children.values()) {\n const childAction = deriveNamespaceAction(child);\n if (childAction === \"mixed\") {\n return \"mixed\";\n }\n actions.add(childAction);\n }\n return deriveAction(actions);\n}\nexport function flattenTree(node, options = {}) {\n const result = [];\n flattenNamespace(node, 0, result, options);\n return result;\n}\nconst flattenNamespace = (node, depth, result, options) => {\n const sortedResources = [...node.resources].sort((a, b) => a.resource.LogicalId.localeCompare(b.resource.LogicalId));\n const sortedChildren = Array.from(node.children.entries()).sort(([a], [b]) => a.localeCompare(b));\n const resourceIds = new Set(sortedResources.map((resource) => resource.resource.LogicalId));\n for (const [id, child] of sortedChildren) {\n if (resourceIds.has(id) || isEmpty(child)) {\n continue;\n }\n result.push({\n type: \"namespace\",\n depth,\n id,\n path: child.path,\n action: deriveNamespaceAction(child),\n hasChildren: true,\n });\n flattenNamespace(child, depth + 1, result, options);\n }\n for (const resource of sortedResources) {\n const childNamespace = node.children.get(resource.resource.LogicalId);\n result.push({\n type: \"resource\",\n depth,\n id: resource.resource.LogicalId,\n path: [...node.path, resource.resource.LogicalId],\n action: resource.action,\n resourceType: resource.resource.Type,\n bindingCount: resource.bindings.length,\n providerMode: resource.mode,\n fromProviderMode: resource.action === \"replace\" &&\n resource.mode !== undefined &&\n resource.state.providerMode !== undefined &&\n resource.state.providerMode !== resource.mode\n ? resource.state.providerMode\n : undefined,\n propertyYaml: \"drift\" in resource && resource.drift !== undefined\n ? formatDriftPropertyYaml(resource.drift.expected, resource.drift.actual, resource.drift.missing)\n : options.includePropertyYaml &&\n (resource.action === \"create\" ||\n resource.action === \"update\" ||\n resource.action === \"adopted\" ||\n resource.action === \"replace\")\n ? formatDeclaredPropertyYaml(resource.action === \"create\" ? {} : resource.state.props, resource.props, resource.action === \"adopted\" ? \"update\" : resource.action)\n : undefined,\n });\n for (const binding of [...resource.bindings].sort((a, b) => a.sid.localeCompare(b.sid))) {\n result.push({\n type: \"binding\",\n depth: depth + 1,\n id: binding.sid,\n path: [...node.path, resource.resource.LogicalId, binding.sid],\n action: binding.action,\n bindingSid: binding.sid,\n });\n }\n if (childNamespace) {\n flattenNamespace(childNamespace, depth + 1, result, options);\n }\n }\n // Actions are listed after resources at the same depth.\n const sortedActions = [...node.actions].sort((a, b) => a.def.LogicalId.localeCompare(b.def.LogicalId));\n for (const action of sortedActions) {\n result.push({\n type: \"action\",\n depth,\n id: action.def.LogicalId,\n path: [...node.path, action.def.LogicalId],\n action: action.action,\n actionType: action.def.Type,\n });\n }\n};\nconst isEmpty = (node) => node.resources.length === 0 &&\n node.actions.length === 0 &&\n Array.from(node.children.values()).every(isEmpty);\nconst deriveResourceChildrenAction = (resource, node) => {\n const actions = new Set([\n resource.action,\n ]);\n for (const binding of resource.bindings) {\n actions.add(binding.action);\n }\n const childNamespace = node.children.get(resource.resource.LogicalId);\n if (childNamespace) {\n actions.add(deriveNamespaceAction(childNamespace));\n }\n return deriveAction(actions);\n};\nconst deriveAction = (actions) => {\n if (actions.size === 0)\n return \"noop\";\n if (actions.has(\"replace\"))\n return actions.size === 1 ? \"replace\" : \"mixed\";\n if (actions.has(\"orphaned\"))\n return actions.size === 1 ? \"orphaned\" : \"mixed\";\n if (actions.has(\"delete\"))\n return actions.size === 1 ? \"delete\" : \"mixed\";\n if (actions.has(\"create\"))\n return actions.size === 1 ? \"create\" : \"mixed\";\n if (actions.has(\"adopted\"))\n return actions.size === 1 ? \"adopted\" : \"mixed\";\n if (actions.has(\"update\"))\n return actions.size === 1 ? \"update\" : \"mixed\";\n return \"noop\";\n};\n//# sourceMappingURL=NamespaceTree.js.map","import * as Clock from \"effect/Clock\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Prompt from \"effect/unstable/cli/Prompt\";\nimport { inspect } from \"node:util\";\nimport { Cli } from \"../Report.js\";\nimport { canPromptOnStdin } from \"../Util/interactive.js\";\nimport { NonInteractiveTerminal } from \"../Interaction.js\";\nimport { ansiFg, colorsEnabled, theme } from \"./CliKit/index.js\";\nimport { formatElapsed } from \"./Format.js\";\nimport { actionStyle, applyStatusColor, isTerminalStatus as isTerminal, } from \"./components/view/statusStyle.js\";\nimport { formatModeNote } from \"./ModeTag.js\";\nimport { formatResourceTag } from \"../Util/ResourceOutput.js\";\nimport { formatDeclaredPropertyYaml, matchYamlChange, matchYamlKey, } from \"./PropertyDiff.js\";\nimport { actionHasPlannedWork, buildPlanSummary } from \"./NamespaceTree.js\";\nconst ESC = \"\\x1b[\";\nconst RESET = `${ESC}0m`;\n// Shared with every other non-ink output path — notably it honors\n// FORCE_COLOR, so lines emitted from the piped dev sidecar keep their color.\nconst useColor = colorsEnabled();\nconst c = (code, s) => useColor ? `${ESC}${code}m${s}${RESET}` : s;\nconst hex = (color) => (s) => useColor ? `${ansiFg(color)}${s}${RESET}` : s;\nconst dim = (s) => c(\"2\", s);\nconst bold = (s) => c(\"1\", s);\nconst red = hex(theme.color.danger);\nconst green = hex(theme.color.success);\nconst blue = hex(theme.color.accent);\nconst cyan = hex(theme.color.info);\n// noop stays terminal-dim rather than brand-muted so it recedes in plain logs\nconst actionColor = {\n create: hex(actionStyle.create.color),\n update: hex(actionStyle.update.color),\n adopted: hex(actionStyle.adopted.color),\n replace: hex(actionStyle.replace.color),\n delete: hex(actionStyle.delete.color),\n orphaned: hex(actionStyle.orphaned.color),\n noop: dim,\n};\n// muted stays terminal-dim rather than brand-muted, matching `actionColor`.\nconst statusColor = (status) => {\n const color = applyStatusColor(status);\n if (color === undefined || color === theme.color.muted)\n return dim;\n return hex(color);\n};\nconst tag = formatResourceTag;\n/**\n * In-progress statuses that represent real cloud work. Plain output has no\n * spinner, so these lines are the liveness signal in CI logs\n * (CloudFormation-style IN_PROGRESS rows). Bookkeeping transitions\n * (`pending`, `attaching`, `post-attach`) stay silent — they resolve in\n * milliseconds and would double the log for no information.\n */\nconst isActive = (status) => status === \"pre-creating\" ||\n status === \"creating\" ||\n status === \"creating replacement\" ||\n status === \"updating\" ||\n status === \"adopting\" ||\n status === \"deleting\" ||\n status === \"orphaning\" ||\n status === \"replacing\" ||\n status === \"running\";\n/**\n * Dim `(local)` / `(remote)` / `(local → live)` suffix for a resource row,\n * or `\"\"` when the row's mode matches the run default (the quiet common\n * case). See {@link formatModeNote} for the rule.\n */\nconst modeSuffix = (options) => {\n const note = formatModeNote(options);\n return note ? ` ${dim(`(${note})`)}` : \"\";\n};\n/** Exported for unit tests — pure plan-preview rendering. */\nexport const formatPlanLines = (plan, options = {}) => {\n const allItems = [\n ...Object.values(plan.resources),\n ...Object.values(plan.deletions),\n ];\n const tasks = [\n ...Object.values(plan.actions ?? {}),\n ...Object.values(plan.actionDeletions ?? {}),\n ]\n .filter((task) => task !== undefined)\n .filter(actionHasPlannedWork);\n if (allItems.length === 0 && tasks.length === 0) {\n return [`${bold(\"Plan:\")} ${dim(\"no resources\")}`];\n }\n const { counts, bindingChanges } = buildPlanSummary(plan);\n const summaryParts = [\"create\", \"update\", \"adopted\", \"replace\", \"delete\", \"orphaned\"]\n .filter((a) => counts[a])\n .map((a) => actionColor[a](`${counts[a]} to ${a}`));\n if (bindingChanges > 0) {\n summaryParts.push(cyan(`${bindingChanges} binding changes`));\n }\n if (tasks.length > 0) {\n summaryParts.push(cyan(`${tasks.length} tasks`));\n }\n const summary = summaryParts.length === 0\n ? dim(\"no changes\")\n : summaryParts.join(dim(\", \"));\n const sorted = [...allItems].sort((a, b) => a.resource.LogicalId.localeCompare(b.resource.LogicalId));\n const lines = [`${bold(\"Plan:\")} ${summary}`];\n if (options.detailed && sorted.length > 0)\n lines.push(\"\");\n for (const [index, item] of sorted.entries()) {\n if (options.detailed && index > 0)\n lines.push(\"\");\n const action = actionColor[item.action](item.action);\n const mode = modeSuffix({\n mode: item.mode,\n priorMode: item.action === \"replace\" ? item.state.providerMode : undefined,\n defaultMode: plan.defaultMode,\n });\n // Surface FQN migrations: `[Assets] update (renamed from Bucket)` —\n // the update exists to re-brand the moved row's physical resource, and\n // without the note the plan gives no hint why an untouched resource\n // reconciles. (Only apply-side nodes can carry a rename — see\n // `ApplyNodeBase`.)\n const renamed = \"renamedFrom\" in item && item.renamedFrom?.length\n ? ` ${dim(`(renamed from ${item.renamedFrom.join(\", \")})`)}`\n : \"\";\n lines.push(`${tag(item.resource.FQN)} ${action}${mode}${renamed}`);\n for (const binding of [...item.bindings].sort((a, b) => a.sid.localeCompare(b.sid))) {\n const bindingAction = binding.action === \"delete\"\n ? dim(\"unbind\")\n : actionColor[binding.action](binding.action);\n lines.push(`${tag(`${item.resource.FQN}/${binding.sid}`)} ${bindingAction}`);\n }\n if (options.detailed &&\n (item.action === \"create\" ||\n item.action === \"update\" ||\n item.action === \"adopted\" ||\n item.action === \"replace\")) {\n const document = formatDeclaredPropertyYaml(item.action === \"create\" ? {} : item.state.props, item.props, item.action === \"adopted\" ? \"update\" : item.action);\n if (document === undefined) {\n lines.push(` ${dim(\"no declared property changes\")}`);\n }\n else {\n lines.push(...document.lines.map((line) => ` ${colorYamlLine(line, document.kind)}`));\n }\n }\n }\n for (const task of tasks.sort((a, b) => a.def.LogicalId.localeCompare(b.def.LogicalId))) {\n lines.push(`${tag(task.def.FQN)} ${cyan(task.action === \"delete\" ? \"drop\" : \"run\")} ${dim(\"[action]\")}`);\n }\n return lines;\n};\nconst colorYamlLine = (line, kind) => {\n const change = matchYamlChange(line);\n if (change !== undefined) {\n const color = change.marker === \"-\" ? red : green;\n return color(`${change.marker} ${change.content}`);\n }\n const key = matchYamlKey(line);\n if (key === undefined)\n return line;\n const color = kind === \"create\" ? green : cyan;\n return `${key.indent}${color(key.key)}${key.value}`;\n};\nexport const LoggingCli = Layer.effect(Cli, Effect.gen(function* () {\n // Captured at layer build so `approvePlan` keeps the CLIService signature\n // (no requirements on the returned Effects).\n const promptContext = yield* Effect.context();\n const confirm = (options) => Prompt.Confirm(options).pipe(Effect.catchTag(\"QuitError\", () => Effect.succeed(false)), Effect.provideContext(promptContext));\n return Cli.of({\n startPlanningSession: (label, _detail, title) => Effect.gen(function* () {\n // Same information as the interactive session, one plain line per\n // change: the title header carries the operation + stage once, each\n // phase prints as it starts, and the settle line carries the total\n // planning time (the spinner's implicit \"how long did that take\").\n const startedAt = yield* Clock.currentTimeMillis;\n if (title !== undefined)\n yield* Effect.logInfo(bold(title));\n yield* Effect.logInfo(dim(label));\n let closed = false;\n let lastLabel = label;\n const write = (nextLabel, _nextDetail) => Effect.suspend(() => {\n // Repeated updates within one phase (spinner detail refreshes)\n // carry nothing new for a line-per-change log.\n if (closed || nextLabel === lastLabel)\n return Effect.void;\n lastLabel = nextLabel;\n return Effect.logInfo(dim(nextLabel));\n });\n const finish = (message, paint) => Effect.suspend(() => {\n if (closed)\n return Effect.void;\n closed = true;\n return Clock.currentTimeMillis.pipe(Effect.flatMap((now) => Effect.logInfo(`${paint(message)} ${dim(`(${formatElapsed(now - startedAt)})`)}`)));\n });\n return {\n update: write,\n succeed: (message = \"Plan ready\") => finish(message, green),\n fail: (message = \"Planning failed\") => finish(message, red),\n close: Effect.sync(() => {\n closed = true;\n }),\n };\n }),\n approvePlan: (plan, options) => Effect.gen(function* () {\n for (const line of formatPlanLines(plan, options))\n yield* Effect.logInfo(line);\n if (canPromptOnStdin()) {\n return yield* confirm(plan.destroy === true\n ? { message: \"Destroy these resources?\", initial: false }\n : { message: \"Apply this plan?\", initial: true });\n }\n return yield* Effect.fail(new NonInteractiveTerminal({\n operation: \"approve deployment plan\",\n message: \"Cannot approve this operation without terminal input. Pass --yes to continue.\",\n }));\n }),\n displayPlan: (plan, options) => Effect.gen(function* () {\n for (const line of formatPlanLines(plan, options))\n yield* Effect.logInfo(line);\n }),\n startApplySession: (plan, options) => Effect.gen(function* () {\n for (const line of formatPlanLines(plan, options))\n yield* Effect.logInfo(line);\n yield* Effect.logInfo(\"\");\n const startedAt = yield* Clock.currentTimeMillis;\n const started = new Map();\n const terminal = new Map();\n const notes = new Map();\n const statusNotes = new Map();\n return {\n setOutput: (value) => Effect.logInfo(inspect(value, { colors: false })),\n // Progress is an Effect log record, just like provider and build\n // diagnostics, so the append-only renderer gives every line the\n // same timestamp / level / fiber prefix.\n emit: (event) => Clock.currentTimeMillis.pipe(Effect.flatMap((now) => Effect.suspend(() => {\n if (event._tag === \"apply.resource.note\") {\n // `status` notes only surface as the settle line's suffix;\n // everything else streams, deduping consecutive repeats.\n if (event.kind === \"status\") {\n statusNotes.set(event.fqn, event.message);\n return Effect.void;\n }\n if (notes.get(event.fqn) === event.message)\n return Effect.void;\n notes.set(event.fqn, event.message);\n return Effect.logInfo(`${tag(event.fqn)} ${blue(event.message)}`);\n }\n const id = event.fqn;\n const mode = modeSuffix({\n mode: event.providerMode,\n priorMode: event.fromProviderMode,\n defaultMode: plan.defaultMode,\n });\n if (!isTerminal(event.status)) {\n if (!isActive(event.status))\n return Effect.void;\n if (!started.has(id))\n started.set(id, now);\n return Effect.logInfo(`${tag(id)} ${dim(event.status)}${mode}`);\n }\n terminal.set(id, event.status);\n const status = statusColor(event.status)(event.status);\n const from = started.get(id);\n const took = from === undefined\n ? \"\"\n : ` ${dim(`(${formatElapsed(now - from)})`)}`;\n const message = event.message ?? statusNotes.get(event.fqn);\n // Failures carry their error as the message — paint it\n // red so the line reads as the error line for that\n // resource, without waiting for the final cause dump.\n const msg = message\n ? ` ${dim(\"—\")} ${event.status === \"fail\" ? red(message) : message}`\n : \"\";\n return Effect.logInfo(`${tag(id)} ${status}${mode}${msg}${took}`);\n }))),\n done: (outcome) => Clock.currentTimeMillis.pipe(Effect.flatMap((now) => {\n const statuses = [...terminal.values()];\n const failed = statuses.filter((s) => s === \"fail\").length;\n const skipped = statuses.filter((s) => s === \"skipped\").length;\n const succeeded = terminal.size - failed - skipped;\n const parts = [green(`${succeeded} succeeded`)];\n if (failed)\n parts.push(red(`${failed} failed`));\n if (skipped)\n parts.push(dim(`${skipped} skipped`));\n return Effect.logInfo(\"\").pipe(Effect.andThen(Effect.logInfo(`${bold(outcome === \"success\" ? \"Done:\" : \"Failed:\")} ${parts.join(dim(\", \"))} ${dim(`(${formatElapsed(now - startedAt)})`)}`)));\n })),\n };\n }),\n });\n}));\n//# sourceMappingURL=LoggingCli.js.map","import * as CliOutput from \"effect/unstable/cli/CliOutput\";\n/**\n * Compact enum-style flag types so one long choice list (`--log-level`'s\n * nine choices) doesn't widen the description column for every flag.\n */\nconst compactFlagType = (type) => {\n if (type === \"boolean\" || type.length <= 24)\n return type;\n const bracketed = type.startsWith(\"<\") && type.endsWith(\">\");\n const value = bracketed ? type.slice(1, -1) : type;\n const choices = value.split(\"|\");\n const compact = choices.length > 2\n ? `${choices.slice(0, 2).join(\"|\")}|…`\n : `${value.slice(0, 21)}…`;\n return bracketed ? `<${compact}>` : compact;\n};\nconst compactFlag = (flag) => ({\n ...flag,\n type: compactFlagType(flag.type),\n});\nconst compactDoc = (doc) => ({\n ...doc,\n flags: doc.flags?.map(compactFlag),\n globalFlags: doc.globalFlags?.map(compactFlag),\n});\n/**\n * Bound every line to the terminal width, breaking at spaces; continuation\n * lines keep the original indent plus two columns. The default formatter\n * never wraps, so long descriptions would otherwise run off the terminal.\n */\nconst wrapLines = (text, width) => text\n .split(\"\\n\")\n .flatMap((line) => {\n if (line.length <= width)\n return [line];\n const continuation = `${line.match(/^\\s*/)[0]} `;\n const out = [];\n let current;\n for (const word of line.trim().split(/\\s+/)) {\n if (current === undefined) {\n current = `${line.match(/^\\s*/)[0]}${word}`;\n }\n else if (current.length + word.length + 1 <= width) {\n current += ` ${word}`;\n }\n else {\n out.push(current);\n current = continuation + word;\n }\n }\n if (current !== undefined)\n out.push(current);\n return out;\n})\n .join(\"\\n\");\n/**\n * Help formatter for plain (non-interactive) runs: the default effect/cli\n * formatter with colors off, enum flag types compacted, and output wrapped\n * to the terminal width — CI logs, redirected output, and coding agents\n * get parseable, bounded lines.\n */\nexport const plainCliFormatter = (options) => {\n const columns = Math.max(60, Math.min(options.columns, 120));\n const fallback = CliOutput.defaultFormatter({ colors: false });\n return {\n ...fallback,\n formatHelpDoc: (doc) => wrapLines(fallback.formatHelpDoc(compactDoc(doc)), columns),\n };\n};\n//# sourceMappingURL=PlainCliFormatter.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"@alchemy.run/sigil/jsx-runtime\";\nimport { Row, Text, useGlyphs } from \"../ui/index.js\";\nimport { theme } from \"../../CliKit/index.js\";\nimport { actionStyle } from \"./statusStyle.js\";\nexport const namespaceStyle = (action) => actionStyle[action] ?? {\n color: theme.color.muted,\n icon: \"info\",\n};\nexport function NamespaceRow({ id, depth, action, }) {\n const style = namespaceStyle(action);\n const glyphs = useGlyphs();\n return (_jsxs(Row, { gap: 1, paddingLeft: depth * 2, children: [_jsx(Text, { color: style.color, children: glyphs[style.icon] }), _jsx(Text, { color: theme.color.accent, children: id })] }));\n}\n//# sourceMappingURL=PlanRow.js.map","import { buildNamespaceTree, buildPlanSummary, flattenTree, } from \"../../NamespaceTree.js\";\nimport { isInProgress, isTerminalStatus } from \"./statusStyle.js\";\n/**\n * Only resources and actions receive apply events and settle. Namespaces are\n * grouping only, and bindings are reconciled by their host resource, so\n * counting them would leave the progress total unreachable.\n */\nconst isProgressRow = (row) => row.type === \"resource\" || row.type === \"task\";\nconst getRowKey = (item) => item.path.join(\"/\");\nconst findCrudByLogicalId = (plan, id) => [...Object.values(plan.resources), ...Object.values(plan.deletions)].find((item) => item?.resource.LogicalId === id);\nconst buildRows = (plan, detailed) => {\n const resources = [\n ...Object.values(plan.resources),\n ...Object.values(plan.deletions).filter((item) => item !== undefined),\n ];\n const actions = [\n ...Object.values(plan.actions ?? {}),\n ...Object.values(plan.actionDeletions ?? {}),\n ].filter((task) => task !== undefined);\n return flattenTree(buildNamespaceTree(resources, actions), {\n includePropertyYaml: detailed,\n }).map((item) => {\n if (item.type === \"namespace\") {\n return {\n key: getRowKey(item),\n type: \"namespace\",\n id: item.id,\n depth: item.depth,\n action: item.action,\n };\n }\n if (item.type === \"binding\") {\n return {\n key: getRowKey(item),\n type: \"binding\",\n id: item.bindingSid ?? item.id,\n depth: item.depth,\n action: item.action,\n hostKey: item.path.slice(0, -1).join(\"/\"),\n };\n }\n if (item.type === \"action\") {\n return {\n key: getRowKey(item),\n type: \"task\",\n id: item.id,\n depth: item.depth,\n action: item.action,\n };\n }\n return {\n key: getRowKey(item),\n type: \"resource\",\n id: item.id,\n resourceType: item.resourceType ?? \"Unknown\",\n depth: item.depth,\n action: item.action,\n providerMode: item.providerMode,\n fromProviderMode: item.fromProviderMode,\n propertyYaml: item.propertyYaml,\n persistedApplyStatus: item.action === \"noop\"\n ? (() => {\n const crud = findCrudByLogicalId(plan, item.id);\n return crud?.action === \"noop\" ? crud.state.status : undefined;\n })()\n : undefined,\n };\n });\n};\nexport const initialResourceState = (row) => ({\n key: row.key,\n id: row.id,\n status: row.action === \"noop\" ? (row.persistedApplyStatus ?? \"created\") : \"pending\",\n});\nconst buildInitialTasks = (rows) => new Map(rows.flatMap((row) => {\n if (row.type === \"resource\")\n return [[row.key, initialResourceState(row)]];\n if (row.type === \"task\") {\n return [\n [\n row.key,\n {\n key: row.key,\n id: row.id,\n status: row.action === \"noop\" ? \"skipped\" : \"pending\",\n },\n ],\n ];\n }\n return [];\n}));\nexport class PlanTree {\n rows;\n progressRows;\n summary;\n mode;\n detailed;\n titleDetail;\n defaultMode;\n state;\n listeners = new Set();\n constructor(plan, options = {}) {\n this.detailed = options.detailed ?? false;\n this.mode = options.mode ?? \"review\";\n this.titleDetail = options.titleDetail;\n this.defaultMode = plan.defaultMode;\n this.rows = \"rows\" in plan ? plan.rows : buildRows(plan, this.detailed);\n this.progressRows = this.rows.filter(isProgressRow);\n this.summary = \"rows\" in plan ? plan.summary : buildPlanSummary(plan);\n this.state = {\n tasks: buildInitialTasks(this.rows),\n label: options.label ?? \"Plan\",\n expanded: options.expanded ?? true,\n viewport: options.viewport ?? \"virtual\",\n busy: options.busy ?? false,\n outcome: undefined,\n output: undefined,\n view: \"plan\",\n };\n }\n subscribe(listener) {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n }\n snapshot() {\n return this.state;\n }\n progress() {\n let completed = 0;\n let failures = 0;\n let total = 0;\n for (const row of this.progressRows) {\n const status = this.state.tasks.get(row.key)?.status;\n if (row.action !== \"noop\") {\n total++;\n if (status !== undefined && isTerminalStatus(status))\n completed++;\n }\n if (status === \"fail\")\n failures++;\n }\n return { completed, failures, total };\n }\n setExpanded(expanded) {\n this.update({ expanded });\n }\n setLabel(label) {\n this.update({ label });\n }\n setViewport(viewport) {\n this.update({ viewport });\n }\n setBusy(busy) {\n this.update({\n busy,\n outcome: busy ? undefined : this.state.outcome,\n view: busy ? \"plan\" : this.state.view,\n });\n }\n finish(outcome, label, view = this.state.view) {\n this.update({ busy: false, outcome, label, view });\n }\n setOutput(output) {\n this.update({ output });\n }\n setView(view) {\n this.update({ view });\n }\n emit(event) {\n const tasks = new Map(this.state.tasks);\n const key = event.fqn;\n const now = Date.now();\n const timing = (current, status) => {\n const startedAt = current?.startedAt ?? (isInProgress(status) ? now : undefined);\n return {\n startedAt,\n elapsedMs: isTerminalStatus(status) && startedAt !== undefined\n ? now - startedAt\n : current?.elapsedMs,\n };\n };\n if (event._tag === \"apply.resource.status\") {\n const current = tasks.get(key);\n if (current) {\n tasks.set(key, {\n key,\n id: event.id,\n status: event.status,\n message: event.message ?? current.message,\n ...timing(current, event.status),\n });\n }\n }\n else {\n const current = tasks.get(key);\n if (current)\n tasks.set(key, { ...current, message: event.message });\n }\n this.update({ tasks });\n }\n update(patch) {\n this.state = { ...this.state, ...patch };\n for (const listener of this.listeners)\n listener();\n }\n}\n//# sourceMappingURL=PlanTree.js.map","import { useMemo, useState } from \"@alchemy.run/sigil/react\";\nimport { useTerminalInput } from \"../ui/index.js\";\nimport { stackOutputLineCount } from \"./StackOutputs.js\";\nimport {} from \"./PlanTree.js\";\nimport { isTerminalStatus } from \"./statusStyle.js\";\nconst planLines = (rows, detailed) => rows.flatMap((row) => {\n const lines = [{ kind: \"row\", row }];\n if (row.type !== \"resource\")\n return lines;\n const showYaml = detailed || row.propertyYaml?.kind === \"drift\";\n if (!showYaml)\n return lines;\n if (row.propertyYaml !== undefined) {\n lines.push(...row.propertyYaml.lines.map((line, index) => ({\n kind: \"yaml\",\n key: `${row.key}:yaml:${index}`,\n line,\n paddingLeft: row.depth * 2 + 2,\n })));\n }\n else if (row.action === \"update\" ||\n row.action === \"adopted\" ||\n row.action === \"replace\") {\n lines.push({\n kind: \"note\",\n key: `${row.key}:note`,\n paddingLeft: row.depth * 2 + 2,\n });\n }\n return lines;\n});\nexport const usePlanViewport = (options) => {\n const { tree, state, lineBudget, collapsible, collapsed } = options;\n const { rows, detailed } = tree;\n const { tasks, output, view, viewport } = state;\n const hasOutput = output !== undefined;\n const selectedView = view === \"output\" && hasOutput ? \"output\" : \"plan\";\n const virtual = viewport === \"virtual\";\n const expandedLines = useMemo(() => planLines(rows, detailed), [rows, detailed]);\n const available = lineBudget === Number.POSITIVE_INFINITY\n ? rows.length\n : Math.max(1, Math.floor(lineBudget));\n const length = selectedView === \"output\"\n ? stackOutputLineCount(output)\n : virtual\n ? expandedLines.length\n : rows.length;\n // Overflow markers render above and below the content window, so they must\n // consume its budget rather than extending the complete widget. Reserve\n // both even when following the end (where only the upper marker is shown),\n // because manual scrolling can make both visible without changing height.\n const budget = virtual && length > available ? Math.max(1, available - 2) : available;\n const maxOffset = Math.max(0, length - budget);\n const activeRow = tree.progressRows.find((row) => {\n const status = tasks.get(row.key)?.status;\n return status !== undefined && !isTerminalStatus(status);\n });\n const activeRowIndex = activeRow === undefined ? -1 : rows.indexOf(activeRow);\n const activeLineIndex = virtual\n ? expandedLines.findIndex((line) => line.kind === \"row\" && line.row === rows[activeRowIndex])\n : activeRowIndex;\n const followedOffset = selectedView === \"output\"\n ? maxOffset\n : Math.min(maxOffset, Math.max(0, (activeLineIndex < 0 ? length : activeLineIndex) -\n Math.floor(budget / 3)));\n const [manualOffsets, setManualOffsets] = useState({ plan: undefined, output: undefined });\n const offset = virtual\n ? Math.min(maxOffset, manualOffsets[selectedView] ?? followedOffset)\n : 0;\n const setOffset = (update) => setManualOffsets((current) => ({\n ...current,\n [selectedView]: update(current[selectedView]),\n }));\n useTerminalInput((input, key) => {\n if (collapsible && !key.ctrl && !key.meta && input.toLowerCase() === \"p\") {\n tree.setExpanded(collapsed);\n return;\n }\n if (collapsed)\n return;\n if (hasOutput && (key.left || key.right)) {\n tree.setView(selectedView === \"plan\" ? \"output\" : \"plan\");\n return;\n }\n if (!virtual)\n return;\n const page = Math.max(1, Math.floor(lineBudget));\n if (key.up)\n setOffset((current) => Math.max(0, (current ?? offset) - 1));\n else if (key.down)\n setOffset((current) => Math.min(maxOffset, (current ?? offset) + 1));\n else if (key.pageUp)\n setOffset((current) => Math.max(0, (current ?? offset) - page));\n else if (key.pageDown)\n setOffset((current) => Math.min(maxOffset, (current ?? offset) + page));\n else if (key.home)\n setOffset(() => 0);\n else if (key.end)\n setOffset(() => undefined);\n });\n return {\n selectedView,\n hasOutput,\n virtual,\n budget,\n offset,\n hiddenBelow: virtual ? Math.max(0, length - offset - budget) : 0,\n planLines: virtual && selectedView === \"plan\"\n ? expandedLines.slice(offset, offset + budget)\n : undefined,\n };\n};\n//# sourceMappingURL=usePlanViewport.js.map","import { measureElement, useProgress, useTitle, } from \"@alchemy.run/sigil\";\nimport { useLayoutEffect, useRef, useState } from \"@alchemy.run/sigil/react\";\nimport { useTerminalSize } from \"../ui/index.js\";\nexport const usePlanPresentation = (options) => {\n const { tree, state, busy, collapsible, hasFooter } = options;\n const { mode } = tree;\n const { label, expanded, viewport, outcome } = state;\n const { completed, failures, total } = tree.progress();\n const collapsed = collapsible && !expanded;\n const settled = !busy && completed >= total;\n useProgress(mode === \"apply\"\n ? {\n state: outcome === \"failure\" || failures > 0\n ? \"error\"\n : busy\n ? \"normal\"\n : \"inactive\",\n value: total === 0 ? undefined : (completed / total) * 100,\n }\n : { state: \"inactive\" });\n const titleProgress = settled || total === 0 ? \"\" : ` ${completed}/${total}`;\n const titleDetail = tree.titleDetail ? ` · ${tree.titleDetail}` : \"\";\n useTitle(mode === \"apply\" ? `${label}${titleProgress}${titleDetail}` : undefined);\n const beforeRef = useRef(null);\n const summaryRef = useRef(null);\n const controlsRef = useRef(null);\n const afterRef = useRef(null);\n const [chromeRows, setChromeRows] = useState();\n const { rows: terminalRows } = useTerminalSize();\n const showControls = mode === \"apply\" || (!collapsed && (collapsible || hasFooter));\n useLayoutEffect(() => {\n if (collapsed || viewport !== \"virtual\")\n return;\n const height = (ref) => ref.current === null ? 0 : measureElement(ref.current).height;\n const measured = height(beforeRef) +\n height(summaryRef) +\n height(controlsRef) +\n height(afterRef) +\n 1 +\n (showControls ? 1 : 0);\n setChromeRows((current) => (current === measured ? current : measured));\n });\n const lineBudget = viewport === \"virtual\"\n ? Math.max(1, terminalRows - (mode === \"apply\" ? 3 : 0) - (chromeRows ?? 8))\n : Number.POSITIVE_INFINITY;\n return {\n progress: { completed, failures, total },\n collapsed,\n showControls,\n lineBudget,\n refs: { beforeRef, summaryRef, controlsRef, afterRef },\n };\n};\n//# sourceMappingURL=usePlanPresentation.js.map","import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from \"@alchemy.run/sigil/jsx-runtime\";\n/** @jsxImportSource @alchemy.run/sigil */\n/**\n * THE plan renderer. Every surface that shows a plan tree — `alchemy plan`\n * output, the approval prompt, and the live apply/dev/destroy progress —\n * renders through this one state-driven component, so a plan always looks\n * the same wherever it appears.\n *\n * - One {@link PlanTree} holds the flattened tree (namespaces,\n * resources, bindings, actions) plus per-row runtime state (apply status\n * and the row's latest log message), updated from engine\n * {@link ApplyEvent}s.\n * - Two presentation `mode`s: `review` renders action glyphs (`+ ~ - ±`),\n * `apply` renders live statuses with spinners and per-row messages.\n * - `virtual` viewports follow the active row and support keyboard scrolling;\n * `full` viewports produce static terminal scrollback. This choice is\n * independent of whether the tree will receive more events.\n * - Property diffs (`detailed`) render in every mode, and the window is\n * line-budget aware so multi-line rows never overflow the terminal.\n */\nimport { useMemo, useSyncExternalStore } from \"@alchemy.run/sigil/react\";\nimport { Box, KeyBar, Row, SectionHeading, SpinnerGlyph, TaskRow, Text, useBorderStyle, useGlyphs, useKeyGlyphs, } from \"../ui/index.js\";\nimport { formatModeNote } from \"../../ModeTag.js\";\nimport { theme } from \"../../CliKit/index.js\";\nimport { formatElapsed } from \"../../Format.js\";\nimport { actionStyle, applyStatusColor, isInProgress, isTerminalStatus, } from \"./statusStyle.js\";\nimport { matchYamlChange, matchYamlKey } from \"../../PropertyDiff.js\";\nimport { NamespaceRow, namespaceStyle } from \"./PlanRow.js\";\nimport { StackOutputs } from \"./StackOutputs.js\";\nimport { PlanTree, initialResourceState, } from \"./PlanTree.js\";\nimport { usePlanViewport } from \"./usePlanViewport.js\";\nimport { usePlanPresentation } from \"./usePlanPresentation.js\";\nexport { PlanTree } from \"./PlanTree.js\";\n/**\n * Row detail: the latest log/annotation line, painted danger when the row\n * failed so the error reads at the row instead of only in the final dump.\n */\nconst rowDetail = (status, message) => message !== undefined && status === \"fail\" ? (_jsx(Text, { color: theme.color.danger, children: message })) : (message);\nconst usePlanTree = (tree) => {\n const subscribe = useMemo(() => tree.subscribe.bind(tree), [tree]);\n const snapshot = useMemo(() => tree.snapshot.bind(tree), [tree]);\n return useSyncExternalStore(subscribe, snapshot);\n};\nexport function Plan(props) {\n const { tree, collapsible = false, before, summaryBefore, summaryAfter, footer, after, } = props;\n const { mode } = tree;\n const keyGlyphs = useKeyGlyphs();\n const borderStyle = useBorderStyle();\n const state = usePlanTree(tree);\n const { tasks, label, viewport, busy } = state;\n const { progress: { completed, total: workRows }, collapsed, showControls, lineBudget, refs: { beforeRef, summaryRef, controlsRef, afterRef }, } = usePlanPresentation({\n tree,\n state,\n busy,\n collapsible,\n hasFooter: footer !== undefined,\n });\n const { selectedView, hasOutput, virtual: virtualizing, budget: budgetRows, offset: shownOffset, hiddenBelow, planLines: visibleLines, } = usePlanViewport({\n tree,\n state,\n lineBudget,\n collapsible,\n collapsed,\n });\n // ── Summary and operation bar ─────────────────────────────────────────\n const operationProgress = mode === \"apply\" ? (_jsxs(_Fragment, { children: [busy ? (_jsxs(_Fragment, { children: [_jsx(SpinnerGlyph, { color: theme.color.brand }), _jsx(Text, { children: \" \" })] })) : null, _jsx(SectionHeading, { children: label }), _jsx(Text, { tone: \"muted\", children: workRows === 0 ? \"\" : ` (${completed}/${workRows})` })] })) : null;\n const planSummary = selectedView === \"output\" ? (_jsx(SectionHeading, { children: \"Output\" })) : mode === \"apply\" ? (_jsx(ApplySummary, { label: \"Plan\", rows: tree.progressRows, tasks: tasks })) : (_jsx(ReviewSummary, { label: label, summary: tree.summary }));\n const planKeys = [\n ...(!collapsed && viewport === \"virtual\"\n ? [[keyGlyphs.upDown, `scroll ${selectedView}`]]\n : []),\n ...(!collapsed && hasOutput\n ? [\n [\n keyGlyphs.leftRight,\n selectedView === \"plan\" ? \"show output\" : \"show plan\",\n ],\n ]\n : []),\n [\"p\", collapsed ? \"show plan/output\" : \"hide widget\"],\n [\"Ctrl+C\", \"exit\"],\n ];\n return (_jsxs(Box, { flexDirection: \"column\", children: [_jsx(Box, { ref: beforeRef, flexDirection: \"column\", children: before }), collapsed ? null : (_jsxs(Box, { ref: summaryRef, marginBottom: 1, borderStyle: borderStyle, borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: theme.color.muted, borderDimColor: true, children: [summaryBefore, planSummary, summaryAfter] })), collapsed ? null : (_jsx(PlanContent, { tree: tree, state: state, selectedView: selectedView, virtual: virtualizing, budget: budgetRows, offset: shownOffset, hiddenBelow: hiddenBelow, lines: visibleLines })), showControls ? (_jsx(Box, { ref: controlsRef, marginTop: collapsed ? 0 : 1, borderStyle: borderStyle, borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: theme.color.muted, borderDimColor: true, children: collapsible ? (_jsx(KeyBar, { inline: true, marginTop: 0, before: operationProgress, keys: planKeys, after: footer, divider: mode === \"apply\" || footer !== undefined })) : mode === \"apply\" ? (_jsxs(_Fragment, { children: [operationProgress, footer] })) : (footer) })) : null, _jsx(Box, { ref: afterRef, flexDirection: \"column\", children: after })] }));\n}\nfunction PlanContent(props) {\n const { tree, state, selectedView, virtual, budget, offset, hiddenBelow } = props;\n const glyphs = useGlyphs();\n const overflowUnit = virtual ? \"lines\" : \"rows\";\n return (_jsxs(Box, { flexDirection: \"column\", children: [offset > 0 ? (_jsxs(Text, { tone: \"muted\", children: [glyphs.overflowUp, \" \", offset, \" earlier \", overflowUnit] })) : null, selectedView === \"output\" ? (_jsx(StackOutputs, { value: state.output, offset: offset, limit: virtual ? budget : undefined })) : props.lines === undefined ? (tree.rows.map((row) => (_jsx(PlanRowView, { row: row, mode: tree.mode, detailed: tree.detailed, state: state.tasks.get(row.type === \"binding\" ? row.hostKey : row.key), defaultMode: tree.defaultMode }, row.key)))) : (props.lines.map((line) => line.kind === \"row\" ? (_jsx(PlanRowView, { row: line.row, mode: tree.mode, detailed: tree.detailed, includeYaml: false, state: state.tasks.get(line.row.type === \"binding\" ? line.row.hostKey : line.row.key), defaultMode: tree.defaultMode }, line.row.key)) : line.kind === \"yaml\" ? (_jsx(YamlLine, { line: line.line, paddingLeft: line.paddingLeft }, line.key)) : (_jsx(DetailLine, { paddingLeft: line.paddingLeft, children: _jsx(Text, { tone: \"muted\", dimColor: true, children: \"no declared property changes\" }) }, line.key)))), hiddenBelow > 0 ? (_jsxs(Text, { tone: \"muted\", children: [glyphs.overflowDown, \" \", hiddenBelow, \" more \", overflowUnit] })) : null] }));\n}\n// ── Rows ──────────────────────────────────────────────────────────────────\nfunction PlanRowView(props) {\n const { row, mode, detailed, state, defaultMode, includeYaml = true } = props;\n const glyphs = useGlyphs();\n if (row.type === \"namespace\") {\n return _jsx(NamespaceRow, { id: row.id, depth: row.depth, action: row.action });\n }\n if (row.type === \"binding\") {\n if (mode === \"review\") {\n const style = row.action === \"delete\"\n ? { color: theme.color.muted, icon: \"delete\" }\n : namespaceStyle(row.action);\n return (_jsxs(Row, { gap: 1, paddingLeft: row.depth * 2, children: [_jsx(Text, { color: style.color, children: glyphs[style.icon] }), _jsx(Text, { color: row.action === \"delete\" ? theme.color.muted : theme.color.info, children: row.id }), row.action === \"delete\" ? _jsx(Text, { tone: \"muted\", children: \"(unbind)\" }) : null] }));\n }\n // `state` is the HOST resource's row state: a binding is reconciled by\n // the resource that carries it, so it settles exactly when the host does.\n const hostStatus = state?.status ?? \"pending\";\n const status = row.action === \"noop\" ? \"no change\" : hostStatus;\n const color = row.action === \"delete\" ? theme.color.muted : applyStatusColor(status);\n const bindingStatus = row.action !== \"delete\"\n ? status\n : hostStatus === \"fail\"\n ? \"fail\"\n : isTerminalStatus(hostStatus)\n ? \"unbound\"\n : isInProgress(hostStatus)\n ? \"unbinding\"\n : \"unbind\";\n return (_jsx(TaskRow, { spinning: status !== \"no change\" && isInProgress(hostStatus), icon: status === \"pending\"\n ? glyphs.bullet\n : status === \"fail\"\n ? glyphs.error\n : glyphs.success, iconColor: color, label: _jsx(Text, { color: row.action === \"delete\" ? theme.color.muted : theme.color.info, children: row.id }), depth: row.depth, children: _jsx(Text, { color: color, children: bindingStatus }) }));\n }\n if (row.type === \"task\") {\n if (mode === \"review\") {\n const style = namespaceStyle(row.action);\n return (_jsx(TaskRow, { icon: glyphs[style.icon], iconColor: style.color, label: row.id, depth: row.depth, children: _jsx(Text, { color: theme.color.info, children: \"[action]\" }) }));\n }\n const status = state?.status ?? (row.action === \"noop\" ? \"ran\" : \"pending\");\n const color = applyStatusColor(status);\n return (_jsxs(TaskRow, { spinning: isInProgress(status), icon: taskIcon(row.action, status, glyphs), iconColor: color, label: row.id, detail: rowDetail(status, state?.message), depth: row.depth, children: [_jsx(Text, { color: color, children: taskLabel(row.action, status) }), _jsx(Text, { color: theme.color.info, dimColor: true, children: \"[action]\" }), state?.elapsedMs === undefined ? null : (_jsxs(Text, { tone: \"muted\", children: [\"(\", formatElapsed(state.elapsedMs), \")\"] }))] }));\n }\n // Resource row.\n const modeNote = formatModeNote({\n mode: row.providerMode,\n priorMode: row.fromProviderMode,\n defaultMode,\n });\n const showYaml = includeYaml && (detailed || row.propertyYaml?.kind === \"drift\");\n const yaml = showYaml ? (row.propertyYaml === undefined ? (row.action === \"update\" ||\n row.action === \"adopted\" ||\n row.action === \"replace\" ? (_jsx(DetailLine, { paddingLeft: row.depth * 2 + 2, children: _jsx(Text, { tone: \"muted\", dimColor: true, children: \"no declared property changes\" }) })) : null) : (row.propertyYaml.lines.map((line, index) => (_jsx(YamlLine, { line: line, paddingLeft: row.depth * 2 + 2 }, `${index}:${line}`))))) : null;\n if (mode === \"review\") {\n const style = namespaceStyle(row.action);\n return (_jsxs(Box, { flexDirection: \"column\", marginTop: showYaml ? 1 : 0, children: [_jsxs(TaskRow, { icon: glyphs[style.icon], iconColor: style.color, label: _jsx(Text, { color: row.action === \"noop\" ? undefined : style.color, children: row.id }), depth: row.depth, detail: row.detail, children: [modeNote && _jsxs(Text, { tone: \"muted\", children: [\"(\", modeNote, \")\"] }), row.id !== row.resourceType ? (_jsxs(Text, { tone: \"muted\", children: [\"(\", row.resourceType, \")\"] })) : null] }), yaml] }));\n }\n const rowState = state ?? initialResourceState(row);\n const displayStatus = resourceDisplayStatus(row, rowState.status);\n const color = applyStatusColor(displayStatus);\n return (_jsxs(Box, { flexDirection: \"column\", children: [_jsxs(TaskRow, { spinning: isInProgress(rowState.status), icon: rowState.status === \"pending\"\n ? glyphs.bullet\n : rowState.status === \"fail\"\n ? glyphs.error\n : rowState.status === \"adopted\"\n ? glyphs.adopt\n : rowState.status === \"orphaned\"\n ? glyphs.orphan\n : glyphs.success, iconColor: color, label: _jsxs(_Fragment, { children: [row.action === \"orphaned\" ? (_jsx(Text, { tone: \"muted\", children: row.id })) : (row.id), row.id !== row.resourceType ? (_jsxs(Text, { tone: \"muted\", children: [\" (\", row.resourceType, \")\"] })) : null, row.detail ? _jsxs(Text, { tone: \"muted\", children: [\" \\u00B7 \", row.detail] }) : null] }), detail: rowDetail(rowState.status, rowState.message), depth: row.depth, children: [modeNote ? _jsxs(Text, { tone: \"muted\", children: [\"(\", modeNote, \")\"] }) : null, _jsx(Text, { color: color, children: displayStatus }), rowState.elapsedMs === undefined ? null : (_jsxs(Text, { tone: \"muted\", children: [\"(\", formatElapsed(rowState.elapsedMs), \")\"] }))] }), yaml] }));\n}\n// ── Headers ───────────────────────────────────────────────────────────────\nfunction ReviewSummary(props) {\n const { counts, taskCounts, bindingChanges } = props.summary;\n const parts = [\n ...[\"create\", \"update\", \"adopted\", \"delete\", \"orphaned\", \"replace\"]\n .filter((action) => counts[action] > 0)\n .map((action) => ({\n key: action,\n label: `${counts[action]} to ${action}`,\n color: namespaceStyle(action).color,\n })),\n ...(counts.noop > 0\n ? [\n {\n key: \"noop\",\n label: `${counts.noop} no change`,\n color: theme.color.muted,\n },\n ]\n : []),\n ...(taskCounts.run > 0\n ? [\n {\n key: \"run\",\n label: `${taskCounts.run} to run`,\n color: namespaceStyle(\"run\").color,\n },\n ]\n : []),\n ...(taskCounts.delete > 0\n ? [\n {\n key: \"drop\",\n label: `${taskCounts.delete} to drop`,\n color: namespaceStyle(\"delete\").color,\n },\n ]\n : []),\n ...(taskCounts.noop > 0\n ? [\n {\n key: \"task-noop\",\n label: `${taskCounts.noop} tasks no change`,\n color: theme.color.muted,\n },\n ]\n : []),\n ...(bindingChanges > 0\n ? [\n {\n key: \"bindings\",\n label: `${bindingChanges} binding changes`,\n color: theme.color.info,\n },\n ]\n : []),\n ];\n return (_jsxs(_Fragment, { children: [_jsx(SectionHeading, { children: props.label }), _jsx(Text, { tone: \"muted\", children: \" \\u00B7 \" }), parts.length === 0 ? (_jsx(Text, { tone: \"muted\", children: \"no changes\" })) : (parts.map((part, index) => (_jsxs(Box, { children: [index === 0 ? null : _jsx(Text, { tone: \"muted\", children: \" \\u00B7 \" }), _jsx(Text, { color: part.color, children: part.label })] }, part.key))))] }));\n}\nconst applySummaryOrder = [\n \"fail\",\n \"attaching\",\n \"post-attach\",\n \"pre-creating\",\n \"creating\",\n \"creating replacement\",\n \"updating\",\n \"adopting\",\n \"deleting\",\n \"orphaning\",\n \"replacing\",\n \"running\",\n \"pending\",\n \"created\",\n \"updated\",\n \"adopted\",\n \"deleted\",\n \"orphaned\",\n \"replaced\",\n \"ran\",\n \"skipped\",\n \"no change\",\n];\nfunction ApplySummary(props) {\n const counts = new Map();\n for (const row of props.rows) {\n const status = props.tasks.get(row.key)?.status ?? \"pending\";\n const displayStatus = row.action === \"noop\" ? \"no change\" : status;\n counts.set(displayStatus, (counts.get(displayStatus) ?? 0) + 1);\n }\n const parts = applySummaryOrder\n .filter((status) => counts.has(status))\n .map((status) => ({\n status,\n count: counts.get(status) ?? 0,\n }));\n return (_jsxs(_Fragment, { children: [_jsx(SectionHeading, { children: props.label }), _jsx(Text, { tone: \"muted\", children: \" \\u00B7 \" }), parts.length === 0 ? (_jsx(Text, { tone: \"muted\", children: \"no resources\" })) : (parts.map((part, index) => (_jsxs(Box, { children: [index === 0 ? null : _jsx(Text, { tone: \"muted\", children: \" \\u00B7 \" }), _jsxs(Text, { color: applyStatusColor(part.status), children: [part.count, \" \", part.status] })] }, part.status))))] }));\n}\n// ── Status helpers ────────────────────────────────────────────────────────\nconst resourceDisplayStatus = (row, status) => row.action === \"noop\" && (status === \"created\" || status === \"updated\")\n ? \"no change\"\n : status;\nconst taskLabel = (action, status) => action === \"delete\"\n ? status === \"deleted\" || status === \"orphaned\"\n ? status\n : \"drop\"\n : status === \"ran\"\n ? action === \"noop\"\n ? \"skip\"\n : \"ran\"\n : status === \"running\"\n ? \"running\"\n : status === \"fail\"\n ? \"fail\"\n : action === \"noop\"\n ? \"skip\"\n : \"run\";\n/** Static glyph for a task row; the running state renders a spinner instead. */\nfunction taskIcon(action, status, glyphs) {\n if (status === \"fail\")\n return glyphs.error;\n if (status === \"skipped\")\n return glyphs.bullet;\n if (status === \"ran\")\n return action === \"noop\" ? glyphs.bullet : glyphs.success;\n if (status === \"deleted\" || status === \"orphaned\")\n return glyphs.success;\n if (action === \"delete\")\n return glyphs[actionStyle.delete.icon];\n if (action === \"noop\")\n return glyphs[actionStyle.noop.icon];\n return glyphs[actionStyle.run.icon];\n}\nfunction YamlLine({ line, paddingLeft, }) {\n const change = matchYamlChange(line);\n const content = change?.content ?? line;\n const key = matchYamlKey(content);\n const removed = change?.marker === \"-\";\n const added = change?.marker === \"+\";\n return (_jsxs(DetailLine, { paddingLeft: paddingLeft, backgroundColor: removed\n ? theme.color.diffRemoveBackground\n : added\n ? theme.color.diffAddBackground\n : undefined, children: [_jsx(Box, { width: 2, flexShrink: 0, children: _jsx(Text, { color: removed ? theme.color.danger : theme.color.success, children: change?.marker ?? \" \" }) }), _jsx(Box, { flexGrow: 1, children: _jsx(Text, { wrap: \"truncate-end\", children: key === undefined ? (content) : (_jsxs(_Fragment, { children: [key.indent, _jsx(Text, { color: change === undefined ? theme.color.info : undefined, children: key.key }), key.value] })) }) })] }));\n}\nfunction DetailLine({ paddingLeft, backgroundColor, children, }) {\n const borderStyle = useBorderStyle();\n return (_jsx(Box, { paddingLeft: paddingLeft, width: \"100%\", children: _jsx(Box, { width: \"100%\", paddingLeft: 1, borderStyle: borderStyle, borderLeft: true, borderTop: false, borderRight: false, borderBottom: false, borderColor: theme.color.muted, borderDimColor: true, backgroundColor: backgroundColor, children: children }) }));\n}\n//# sourceMappingURL=PlanView.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"@alchemy.run/sigil/jsx-runtime\";\n/** @jsxImportSource @alchemy.run/sigil */\nimport { useMemo, useState } from \"@alchemy.run/sigil/react\";\nimport { ChoiceGroup, Box, KeyBar, Text, useGlyphs, useKeyGlyphs, useTerminalInput, } from \"../ui/index.js\";\nimport { Screen, theme } from \"../../CliKit/index.js\";\nimport { Plan, PlanTree } from \"./PlanView.js\";\n/**\n * Plan approval prompt: the plan tree followed by an operation-specific\n * action and Cancel. Escape cancels; Ctrl+C is handled centrally by the\n * screen runner.\n */\nexport function ApprovePlan(props) {\n const { plan, detailed = false, controller } = props;\n // Destruction is the risky path: require an explicit move to Destroy before\n // Enter can remove or orphan resources. Deploy approvals remain action-first.\n const [approved, setApproved] = useState(!plan.destroy);\n const action = plan.destroy ? \"Destroy\" : \"Deploy\";\n const glyphs = useGlyphs();\n const keys = useKeyGlyphs();\n const tree = useMemo(() => new PlanTree(plan, {\n detailed,\n mode: \"review\",\n label: action,\n }), [plan, detailed, action]);\n const complete = (answer) => {\n const verdict = (_jsxs(Text, { color: answer ? theme.color.success : theme.color.danger, children: [answer ? glyphs.success : glyphs.error, \" \", answer ? action : \"Cancelled\"] }));\n // On approval the plan disappears — the apply progress that follows\n // shows every row again. A declined plan stays on screen (complete,\n // unscrolled) so the user can review what they just turned down.\n if (!answer)\n tree.setViewport(\"full\");\n const summary = answer ? (verdict) : (_jsxs(Box, { flexDirection: \"column\", children: [_jsx(Plan, { tree: tree }), verdict] }));\n controller.submit(answer, summary);\n };\n useTerminalInput((input, key) => {\n if (key.enter)\n complete(approved);\n else if (key.escape)\n controller.cancel();\n else if (key.ctrl || key.meta)\n return;\n else if (input.toLowerCase() === \"y\")\n complete(true);\n else if (input.toLowerCase() === \"n\")\n complete(false);\n });\n const prompt = (_jsxs(Box, { flexDirection: \"column\", children: [_jsxs(Text, { bold: true, children: [action, \"?\"] }), _jsx(ChoiceGroup, { value: approved, choices: [\n { value: true, label: action },\n { value: false, label: \"Cancel\" },\n ], onChange: setApproved }), _jsx(KeyBar, { keys: [\n [keys.upDown, \"scroll plan\"],\n [keys.leftRight, \"choose\"],\n [keys.enter, \"confirm\"],\n [keys.escape, \"cancel\"],\n ] })] }));\n return _jsx(Plan, { tree: tree, footer: prompt });\n}\nexport const approvePlanScreen = (plan, detailed = false) => Screen.make(\"plan approval\", (controller) => (_jsx(ApprovePlan, { plan: plan, detailed: detailed, controller: controller })));\n//# sourceMappingURL=ApprovePlan.js.map","import { jsx as _jsx } from \"@alchemy.run/sigil/jsx-runtime\";\n/** @jsxImportSource @alchemy.run/sigil */\nimport * as Clock from \"effect/Clock\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Layer from \"effect/Layer\";\nimport * as Scope from \"effect/Scope\";\nimport { Cli } from \"../../../Report.js\";\nimport { CliKit } from \"../../CliKit/index.js\";\nimport { formatElapsed } from \"../../Format.js\";\nimport { approvePlanScreen } from \"./ApprovePlan.js\";\nimport { Plan as PlanComponent, PlanTree } from \"./PlanView.js\";\nexport const sigilCli = () => Layer.effect(Cli, Effect.map(CliKit, (cli) => {\n const preferences = { planExpanded: true };\n return Cli.of({\n startPlanningSession: (label, detail, title) => startPlanningSession(cli, label, detail, title),\n approvePlan: (plan, options) => approvePlan(cli, plan, options),\n displayPlan: (plan, options) => displayPlan(cli, plan, options),\n startApplySession: (plan, options) => startApplySession(cli, plan, options, preferences),\n });\n}));\nconst approvePlan = Effect.fn(function* (cli, plan, options) {\n // A dismissed screen means \"declined\"; NonInteractiveTerminal propagates\n // typed to the command-level handlers (a friendly line, not a raw cause).\n return yield* cli.prompt\n .custom(approvePlanScreen(plan, options?.detailed))\n .pipe(Effect.catchTag(\"TerminalCancelled\", () => Effect.succeed(false)));\n});\nconst displayPlan = Effect.fn(function* (cli, plan, options) {\n const tree = new PlanTree(plan, {\n detailed: options?.detailed,\n mode: \"review\",\n label: \"Plan\",\n viewport: \"full\",\n });\n yield* cli.output.print(_jsx(PlanComponent, { tree: tree }));\n});\nconst startPlanningSession = Effect.fn(function* (cli, label, detail, title) {\n const startedAt = yield* Clock.currentTimeMillis;\n const scope = yield* Scope.make();\n const progress = yield* cli.live\n .progress({\n label,\n detail,\n title: title === undefined ? undefined : `${label} · ${title}`,\n spinning: false,\n })\n .pipe(Scope.provide(scope));\n let closed = false;\n const finish = (effect) => Effect.suspend(() => {\n if (closed)\n return Effect.void;\n closed = true;\n return effect.pipe(Effect.ensuring(Scope.close(scope, Exit.void)));\n });\n // Settle messages carry the total planning duration, mirroring the plain\n // renderer's \"(1.8s)\" suffix.\n const settled = (message) => message === undefined\n ? Effect.succeed(undefined)\n : Clock.currentTimeMillis.pipe(Effect.map((now) => `${message} (${formatElapsed(now - startedAt)})`));\n return {\n update: (nextLabel, nextDetail, options) => progress.update({\n label: nextLabel,\n detail: nextDetail,\n title: title === undefined ? undefined : `${nextLabel} · ${title}`,\n spinning: options?.spinning ?? true,\n }),\n succeed: (message) => finish(Effect.flatMap(settled(message), progress.succeed)),\n fail: (message) => finish(Effect.flatMap(settled(message), progress.fail)),\n close: finish(progress.close),\n };\n});\nconst startApplySession = Effect.fn(function* (cli, plan, options, preferences) {\n // Detailed applies render their YAML diffs inline in the progress tree.\n // One-shot operations persist the final render; dev keeps its live block\n // mounted so logs remain static above the collapsible plan and keybar.\n const labels = plan.destroy\n ? {\n active: \"Destroying stack\",\n success: \"Stack destroyed\",\n failure: \"Destroy failed\",\n }\n : plan.defaultMode === \"local\"\n ? {\n active: \"Starting dev stack\",\n success: \"Dev stack ready\",\n failure: \"Dev startup failed\",\n }\n : {\n active: \"Deploying stack\",\n success: \"Stack deployed\",\n failure: \"Deploy failed\",\n };\n const progress = new PlanTree(plan, {\n detailed: options?.detailed,\n mode: \"apply\",\n label: labels.active,\n titleDetail: options?.stage,\n busy: true,\n expanded: preferences.planExpanded,\n });\n // Remember the collapse toggle as it happens, so the next hot-reload\n // generation opens the way the user left this one.\n progress.subscribe(() => {\n preferences.planExpanded = progress.snapshot().expanded;\n });\n // The session outlives this effect — the caller settles it via `done` on\n // every exit path (Apply.ts's onExit). live.open is Scope-bound, so give\n // it a manually managed scope. One-shot operations close it in `done`;\n // dev retains it after `done` and tears it down through `close` when the\n // generation is interrupted (a reload or Ctrl+C), so a replaced\n // generation never leaves its widget behind.\n const scope = yield* Scope.make();\n const live = yield* cli.live\n .open(_jsx(PlanComponent, { tree: progress, collapsible: options?.dev }), {\n persistOnClose: !options?.dev,\n })\n .pipe(Scope.provide(scope));\n const close = live.close.pipe(Effect.ensuring(Scope.close(scope, Exit.void)));\n return {\n done: (outcome) => Effect.sync(() => {\n const outputReady = progress.snapshot().output !== undefined;\n progress.finish(outcome, labels[outcome], options?.dev && outcome === \"success\" && outputReady\n ? \"output\"\n : \"plan\");\n if (!options?.dev)\n progress.setViewport(\"full\");\n }).pipe(Effect.andThen(options?.dev ? Effect.void : close)),\n close,\n emit: (event) => Effect.sync(() => progress.emit(event)),\n setOutput: (value) => Effect.sync(() => progress.setOutput(value)),\n };\n});\n//# sourceMappingURL=SigilCli.js.map","import { jsx as _jsx } from \"@alchemy.run/sigil/jsx-runtime\";\n/** @jsxImportSource @alchemy.run/sigil */\n/**\n * The yantra logo, rasterized at runtime. Geometry mirrors\n * website/src/brand/yantra.ts (the brand's source of truth): a downward\n * equilateral triangle inscribed in a circle, bindu at the center. Rendered\n * as braille dots (2x4 subpixels per cell) via signed distance functions, so\n * it scales to any column width.\n */\nimport { Box, Text } from \"../ui/index.js\";\nimport { useMemo } from \"@alchemy.run/sigil/react\";\nimport { theme } from \"../../CliKit/index.js\";\nconst CENTER = 12;\nconst CIRCLE_R = 9.5;\nconst BINDU_R = 1.1;\nconst DOT_THRESHOLD = 0.35;\n// stroke thickness in braille subpixels, independent of logo size — keeps the\n// outline delicate instead of thickening into solid slabs as the logo grows\nconst STROKE_SUBPIXELS = 2.5;\nconst trianglePoints = (strokeW) => {\n const triR = CIRCLE_R - strokeW / 4;\n const triDx = triR * Math.cos(Math.PI / 6);\n const triTopY = CENTER - triR * Math.sin(Math.PI / 6);\n const triApexY = CENTER + triR;\n return [\n [CENTER, triApexY],\n [CENTER - triDx, triTopY],\n [CENTER + triDx, triTopY],\n ];\n};\nconst sdCircleRing = (x, y, strokeW) => Math.abs(Math.hypot(x - CENTER, y - CENTER) - CIRCLE_R) - strokeW / 2;\nconst sdSegment = (px, py, ax, ay, bx, by) => {\n const abx = bx - ax;\n const aby = by - ay;\n const apx = px - ax;\n const apy = py - ay;\n const t = Math.max(0, Math.min(1, (apx * abx + apy * aby) / (abx * abx + aby * aby)));\n return Math.hypot(apx - t * abx, apy - t * aby);\n};\nconst sdTriangle = (x, y, pts, strokeW) => {\n let d = Infinity;\n for (let i = 0; i < 3; i++) {\n const [ax, ay] = pts[i];\n const [bx, by] = pts[(i + 1) % 3];\n d = Math.min(d, sdSegment(x, y, ax, ay, bx, by));\n }\n return d - strokeW / 2;\n};\nconst sdBindu = (x, y) => Math.hypot(x - CENTER, y - CENTER) - BINDU_R;\n// braille dot bit per (row 0-3, column 0-1) subpixel\nconst BRAILLE_BITS = [\n [0x01, 0x08],\n [0x02, 0x10],\n [0x04, 0x20],\n [0x40, 0x80],\n];\nconst rasterizeLogo = (cols) => {\n const width = cols * 2; // subpixel grid, square (2 wide x 4 tall per cell)\n const rows = Math.ceil(width / 4);\n const scale = 24 / width;\n const strokeW = STROKE_SUBPIXELS * scale;\n const triPts = trianglePoints(strokeW);\n const lines = [];\n for (let r = 0; r < rows; r++) {\n const runs = [];\n const push = (text, color) => {\n const last = runs[runs.length - 1];\n if (last && last.color === color)\n last.text += text;\n else\n runs.push({ text, color });\n };\n for (let c = 0; c < cols; c++) {\n let bits = 0;\n let strokeSum = 0;\n let binduSum = 0;\n for (let sy = 0; sy < 4; sy++) {\n for (let sx = 0; sx < 2; sx++) {\n const x = (c * 2 + sx + 0.5) * scale;\n const y = (r * 4 + sy + 0.5) * scale;\n const dStroke = Math.min(sdCircleRing(x, y, strokeW), sdTriangle(x, y, triPts, strokeW));\n const strokeCov = Math.min(1, Math.max(0, 0.5 - dStroke / scale));\n const binduCov = Math.min(1, Math.max(0, 0.5 - sdBindu(x, y) / scale));\n if (Math.max(strokeCov, binduCov) > DOT_THRESHOLD) {\n bits |= BRAILLE_BITS[sy][sx];\n strokeSum += strokeCov;\n binduSum += binduCov;\n }\n }\n }\n if (bits === 0)\n push(\" \");\n else {\n push(String.fromCharCode(0x2800 + bits), binduSum > strokeSum ? theme.color.brand : theme.color.accent);\n }\n }\n // drop trailing whitespace runs\n while (runs.length > 0) {\n const last = runs[runs.length - 1];\n if (last.color !== undefined || last.text.trim() !== \"\")\n break;\n runs.pop();\n }\n lines.push(runs);\n }\n while (lines.length > 0 && lines[0].length === 0)\n lines.shift();\n while (lines.length > 0 && lines[lines.length - 1].length === 0)\n lines.pop();\n return lines;\n};\nexport function Logo({ cols }) {\n const lines = useMemo(() => rasterizeLogo(cols), [cols]);\n return (_jsx(Box, { flexDirection: \"column\", flexShrink: 0, children: lines.map((runs, i) => (_jsx(Text, { children: runs.length === 0\n ? \" \"\n : runs.map((run, j) => (_jsx(Text, { color: run.color, children: run.text }, j))) }, i))) }));\n}\n//# sourceMappingURL=Logo.js.map","import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from \"@alchemy.run/sigil/jsx-runtime\";\n/** @jsxImportSource @alchemy.run/sigil */\n/** Branded help screens + the CliOutput formatter that renders them. */\nimport { stripVTControlCharacters } from \"node:util\";\nimport * as Option from \"effect/Option\";\nimport * as CliOutput from \"effect/unstable/cli/CliOutput\";\nimport { Box, Heading, Text, useGlyphs } from \"../ui/index.js\";\nimport packageJson from \"../../../../package.json\" with { type: \"json\" };\nimport { ANSI_BOLD, ANSI_DIM, ansiFg, glyphsFor, paint, truncate, theme, } from \"../../CliKit/index.js\";\nimport { Logo } from \"./Logo.js\";\nconst commandLabel = (command) => (command.alias ? `${command.name}, ${command.alias}` : command.name);\n/** Shell-like highlighting shared by usage lines, examples, and help hints. */\nfunction CommandText({ command }) {\n const tokens = command.match(/\\s+|\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|[^\\s]+/g) ?? [command];\n let word = 0;\n let valueAfterFlag = false;\n return (_jsx(Text, { children: tokens.map((token, index) => {\n if (/^\\s+$/.test(token))\n return token;\n const currentWord = word++;\n const isFlag = token.startsWith(\"-\");\n const isPlaceholder = (token.startsWith(\"<\") && token.endsWith(\">\")) ||\n (token.startsWith(\"[\") && token.endsWith(\"]\"));\n const isQuoted = (token.startsWith('\"') && token.endsWith('\"')) ||\n (token.startsWith(\"'\") && token.endsWith(\"'\"));\n const isValue = valueAfterFlag || isQuoted;\n valueAfterFlag = isFlag;\n return (_jsx(Text, { bold: currentWord <= 1 || isFlag, color: currentWord === 0\n ? theme.color.accent\n : isFlag\n ? theme.color.info\n : isPlaceholder\n ? theme.color.warning\n : isValue\n ? theme.color.success\n : currentWord === 1\n ? theme.color.accentBright\n : undefined, children: token }, `${index}:${token}`));\n }) }));\n}\nfunction Row({ label, description, width }) {\n return (_jsxs(Box, { paddingLeft: 2, children: [_jsx(Box, { width: width, flexShrink: 0, children: typeof label === \"string\" ? (_jsx(Text, { bold: true, tone: \"emphasis\", children: label })) : (label) }), _jsx(Text, { children: description })] }));\n}\nfunction BrandLine() {\n const glyphs = useGlyphs();\n return (_jsxs(Text, { children: [_jsx(Text, { tone: \"brand\", children: glyphs.selected }), \" \", _jsx(Text, { bold: true, tone: \"emphasis\", children: \"alchemy\" }), \" \", _jsx(Text, { tone: \"muted\", children: \"\\u2014 Infrastructure as Effects\" })] }));\n}\nfunction SubHelp({ doc, root = false }) {\n const commands = doc.subcommands?.flatMap((group) => group.commands) ?? [];\n const flags = doc.flags ?? [];\n const globalFlags = root\n ? (doc.globalFlags ?? []).filter((flag) => flag.name === \"help\" || flag.name === \"version\")\n : (doc.globalFlags ?? []);\n const args = doc.args ?? [];\n const flagLabel = (flag) => {\n const aliases = flag.aliases.length > 0 ? `, ${flag.aliases.join(\", \")}` : \"\";\n return `--${flag.name}${aliases}`;\n };\n const argLabel = (arg) => arg.required ? `<${arg.name}>` : `[${arg.name}]`;\n // width from labels only — enum types (--log-level's choice list) would\n // otherwise blow the column out; long types truncate inside the cell\n const nameWidth = Math.min(30, Math.max(12, ...commands.map((c) => commandLabel(c).length), ...[...flags, ...globalFlags].map((f) => flagLabel(f).length), ...args.map((a) => argLabel(a).length))) + 4;\n function FlagRow({ flag }) {\n const label = flagLabel(flag);\n const typeRoom = nameWidth - label.length - 2;\n return (_jsx(Row, { width: nameWidth, description: Option.getOrElse(flag.description, () => \"\"), label: _jsxs(Text, { children: [_jsxs(Text, { bold: true, color: theme.color.info, children: [\"--\", flag.name] }), flag.aliases.map((alias) => (_jsxs(Text, { color: theme.color.info, children: [\", \", alias] }, alias))), flag.type === \"boolean\" || typeRoom < 8 ? null : (_jsxs(Text, { color: theme.color.warning, children: [\" \", truncate(flag.type, typeRoom)] }))] }) }));\n }\n return (_jsxs(Box, { flexDirection: \"column\", flexShrink: root ? 0 : 1, children: [root ? _jsx(BrandLine, {}) : null, doc.description === \"\" ? null : (_jsx(Box, { marginTop: root ? 1 : 0, children: _jsx(Text, { children: doc.description }) })), _jsx(Box, { marginTop: doc.description === \"\" && !root ? 0 : 1, children: _jsx(Heading, { glyph: false, children: \"USAGE\" }) }), _jsxs(Text, { children: [\" \", _jsx(Text, { tone: \"brand\", children: \"$\" }), \" \", _jsx(CommandText, { command: doc.usage })] }), args.length === 0 ? null : (_jsxs(_Fragment, { children: [_jsx(Box, { marginTop: 1, children: _jsx(Heading, { glyph: false, children: \"ARGUMENTS\" }) }), args.map((arg) => (_jsx(Row, { width: nameWidth, label: _jsx(Text, { bold: true, color: theme.color.warning, children: argLabel(arg) }), description: Option.getOrElse(arg.description, () => \"\") }, arg.name)))] })), commands.length === 0 ? null : (_jsxs(_Fragment, { children: [_jsx(Box, { marginTop: 1, children: _jsx(Heading, { glyph: false, children: \"COMMANDS\" }) }), commands.map((command) => (_jsx(Row, { width: nameWidth, label: _jsxs(Text, { children: [_jsx(Text, { bold: true, color: theme.color.accentBright, children: command.name }), command.alias === undefined ? null : (_jsxs(Text, { color: theme.color.info, children: [\", \", command.alias] }))] }), description: command.description || \"\" }, command.name)))] })), flags.length === 0 ? null : (_jsxs(_Fragment, { children: [_jsx(Box, { marginTop: 1, children: _jsx(Heading, { glyph: false, children: \"FLAGS\" }) }), flags.map((flag) => (_jsx(FlagRow, { flag: flag }, flag.name)))] })), globalFlags.length === 0 ? null : (_jsxs(_Fragment, { children: [_jsx(Box, { marginTop: 1, children: _jsx(Heading, { glyph: false, children: root ? \"OPTIONS\" : \"GLOBAL FLAGS\" }) }), globalFlags.map((flag) => (_jsx(FlagRow, { flag: flag }, flag.name)))] })), doc.examples === undefined || doc.examples.length === 0 ? null : (_jsxs(_Fragment, { children: [_jsx(Box, { marginTop: 1, children: _jsx(Heading, { glyph: false, children: \"EXAMPLES\" }) }), doc.examples.map((example) => (_jsxs(Text, { children: [\" \", _jsx(Text, { tone: \"brand\", children: \"$\" }), \" \", _jsx(CommandText, { command: example.command })] }, example.command)))] })), commands.length === 0 ? null : (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { children: [_jsx(Text, { color: theme.color.muted, children: \"Run '\" }), _jsx(CommandText, { command: `${doc.usage.replace(/\\s*<subcommand>.*$/, \"\")} <command> --help` }), _jsx(Text, { color: theme.color.muted, children: \"' for more information on a command.\" })] }) }))] }));\n}\nconst formatSubHelp = (cli, doc) => {\n const termCols = cli.terminal.columns;\n return cli.output.format(_jsx(Box, { width: termCols, children: _jsx(SubHelp, { doc: doc }) }), { columns: termCols });\n};\n/** Hide the logo entirely when it can't be at least this many columns wide. */\nconst MIN_LOGO_COLS = 20;\nconst formatRootHelp = (cli, doc) => {\n const termCols = cli.terminal.columns;\n // First pass: render the text alone to measure its exact footprint (post\n // ANSI codes and wrapping), then size the logo into the leftover space.\n const text = cli.output.format(_jsx(Box, { width: termCols, children: _jsx(SubHelp, { doc: doc, root: true }) }), { columns: termCols });\n // The braille logo is mojibake without Unicode support.\n if (!cli.terminal.unicode)\n return text;\n const lines = text.split(\"\\n\");\n const textWidth = Math.max(...lines.map((line) => stripVTControlCharacters(line).trimEnd().length));\n const textHeight = lines.length;\n // Fill the free space beside the text: a logo of C columns is C/2 rows\n // tall (braille cell is 1:2). Reserve two rows for the wordmark caption.\n const logoCols = Math.min(termCols - textWidth - 2, (textHeight - 2) * 2);\n if (logoCols < MIN_LOGO_COLS)\n return text;\n return cli.output.format(_jsxs(Box, { flexDirection: \"row\", width: termCols, children: [_jsx(SubHelp, { doc: doc, root: true }), _jsxs(Box, { flexGrow: 1, flexDirection: \"column\", justifyContent: \"center\", alignItems: \"center\", children: [_jsx(Logo, { cols: logoCols }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { children: [_jsx(Text, { bold: true, color: theme.color.accent, children: \"ALCHEMY\" }), \" \", _jsxs(Text, { tone: \"muted\", children: [\"v\", packageJson.version] })] }) })] })] }), { columns: termCols });\n};\nexport const brandedCliFormatter = (cli) => {\n const fallback = CliOutput.defaultFormatter();\n const glyphs = glyphsFor(cli.terminal.unicode);\n const formatErrorLine = (message) => `${paint(ansiFg(theme.color.danger), `${glyphs.error} error:`)} ${message}`;\n return {\n ...fallback,\n formatHelpDoc: (doc) => doc.usage.startsWith(\"alchemy <subcommand>\")\n ? formatRootHelp(cli, doc)\n : formatSubHelp(cli, doc),\n formatVersion: (name, version) => `${paint(ansiFg(theme.color.brand), glyphs.selected)} ${paint(ANSI_BOLD, name)} ${paint(ANSI_DIM, `v${version}`)}`,\n formatError: (error) => `\\n${formatErrorLine(error.message)}`,\n formatErrors: (errors) => {\n if (errors.length === 0)\n return \"\";\n if (errors.length === 1)\n return `\\n${formatErrorLine(errors[0].message)}`;\n return `\\n${formatErrorLine(`${errors.length} problems`)}\\n${errors\n .map((error) => ` ${paint(ANSI_DIM, glyphs.bullet)} ${error.message}`)\n .join(\"\\n\")}`;\n },\n };\n};\n//# sourceMappingURL=Help.js.map","import * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as CliOutput from \"effect/unstable/cli/CliOutput\";\nimport { CliKit } from \"./CliKit/CliKit.js\";\nimport { LoggingCli } from \"./LoggingCli.js\";\nimport { plainCliFormatter } from \"./PlainCliFormatter.js\";\n/** Select the interactive or append-only root renderer. */\nexport const selectCliServices = () => Layer.unwrap(Effect.gen(function* () {\n const cli = yield* CliKit;\n if (!cli.terminal.input) {\n const plain = Layer.mergeAll(LoggingCli, CliOutput.layer(plainCliFormatter({ columns: cli.terminal.columns })));\n return plain;\n }\n return yield* Effect.promise(async () => {\n const { sigilCli } = await import(\"./components/view/SigilCli.js\");\n const { brandedCliFormatter } = await import(\"./components/view/Help.js\");\n return Layer.mergeAll(sigilCli(), CliOutput.layer(brandedCliFormatter(cli)));\n });\n}));\n//# sourceMappingURL=selectCli.js.map","import * as Cause from \"effect/Cause\";\nimport * as Config from \"effect/Config\";\nimport * as ConfigProvider from \"effect/ConfigProvider\";\nimport * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport * as Path from \"effect/Path\";\nimport * as Schema from \"effect/Schema\";\nimport * as FetchHttpClient from \"effect/unstable/http/FetchHttpClient\";\nimport { watchImport } from \"@alchemy.run/node-utils/watch-import\";\nimport { trackBunImports } from \"@alchemy.run/node-utils/watch-import-bun\";\nimport { fileURLToPath } from \"node:url\";\nimport { AlchemyContextLive } from \"../AlchemyContext.js\";\nimport { resolveStackEntrypoint } from \"../Alchemist/Entrypoint.js\";\nimport { StackModuleLoader } from \"../Alchemist/Session.js\";\nimport { ArtifactStore, createArtifactStore } from \"../Artifacts.js\";\nimport { CredentialsStoreLive } from \"../Auth/Credentials.js\";\nimport { ProfileStoreLive } from \"../Auth/Profile.js\";\nimport { makeDevLogOpener } from \"../Local/DevLog.js\";\nimport * as RpcProviderProxy from \"../Local/RpcProviderProxy.js\";\nimport { forwardSidecarLogs } from \"../Local/RpcSpawner.js\";\nimport { TelemetryLive } from \"../Telemetry/Layer.js\";\nimport { initialCwd } from \"../Util/Node.js\";\nimport { PlatformServices } from \"../Util/PlatformServices.js\";\nimport * as Stacks from \"../Alchemist/routes/stack.js\";\nimport { DEV_RELOAD_EXIT_CODE, DevOptions } from \"./DevOptions.js\";\nimport { ConsoleLogLive } from \"./GlobalLog.js\";\nimport { handleCliErrors, installShutdownFeedback } from \"./commands/errors.js\";\nimport { renderApply, renderPlanning } from \"./commands/render.js\";\nimport * as CliKit from \"./CliKit/index.js\";\nimport { stackOutputsView } from \"./components/view/StackOutputs.js\";\nimport { selectCliServices } from \"./selectCli.js\";\n// Interactive dev/deploy runs use the Sigil progress UI; CI, redirected output,\n// and other non-interactive terminals still select the append-only renderer.\n// `ALCHEMY_TUI` remains the explicit override in either direction.\nconst services = Layer.mergeAll(Layer.provideMerge(Layer.mergeAll(selectCliServices(), CliKit.CliKitInteraction), CliKit.layer()), RpcProviderProxy.fromEnv(), Layer.succeed(ArtifactStore, createArtifactStore()), \n// Dev runs live in this exec child, not the `alchemy` CLI process, so\n// without this layer they'd export no telemetry at all. No root\n// `cli.dev` span though: dev remains alive across reloads, so a wrapping\n// span would not end (and export) until shutdown — plan/apply spans are the\n// trace roots instead.\n//\n// Telemetry is layered *on top of* the console logger so the OTLP logger\n// merges with it. As `mergeAll` siblings the last `CurrentLoggers` wins,\n// and telemetry would replace the console logger — every `Effect.log*`\n// (plan, apply progress, stack outputs) silently vanished from the\n// terminal whenever telemetry was enabled.\nLayer.provideMerge(TelemetryLive, ConsoleLogLive)).pipe(Layer.provideMerge(Layer.mergeAll(AlchemyContextLive, ProfileStoreLive, CredentialsStoreLive)), Layer.provideMerge(Layer.mergeAll(PlatformServices, FetchHttpClient.layer, ConfigProvider.layer(ConfigProvider.fromEnv()))));\n/** `alchemy dev` normally parks forever; set for single-pass runs (tests). */\nconst devOnce = Config.String(\"ALCHEMY_DEV_ONCE\").pipe(Config.withDefault(\"\"), Effect.map((value) => value === \"1\" || value === \"true\"));\nconst runDev = Effect.fn(function* (options) {\n const target = {\n entrypoint: options.main,\n stage: options.stage,\n profile: options.profile,\n envFile: Option.getOrUndefined(options.envFile),\n };\n const snapshot = yield* Stacks.plan({\n target,\n operation: \"deploy\",\n force: options.force,\n updateStateStore: true,\n dev: true,\n }).pipe(renderPlanning({ operation: \"Dev\", stage: options.stage }));\n const once = yield* devOnce;\n const applyPlan = Stacks.apply(snapshot).pipe(renderApply(snapshot.native, {\n stage: options.stage,\n dev: !once,\n }));\n const result = yield* once\n ? applyPlan\n : applyPlan.pipe(Effect.catchCause((cause) => Console.error(describeFailure(\"apply\", cause, \"keeping dev alive so healthy resources keep serving\")).pipe(Effect.as(undefined))));\n if (result !== undefined && once) {\n const kit = yield* CliKit.CliKit;\n yield* kit.output.print(stackOutputsView(result));\n }\n return once ? undefined : yield* Effect.never;\n});\n/**\n * Resolves with the files behind the next debounced change batch. The\n * listener detaches itself on delivery — `Effect.callback` only runs its\n * cleanup on interruption, so a listener left behind would fire once per\n * past generation on every later change.\n */\nconst nextChange = (watcher) => Effect.callback((resume) => {\n const unsubscribe = watcher.subscribe(({ paths }) => {\n unsubscribe();\n resume(Effect.succeed(paths));\n });\n return Effect.sync(unsubscribe);\n});\nconst logReload = Effect.fn(function* (paths) {\n const path = yield* Path.Path;\n yield* Effect.logInfo(`Reloading stack: changed ${[...paths]\n .map((file) => path.relative(initialCwd, file))\n .join(\", \")}`);\n});\n/**\n * Node: one process, many generations. The Oxc loader imports the stack graph\n * under a fresh namespace each time; a change to any file it loaded\n * interrupts the parked run (whose scope tears down the dev widget) and the\n * loop imports the next generation.\n */\nconst runNodeDevWatcher = Effect.fn(function* (options) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n // Node reports real paths for loaded files (symlinked checkouts, macOS\n // `/tmp`), so the project root the graph is scoped to must be real too.\n // Scope to the invocation directory, not the entrypoint's directory: a\n // config under `infra/` commonly imports application code from `src/`.\n const entrypoint = yield* fs.realPath(yield* resolveStackEntrypoint(options.main));\n const root = yield* fs.realPath(initialCwd);\n const nodeModules = `${path.sep}node_modules${path.sep}`;\n return yield* Effect.acquireRelease(Effect.sync(() => watchImport(entrypoint, {\n parentURL: import.meta.url,\n shouldInvalidate: (url) => {\n if (!url.startsWith(\"file:\"))\n return false;\n const file = fileURLToPath(url);\n const relative = path.relative(root, file);\n return (!file.includes(nodeModules) &&\n (relative === \"\" ||\n (relative !== \"..\" &&\n !relative.startsWith(`..${path.sep}`) &&\n !path.isAbsolute(relative))));\n },\n })), (watcher) => Effect.promise(() => watcher.close())).pipe(Effect.flatMap((watcher) => {\n const generation = devKeepAlive(runDev(options)).pipe(Effect.provideService(StackModuleLoader, {\n import: () => watcher.import().then(({ value }) => value),\n }), Effect.scoped);\n return Effect.forever(Effect.raceFirst(generation, nextChange(watcher)).pipe(Effect.flatMap((paths) => paths === undefined ? Effect.void : logReload(paths))));\n }));\n});\n/**\n * Bun: one process per generation. Bun cannot evict evaluated modules, so the\n * tracker only records which project files the stack graph loads; the first\n * change to one of them logs, lets the generation scope tear down the dev\n * widget, and exits with DEV_RELOAD_EXIT_CODE for the supervisor to respawn.\n */\nconst runBunDevWatcher = (options) => Effect.acquireRelease(Effect.sync(() => \n// Match Node's project-wide graph: the stack entrypoint may live in a\n// subdirectory while importing sibling source trees.\ntrackBunImports({ root: initialCwd })), (tracker) => Effect.promise(() => tracker.close())).pipe(Effect.flatMap((tracker) => Effect.raceFirst(devKeepAlive(runDev(options)).pipe(Effect.scoped), nextChange(tracker))), Effect.flatMap((paths) => paths === undefined\n ? Effect.void\n : logReload(paths).pipe(Effect.andThen(Effect.sync(() => {\n process.exitCode = DEV_RELOAD_EXIT_CODE;\n })))));\n/**\n * A run that ended by itself with nothing but interruptions in its cause was\n * cancelled from the inside — a provider or engine race, never the user —\n * so it must be reported like any other failure. Ctrl+C is different: it\n * interrupts the fiber running this code, so `catchCause` never gets to\n * park it (a parked `Effect.never` is interrupted straight away too).\n */\nconst describeFailure = (what, cause, next) => Cause.hasInterruptsOnly(cause)\n ? `alchemy dev: ${what} was interrupted internally (a bug in a provider or the engine — please report it with the trace below); ${next}.\\n${Cause.pretty(cause)}`\n : `alchemy dev: ${what} failed; ${next}.\\n${Cause.pretty(cause)}`;\n// A mid-edit import or planning failure must keep the watch process alive so\n// the next save can restart it. Ctrl+C still tears the run down.\nexport const devKeepAlive = (effect) => effect.pipe(Effect.catchCause((cause) => Console.error(describeFailure(\"run\", cause, \"waiting for the next file change to retry\")).pipe(Effect.andThen(Effect.never))));\nconst makeExec = () => {\n const options = Schema.decodeSync(DevOptions)(JSON.parse(process.env.ALCHEMY_EXEC_OPTIONS));\n return Effect.gen(function* () {\n yield* installShutdownFeedback;\n // Subscribe to the spawner's sidecar log stream BEFORE the stack runs:\n // this process owns the terminal renderer, so sidecar output printed\n // here lands in chronological order with the run's own lines instead of\n // racing the shared tty. No-op outside dev. The mixed tail is also teed\n // to log/{stage}/{timestamp}.log; per-resource output lands in\n // log/{stage}/{fqn…}/ via the local providers.\n const devLog = yield* (yield* makeDevLogOpener)(options.stage);\n yield* forwardSidecarLogs((entry) => devLog.writeLine(`[${entry.channel}] ${entry.line}`));\n // Single-pass runs park nothing. Otherwise Node reloads the stack graph in\n // this process; Bun exits for the supervisor to respawn (see above).\n return yield* (yield* devOnce)\n ? devKeepAlive(runDev(options))\n : process.versions.bun !== undefined\n ? runBunDevWatcher(options)\n : runNodeDevWatcher(options);\n }).pipe(Effect.provide(services), Effect.scoped, handleCliErrors);\n};\n/** Fully wired sidecar CLI program. */\nexport const exec = makeExec;\n//# sourceMappingURL=exec.js.map","import { exec } from \"alchemy/Cli/exec\";\nimport { runMain } from \"alchemy/Util/PlatformServices\";\n\nexec().pipe(runMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKa,iBAAb,cAAoC,cAAc,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAC/E;CACa,qBAAqB,MAAM,OAAO,gBAAgB,OAAO,IAAI,aAAa;EACnF,MAAM,KAAK,OAAO,WAAW;EAE7B,MAAM,OAAM,OADQA,OAAK,KAAA,CACR,KAAK,QAAQ,IAAI,GAAG,UAAU;EAC/C,OAAO,GAAG,cAAc,KAAK,EAAE,WAAW,KAAK,CAAC;EAChD,OAAO;GACH,YAAY;GACZ,kBAAkB;GAClB,KAAK;GACL,OAAO;EACX;CACJ,CAAC,CAAC;;;;;;CCCW,kBAAkB,OAAO,IAAI,yBAAyB;CACtD,gBAAgB,UAAU,UAAU,YAAY,OAAO,eAAe,KAC/E,MAAM,qBAAqB,QAC3B,UAAU,YAAY,OAAO,SAAS,KACtC,OAAO,MAAM,YAAY;;;;;ACnB0B,qBAAA;AACvD,IAAa,uBAAb,cAA0C,KAAK,YAAY,sBAAsB,CAAC,CAAC;CAC/E,CAAC,mBAAmB;AACxB;;;;;;;AAQA,MAAa,yBAAyB,OAAO,GAAG,WAAW,MAAM;CAC7D,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AAO,KAAK,IAAI,UAAU,EACpC,SAAS,IAAI,QAAQ,0CAA0C,OAAO,qIAElD,QAAQ,KAChC,CAAC,CAAC;CAEN,OAAO,QAAQ,YAAY;AAC/B,CAAC;;AAED,MAAa,0BAA0B,MAAM,mBAAmB,KAAK,EAAE,KAAK,CAAC,IACvE,KAAA,IACA;;;;ACjEN,MAAa,qBAAqB;CAC9B;EACI,IAAI;EACJ,OAAO;EACP,QAAQ;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACJ;CACJ;CACA;EACI,IAAI;EACJ,OAAO;EACP,QAAQ;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACJ;CACJ;CACA;EACI,IAAI;EACJ,OAAO;EACP,QAAQ;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACJ;CACJ;CACA;EACI,IAAI;EACJ,OAAO;EACP,QAAQ;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACJ;CACJ;CACA;EACI,IAAI;EACJ,OAAO;EACP,QAAQ;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACJ;CACJ;CACA;EACI,IAAI;EACJ,OAAO;EACP,QAAQ;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACJ;CACJ;CACA;EACI,IAAI;EACJ,OAAO;EACP,QAAQ;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACJ;CACJ;CACA;EACI,IAAI;EACJ,OAAO;EACP,QAAQ;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACJ;CACJ;CACA;EACI,IAAI;EACJ,OAAO;EACP,QAAQ;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACJ;CACJ;CACA;EACI,IAAI;EACJ,OAAO;EACP,QAAQ;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACJ;CACJ;CACA;EACI,IAAI;EACJ,OAAO;EACP,QAAQ;GACJ;GACA;GACA;GACA;GACA;G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