alchemy 2.0.0-beta.84 → 2.0.0-beta.86

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 (1270) hide show
  1. package/THIRD_PARTY_LICENSES.md +2 -2
  2. package/bin/cli.js +14 -6
  3. package/bin/register-oxc.js +16 -12
  4. package/lib/Action.d.ts.map +1 -1
  5. package/lib/Action.js.map +1 -1
  6. package/lib/ActionRuntimeContext.d.ts.map +1 -1
  7. package/lib/ActionRuntimeContext.js.map +1 -1
  8. package/lib/AdoptPolicy.d.ts +73 -0
  9. package/lib/AdoptPolicy.d.ts.map +1 -1
  10. package/lib/AdoptPolicy.js +54 -0
  11. package/lib/AdoptPolicy.js.map +1 -1
  12. package/lib/Alchemist/AuthRegistry.d.ts +45 -0
  13. package/lib/Alchemist/AuthRegistry.d.ts.map +1 -0
  14. package/lib/Alchemist/AuthRegistry.js +138 -0
  15. package/lib/Alchemist/AuthRegistry.js.map +1 -0
  16. package/lib/Alchemist/Drift.d.ts +70 -0
  17. package/lib/Alchemist/Drift.d.ts.map +1 -0
  18. package/lib/Alchemist/Drift.js +54 -0
  19. package/lib/Alchemist/Drift.js.map +1 -0
  20. package/lib/Alchemist/Entrypoint.d.ts +27 -3
  21. package/lib/Alchemist/Entrypoint.d.ts.map +1 -1
  22. package/lib/Alchemist/Entrypoint.js +43 -3
  23. package/lib/Alchemist/Entrypoint.js.map +1 -1
  24. package/lib/Alchemist/Errors.d.ts +1 -1
  25. package/lib/Alchemist/Errors.d.ts.map +1 -1
  26. package/lib/Alchemist/Errors.js +1 -1
  27. package/lib/Alchemist/Errors.js.map +1 -1
  28. package/lib/Alchemist/Logs.d.ts +46 -0
  29. package/lib/Alchemist/Logs.d.ts.map +1 -0
  30. package/lib/Alchemist/{routes/logs.js → Logs.js} +21 -26
  31. package/lib/Alchemist/Logs.js.map +1 -0
  32. package/lib/Alchemist/Nuke.d.ts +69 -0
  33. package/lib/Alchemist/Nuke.d.ts.map +1 -0
  34. package/lib/Alchemist/Nuke.js +35 -0
  35. package/lib/Alchemist/Nuke.js.map +1 -0
  36. package/lib/Alchemist/Operations.d.ts +168 -0
  37. package/lib/Alchemist/Operations.d.ts.map +1 -0
  38. package/lib/Alchemist/Operations.js +165 -0
  39. package/lib/Alchemist/Operations.js.map +1 -0
  40. package/lib/Alchemist/Profile.d.ts +132 -0
  41. package/lib/Alchemist/Profile.d.ts.map +1 -0
  42. package/lib/Alchemist/{routes/profile.js → Profile.js} +20 -21
  43. package/lib/Alchemist/Profile.js.map +1 -0
  44. package/lib/Alchemist/{routes/provider.d.ts → Provider.d.ts} +4 -4
  45. package/lib/Alchemist/Provider.d.ts.map +1 -0
  46. package/lib/Alchemist/{routes/provider.js → Provider.js} +7 -6
  47. package/lib/Alchemist/Provider.js.map +1 -0
  48. package/lib/Alchemist/Runtime.d.ts +10 -6
  49. package/lib/Alchemist/Runtime.d.ts.map +1 -1
  50. package/lib/Alchemist/Runtime.js +38 -2
  51. package/lib/Alchemist/Runtime.js.map +1 -1
  52. package/lib/Alchemist/State.d.ts +99 -0
  53. package/lib/Alchemist/State.d.ts.map +1 -0
  54. package/lib/Alchemist/State.js +172 -0
  55. package/lib/Alchemist/State.js.map +1 -0
  56. package/lib/Alchemist/index.d.ts +11 -10
  57. package/lib/Alchemist/index.d.ts.map +1 -1
  58. package/lib/Alchemist/index.js +10 -9
  59. package/lib/Alchemist/index.js.map +1 -1
  60. package/lib/AlchemyContext.d.ts.map +1 -1
  61. package/lib/AlchemyContext.js.map +1 -1
  62. package/lib/Apply.d.ts +2 -8
  63. package/lib/Apply.d.ts.map +1 -1
  64. package/lib/Apply.js +372 -212
  65. package/lib/Apply.js.map +1 -1
  66. package/lib/Artifacts.d.ts.map +1 -1
  67. package/lib/Artifacts.js +7 -6
  68. package/lib/Artifacts.js.map +1 -1
  69. package/lib/Auth/AuthProvider.d.ts +31 -13
  70. package/lib/Auth/AuthProvider.d.ts.map +1 -1
  71. package/lib/Auth/AuthProvider.js +37 -14
  72. package/lib/Auth/AuthProvider.js.map +1 -1
  73. package/lib/Auth/BrowserOAuth.d.ts +6 -8
  74. package/lib/Auth/BrowserOAuth.d.ts.map +1 -1
  75. package/lib/Auth/BrowserOAuth.js +25 -41
  76. package/lib/Auth/BrowserOAuth.js.map +1 -1
  77. package/lib/Auth/Credentials.d.ts.map +1 -1
  78. package/lib/Auth/Credentials.js +2 -2
  79. package/lib/Auth/Credentials.js.map +1 -1
  80. package/lib/Auth/CredentialsCache.d.ts.map +1 -1
  81. package/lib/Auth/CredentialsCache.js.map +1 -1
  82. package/lib/Auth/Demand.d.ts +4 -4
  83. package/lib/Auth/Demand.d.ts.map +1 -1
  84. package/lib/Auth/Demand.js +16 -10
  85. package/lib/Auth/Demand.js.map +1 -1
  86. package/lib/Auth/Env.d.ts +2 -1
  87. package/lib/Auth/Env.d.ts.map +1 -1
  88. package/lib/Auth/Env.js +4 -2
  89. package/lib/Auth/Env.js.map +1 -1
  90. package/lib/Auth/Inspect.d.ts +2 -2
  91. package/lib/Auth/Inspect.d.ts.map +1 -1
  92. package/lib/Auth/Inspect.js +3 -1
  93. package/lib/Auth/Inspect.js.map +1 -1
  94. package/lib/Auth/Lock.d.ts +3 -2
  95. package/lib/Auth/Lock.d.ts.map +1 -1
  96. package/lib/Auth/Lock.js +7 -9
  97. package/lib/Auth/Lock.js.map +1 -1
  98. package/lib/Auth/OAuthFlow.d.ts +9 -12
  99. package/lib/Auth/OAuthFlow.d.ts.map +1 -1
  100. package/lib/Auth/OAuthFlow.js +35 -20
  101. package/lib/Auth/OAuthFlow.js.map +1 -1
  102. package/lib/Auth/OidcToken.d.ts.map +1 -1
  103. package/lib/Auth/OidcToken.js.map +1 -1
  104. package/lib/Auth/Paths.d.ts +2 -1
  105. package/lib/Auth/Paths.d.ts.map +1 -1
  106. package/lib/Auth/Paths.js +3 -2
  107. package/lib/Auth/Paths.js.map +1 -1
  108. package/lib/Auth/Profile.d.ts +12 -1
  109. package/lib/Auth/Profile.d.ts.map +1 -1
  110. package/lib/Auth/Profile.js +22 -3
  111. package/lib/Auth/Profile.js.map +1 -1
  112. package/lib/Auth/ProfileMigrationV0.d.ts.map +1 -1
  113. package/lib/Auth/ProfileMigrationV0.js.map +1 -1
  114. package/lib/Auth/Registry.d.ts +20 -0
  115. package/lib/Auth/Registry.d.ts.map +1 -0
  116. package/lib/Auth/Registry.js +17 -0
  117. package/lib/Auth/Registry.js.map +1 -0
  118. package/lib/Auth/Resolve.d.ts +34 -2
  119. package/lib/Auth/Resolve.d.ts.map +1 -1
  120. package/lib/Auth/Resolve.js +51 -3
  121. package/lib/Auth/Resolve.js.map +1 -1
  122. package/lib/Auth/StoredAuthProvider.d.ts +1 -1
  123. package/lib/Auth/StoredAuthProvider.d.ts.map +1 -1
  124. package/lib/Auth/StoredAuthProvider.js +1 -2
  125. package/lib/Auth/StoredAuthProvider.js.map +1 -1
  126. package/lib/Auth/index.d.ts.map +1 -1
  127. package/lib/Auth/index.js.map +1 -1
  128. package/lib/Binding.d.ts.map +1 -1
  129. package/lib/Binding.js +3 -1
  130. package/lib/Binding.js.map +1 -1
  131. package/lib/Bundle/Bundle.d.ts +5 -0
  132. package/lib/Bundle/Bundle.d.ts.map +1 -1
  133. package/lib/Bundle/Bundle.js +36 -6
  134. package/lib/Bundle/Bundle.js.map +1 -1
  135. package/lib/Bundle/BundleAnalyzerPlugin.d.ts.map +1 -1
  136. package/lib/Bundle/BundleAnalyzerPlugin.js.map +1 -1
  137. package/lib/Bundle/InstalledPackages.d.ts.map +1 -1
  138. package/lib/Bundle/InstalledPackages.js.map +1 -1
  139. package/lib/Bundle/NamespaceImportPlugin.d.ts +55 -0
  140. package/lib/Bundle/NamespaceImportPlugin.d.ts.map +1 -0
  141. package/lib/Bundle/NamespaceImportPlugin.js +226 -0
  142. package/lib/Bundle/NamespaceImportPlugin.js.map +1 -0
  143. package/lib/Bundle/PurePlugin.d.ts.map +1 -1
  144. package/lib/Bundle/PurePlugin.js.map +1 -1
  145. package/lib/Bundle/RawPlugin.d.ts.map +1 -1
  146. package/lib/Bundle/RawPlugin.js.map +1 -1
  147. package/lib/Bundle/TempRoot.d.ts.map +1 -1
  148. package/lib/Bundle/TempRoot.js.map +1 -1
  149. package/lib/Bundle/UnreachableChunksPlugin.d.ts.map +1 -1
  150. package/lib/Bundle/UnreachableChunksPlugin.js.map +1 -1
  151. package/lib/Bundle/Vite.d.ts.map +1 -1
  152. package/lib/Bundle/Vite.js.map +1 -1
  153. package/lib/Bundle/index.d.ts +1 -0
  154. package/lib/Bundle/index.d.ts.map +1 -1
  155. package/lib/Bundle/index.js +1 -0
  156. package/lib/Bundle/index.js.map +1 -1
  157. package/lib/Callback.d.ts.map +1 -1
  158. package/lib/Callback.js.map +1 -1
  159. package/lib/Cli/DevOptions.d.ts.map +1 -1
  160. package/lib/Cli/DevOptions.js.map +1 -1
  161. package/lib/Cli/Format.d.ts +3 -2
  162. package/lib/Cli/Format.d.ts.map +1 -1
  163. package/lib/Cli/Format.js +20 -11
  164. package/lib/Cli/Format.js.map +1 -1
  165. package/lib/Cli/GlobalLog.d.ts +72 -26
  166. package/lib/Cli/GlobalLog.d.ts.map +1 -1
  167. package/lib/Cli/GlobalLog.js +156 -61
  168. package/lib/Cli/GlobalLog.js.map +1 -1
  169. package/lib/Cli/JsonConsole.d.ts +12 -0
  170. package/lib/Cli/JsonConsole.d.ts.map +1 -0
  171. package/lib/Cli/JsonConsole.js +67 -0
  172. package/lib/Cli/JsonConsole.js.map +1 -0
  173. package/lib/Cli/LoggingCli.d.ts.map +1 -1
  174. package/lib/Cli/LoggingCli.js +32 -26
  175. package/lib/Cli/LoggingCli.js.map +1 -1
  176. package/lib/Cli/ModeTag.d.ts.map +1 -1
  177. package/lib/Cli/ModeTag.js.map +1 -1
  178. package/lib/Cli/NamespaceTree.d.ts.map +1 -1
  179. package/lib/Cli/NamespaceTree.js.map +1 -1
  180. package/lib/Cli/PlainCliFormatter.d.ts.map +1 -1
  181. package/lib/Cli/PlainCliFormatter.js +4 -1
  182. package/lib/Cli/PlainCliFormatter.js.map +1 -1
  183. package/lib/Cli/Present.d.ts +14 -0
  184. package/lib/Cli/Present.d.ts.map +1 -0
  185. package/lib/Cli/Present.js +22 -0
  186. package/lib/Cli/Present.js.map +1 -0
  187. package/lib/Cli/PropertyDiff.d.ts.map +1 -1
  188. package/lib/Cli/PropertyDiff.js.map +1 -1
  189. package/lib/Cli/Reporter.d.ts.map +1 -1
  190. package/lib/Cli/Reporter.js.map +1 -1
  191. package/lib/Cli/SigilRenderer.d.ts +58 -0
  192. package/lib/Cli/SigilRenderer.d.ts.map +1 -0
  193. package/lib/Cli/SigilRenderer.js +39 -0
  194. package/lib/Cli/SigilRenderer.js.map +1 -0
  195. package/lib/Cli/checkVersion.d.ts +11 -14
  196. package/lib/Cli/checkVersion.d.ts.map +1 -1
  197. package/lib/Cli/checkVersion.js +19 -77
  198. package/lib/Cli/checkVersion.js.map +1 -1
  199. package/lib/Cli/commands/compat.d.ts.map +1 -1
  200. package/lib/Cli/commands/compat.js.map +1 -1
  201. package/lib/Cli/commands/confirm.d.ts +2 -2
  202. package/lib/Cli/commands/confirm.d.ts.map +1 -1
  203. package/lib/Cli/commands/confirm.js +3 -3
  204. package/lib/Cli/commands/confirm.js.map +1 -1
  205. package/lib/Cli/commands/deploy.d.ts +4 -4
  206. package/lib/Cli/commands/deploy.d.ts.map +1 -1
  207. package/lib/Cli/commands/deploy.js +40 -39
  208. package/lib/Cli/commands/deploy.js.map +1 -1
  209. package/lib/Cli/commands/dev.d.ts.map +1 -1
  210. package/lib/Cli/commands/dev.js +45 -6
  211. package/lib/Cli/commands/dev.js.map +1 -1
  212. package/lib/Cli/commands/drift.d.ts +9 -2
  213. package/lib/Cli/commands/drift.d.ts.map +1 -1
  214. package/lib/Cli/commands/drift.js +28 -17
  215. package/lib/Cli/commands/drift.js.map +1 -1
  216. package/lib/Cli/commands/errors.d.ts.map +1 -1
  217. package/lib/Cli/commands/errors.js +6 -5
  218. package/lib/Cli/commands/errors.js.map +1 -1
  219. package/lib/Cli/commands/flags.d.ts.map +1 -1
  220. package/lib/Cli/commands/flags.js +3 -1
  221. package/lib/Cli/commands/flags.js.map +1 -1
  222. package/lib/Cli/commands/instrument.d.ts +15 -5
  223. package/lib/Cli/commands/instrument.d.ts.map +1 -1
  224. package/lib/Cli/commands/instrument.js +33 -8
  225. package/lib/Cli/commands/instrument.js.map +1 -1
  226. package/lib/Cli/commands/logs.d.ts +1 -1
  227. package/lib/Cli/commands/logs.d.ts.map +1 -1
  228. package/lib/Cli/commands/logs.js +23 -22
  229. package/lib/Cli/commands/logs.js.map +1 -1
  230. package/lib/Cli/commands/nuke.d.ts +3 -2
  231. package/lib/Cli/commands/nuke.d.ts.map +1 -1
  232. package/lib/Cli/commands/nuke.js +23 -19
  233. package/lib/Cli/commands/nuke.js.map +1 -1
  234. package/lib/Cli/commands/profile/commands.d.ts +3 -2
  235. package/lib/Cli/commands/profile/commands.d.ts.map +1 -1
  236. package/lib/Cli/commands/profile/commands.js +26 -27
  237. package/lib/Cli/commands/profile/commands.js.map +1 -1
  238. package/lib/Cli/commands/profile/flows.d.ts +6 -5
  239. package/lib/Cli/commands/profile/flows.d.ts.map +1 -1
  240. package/lib/Cli/commands/profile/flows.js +19 -17
  241. package/lib/Cli/commands/profile/flows.js.map +1 -1
  242. package/lib/Cli/commands/profile/hub.d.ts +1 -2
  243. package/lib/Cli/commands/profile/hub.d.ts.map +1 -1
  244. package/lib/Cli/commands/profile/hub.js +15 -17
  245. package/lib/Cli/commands/profile/hub.js.map +1 -1
  246. package/lib/Cli/commands/profile/index.d.ts.map +1 -1
  247. package/lib/Cli/commands/profile/index.js.map +1 -1
  248. package/lib/Cli/commands/provider.d.ts +3 -1
  249. package/lib/Cli/commands/provider.d.ts.map +1 -1
  250. package/lib/Cli/commands/provider.js +4 -4
  251. package/lib/Cli/commands/provider.js.map +1 -1
  252. package/lib/Cli/commands/render.d.ts +2 -4
  253. package/lib/Cli/commands/render.d.ts.map +1 -1
  254. package/lib/Cli/commands/render.js +33 -56
  255. package/lib/Cli/commands/render.js.map +1 -1
  256. package/lib/Cli/commands/state.d.ts +32 -5
  257. package/lib/Cli/commands/state.d.ts.map +1 -1
  258. package/lib/Cli/commands/state.js +230 -58
  259. package/lib/Cli/commands/state.js.map +1 -1
  260. package/lib/Cli/components/capabilities.d.ts +4 -0
  261. package/lib/Cli/components/capabilities.d.ts.map +1 -0
  262. package/lib/Cli/components/capabilities.js +18 -0
  263. package/lib/Cli/components/capabilities.js.map +1 -0
  264. package/lib/Cli/components/types.d.ts +2 -81
  265. package/lib/Cli/components/types.d.ts.map +1 -1
  266. package/lib/Cli/components/types.js +1 -3
  267. package/lib/Cli/components/types.js.map +1 -1
  268. package/lib/Cli/components/ui/Data.d.ts.map +1 -1
  269. package/lib/Cli/components/ui/Data.js.map +1 -1
  270. package/lib/Cli/components/ui/Environment.d.ts +3 -3
  271. package/lib/Cli/components/ui/Environment.d.ts.map +1 -1
  272. package/lib/Cli/components/ui/Environment.js.map +1 -1
  273. package/lib/Cli/components/ui/Feedback.d.ts.map +1 -1
  274. package/lib/Cli/components/ui/Feedback.js.map +1 -1
  275. package/lib/Cli/components/ui/Interactive.d.ts +27 -5
  276. package/lib/Cli/components/ui/Interactive.d.ts.map +1 -1
  277. package/lib/Cli/components/ui/Interactive.js +12 -14
  278. package/lib/Cli/components/ui/Interactive.js.map +1 -1
  279. package/lib/Cli/components/ui/Layout.d.ts +1 -1
  280. package/lib/Cli/components/ui/Layout.d.ts.map +1 -1
  281. package/lib/Cli/components/ui/Layout.js +1 -1
  282. package/lib/Cli/components/ui/Layout.js.map +1 -1
  283. package/lib/Cli/components/ui/Live.d.ts +8 -1
  284. package/lib/Cli/components/ui/Live.d.ts.map +1 -1
  285. package/lib/Cli/components/ui/Live.js +46 -4
  286. package/lib/Cli/components/ui/Live.js.map +1 -1
  287. package/lib/Cli/components/ui/ProgramStatus.d.ts +13 -0
  288. package/lib/Cli/components/ui/ProgramStatus.d.ts.map +1 -0
  289. package/lib/Cli/components/ui/ProgramStatus.js +13 -0
  290. package/lib/Cli/components/ui/ProgramStatus.js.map +1 -0
  291. package/lib/Cli/components/ui/ProgressBar.d.ts.map +1 -1
  292. package/lib/Cli/components/ui/ProgressBar.js.map +1 -1
  293. package/lib/Cli/components/ui/Transcript.d.ts.map +1 -1
  294. package/lib/Cli/components/ui/Transcript.js.map +1 -1
  295. package/lib/Cli/components/ui/Typography.d.ts +1 -1
  296. package/lib/Cli/components/ui/Typography.d.ts.map +1 -1
  297. package/lib/Cli/components/ui/Typography.js +1 -1
  298. package/lib/Cli/components/ui/Typography.js.map +1 -1
  299. package/lib/Cli/components/ui/index.d.ts +3 -2
  300. package/lib/Cli/components/ui/index.d.ts.map +1 -1
  301. package/lib/Cli/components/ui/index.js +3 -2
  302. package/lib/Cli/components/ui/index.js.map +1 -1
  303. package/lib/Cli/components/view/ApprovePlan.d.ts +1 -1
  304. package/lib/Cli/components/view/ApprovePlan.d.ts.map +1 -1
  305. package/lib/Cli/components/view/ApprovePlan.js +4 -2
  306. package/lib/Cli/components/view/ApprovePlan.js.map +1 -1
  307. package/lib/Cli/components/view/Format.d.ts +5 -0
  308. package/lib/Cli/components/view/Format.d.ts.map +1 -0
  309. package/lib/Cli/components/view/Format.js +39 -0
  310. package/lib/Cli/components/view/Format.js.map +1 -0
  311. package/lib/Cli/components/view/Help.d.ts +2 -2
  312. package/lib/Cli/components/view/Help.d.ts.map +1 -1
  313. package/lib/Cli/components/view/Help.js +11 -8
  314. package/lib/Cli/components/view/Help.js.map +1 -1
  315. package/lib/Cli/components/view/Logo.d.ts.map +1 -1
  316. package/lib/Cli/components/view/Logo.js +1 -1
  317. package/lib/Cli/components/view/Logo.js.map +1 -1
  318. package/lib/Cli/components/view/Nuke.d.ts +8 -9
  319. package/lib/Cli/components/view/Nuke.d.ts.map +1 -1
  320. package/lib/Cli/components/view/Nuke.js +49 -52
  321. package/lib/Cli/components/view/Nuke.js.map +1 -1
  322. package/lib/Cli/components/view/PlanDecision.d.ts +1 -1
  323. package/lib/Cli/components/view/PlanDecision.d.ts.map +1 -1
  324. package/lib/Cli/components/view/PlanDecision.js +2 -2
  325. package/lib/Cli/components/view/PlanDecision.js.map +1 -1
  326. package/lib/Cli/components/view/PlanRow.d.ts.map +1 -1
  327. package/lib/Cli/components/view/PlanRow.js +1 -1
  328. package/lib/Cli/components/view/PlanRow.js.map +1 -1
  329. package/lib/Cli/components/view/PlanTree.d.ts +4 -2
  330. package/lib/Cli/components/view/PlanTree.d.ts.map +1 -1
  331. package/lib/Cli/components/view/PlanTree.js +4 -3
  332. package/lib/Cli/components/view/PlanTree.js.map +1 -1
  333. package/lib/Cli/components/view/PlanView.d.ts.map +1 -1
  334. package/lib/Cli/components/view/PlanView.js +5 -5
  335. package/lib/Cli/components/view/PlanView.js.map +1 -1
  336. package/lib/Cli/components/view/Profile.d.ts +1 -1
  337. package/lib/Cli/components/view/Profile.d.ts.map +1 -1
  338. package/lib/Cli/components/view/Profile.js +2 -2
  339. package/lib/Cli/components/view/Profile.js.map +1 -1
  340. package/lib/Cli/components/view/ProfileDashboard.d.ts +4 -4
  341. package/lib/Cli/components/view/ProfileDashboard.d.ts.map +1 -1
  342. package/lib/Cli/components/view/ProfileDashboard.js +9 -8
  343. package/lib/Cli/components/view/ProfileDashboard.js.map +1 -1
  344. package/lib/Cli/components/view/Prompts.d.ts +3 -3
  345. package/lib/Cli/components/view/Prompts.d.ts.map +1 -1
  346. package/lib/Cli/components/view/Prompts.js +11 -18
  347. package/lib/Cli/components/view/Prompts.js.map +1 -1
  348. package/lib/Cli/components/view/Runtime.d.ts +5 -5
  349. package/lib/Cli/components/view/Runtime.d.ts.map +1 -1
  350. package/lib/Cli/components/view/Runtime.js +140 -218
  351. package/lib/Cli/components/view/Runtime.js.map +1 -1
  352. package/lib/Cli/components/view/SigilCli.d.ts +2 -2
  353. package/lib/Cli/components/view/SigilCli.d.ts.map +1 -1
  354. package/lib/Cli/components/view/SigilCli.js +11 -10
  355. package/lib/Cli/components/view/SigilCli.js.map +1 -1
  356. package/lib/Cli/components/view/StackOutputs.d.ts.map +1 -1
  357. package/lib/Cli/components/view/StackOutputs.js +2 -2
  358. package/lib/Cli/components/view/StackOutputs.js.map +1 -1
  359. package/lib/Cli/components/view/StateExplorer.d.ts +1 -1
  360. package/lib/Cli/components/view/StateExplorer.d.ts.map +1 -1
  361. package/lib/Cli/components/view/StateExplorer.js +2 -1
  362. package/lib/Cli/components/view/StateExplorer.js.map +1 -1
  363. package/lib/Cli/components/view/statusStyle.d.ts +2 -2
  364. package/lib/Cli/components/view/statusStyle.d.ts.map +1 -1
  365. package/lib/Cli/components/view/statusStyle.js +1 -1
  366. package/lib/Cli/components/view/statusStyle.js.map +1 -1
  367. package/lib/Cli/components/view/usePlanPresentation.d.ts.map +1 -1
  368. package/lib/Cli/components/view/usePlanPresentation.js +13 -1
  369. package/lib/Cli/components/view/usePlanPresentation.js.map +1 -1
  370. package/lib/Cli/components/view/usePlanViewport.d.ts.map +1 -1
  371. package/lib/Cli/components/view/usePlanViewport.js.map +1 -1
  372. package/lib/Cli/exec.d.ts +6 -1
  373. package/lib/Cli/exec.d.ts.map +1 -1
  374. package/lib/Cli/exec.js +33 -35
  375. package/lib/Cli/exec.js.map +1 -1
  376. package/lib/Cli/index.d.ts.map +1 -1
  377. package/lib/Cli/index.js.map +1 -1
  378. package/lib/Cli/main.d.ts.map +1 -1
  379. package/lib/Cli/main.js +43 -29
  380. package/lib/Cli/main.js.map +1 -1
  381. package/lib/Cli/selectCli.d.ts +13 -3
  382. package/lib/Cli/selectCli.d.ts.map +1 -1
  383. package/lib/Cli/selectCli.js +39 -6
  384. package/lib/Cli/selectCli.js.map +1 -1
  385. package/lib/Command/Build.d.ts.map +1 -1
  386. package/lib/Command/Build.js.map +1 -1
  387. package/lib/Command/Command.d.ts.map +1 -1
  388. package/lib/Command/Command.js +1 -1
  389. package/lib/Command/Command.js.map +1 -1
  390. package/lib/Command/Dev.d.ts +58 -4
  391. package/lib/Command/Dev.d.ts.map +1 -1
  392. package/lib/Command/Dev.js +87 -30
  393. package/lib/Command/Dev.js.map +1 -1
  394. package/lib/Command/Exec.d.ts.map +1 -1
  395. package/lib/Command/Exec.js.map +1 -1
  396. package/lib/Command/Local.d.ts +1 -1
  397. package/lib/Command/Local.d.ts.map +1 -1
  398. package/lib/Command/Local.js.map +1 -1
  399. package/lib/Command/Memo.d.ts.map +1 -1
  400. package/lib/Command/Memo.js +1 -1
  401. package/lib/Command/Memo.js.map +1 -1
  402. package/lib/Command/Providers.d.ts +1 -1
  403. package/lib/Command/Providers.d.ts.map +1 -1
  404. package/lib/Command/Providers.js.map +1 -1
  405. package/lib/Command/Redaction.d.ts.map +1 -1
  406. package/lib/Command/Redaction.js.map +1 -1
  407. package/lib/Command/index.d.ts.map +1 -1
  408. package/lib/Command/index.js.map +1 -1
  409. package/lib/Contributions.d.ts +83 -23
  410. package/lib/Contributions.d.ts.map +1 -1
  411. package/lib/Contributions.js +48 -8
  412. package/lib/Contributions.js.map +1 -1
  413. package/lib/DNS/Adapter.d.ts +206 -0
  414. package/lib/DNS/Adapter.d.ts.map +1 -0
  415. package/lib/DNS/Adapter.js +112 -0
  416. package/lib/DNS/Adapter.js.map +1 -0
  417. package/lib/DNS/index.d.ts +2 -0
  418. package/lib/DNS/index.d.ts.map +1 -0
  419. package/lib/DNS/index.js +2 -0
  420. package/lib/DNS/index.js.map +1 -0
  421. package/lib/Dependencies.d.ts.map +1 -1
  422. package/lib/Dependencies.js.map +1 -1
  423. package/lib/Deploy.d.ts +7 -2
  424. package/lib/Deploy.d.ts.map +1 -1
  425. package/lib/Deploy.js +8 -3
  426. package/lib/Deploy.js.map +1 -1
  427. package/lib/Destroy.d.ts +5 -8
  428. package/lib/Destroy.d.ts.map +1 -1
  429. package/lib/Destroy.js +10 -7
  430. package/lib/Destroy.js.map +1 -1
  431. package/lib/Diff.d.ts.map +1 -1
  432. package/lib/Diff.js +14 -4
  433. package/lib/Diff.js.map +1 -1
  434. package/lib/Drift.d.ts +7 -7
  435. package/lib/Drift.d.ts.map +1 -1
  436. package/lib/Drift.js +192 -101
  437. package/lib/Drift.js.map +1 -1
  438. package/lib/EvalStack.d.ts +23 -0
  439. package/lib/EvalStack.d.ts.map +1 -0
  440. package/lib/EvalStack.js +47 -0
  441. package/lib/EvalStack.js.map +1 -0
  442. package/lib/Events.d.ts +220 -0
  443. package/lib/Events.d.ts.map +1 -0
  444. package/lib/Events.js +276 -0
  445. package/lib/Events.js.map +1 -0
  446. package/lib/FQN.d.ts.map +1 -1
  447. package/lib/FQN.js.map +1 -1
  448. package/lib/Http.d.ts.map +1 -1
  449. package/lib/Http.js.map +1 -1
  450. package/lib/Input.d.ts.map +1 -1
  451. package/lib/Input.js.map +1 -1
  452. package/lib/InstanceId.d.ts.map +1 -1
  453. package/lib/InstanceId.js.map +1 -1
  454. package/lib/Interaction.d.ts +166 -48
  455. package/lib/Interaction.d.ts.map +1 -1
  456. package/lib/Interaction.js +160 -63
  457. package/lib/Interaction.js.map +1 -1
  458. package/lib/KeyPair.d.ts.map +1 -1
  459. package/lib/KeyPair.js.map +1 -1
  460. package/lib/Local/DockerHostGateway.d.ts.map +1 -1
  461. package/lib/Local/DockerHostGateway.js.map +1 -1
  462. package/lib/Local/LocalProvider.d.ts.map +1 -1
  463. package/lib/Local/LocalProvider.js +31 -9
  464. package/lib/Local/LocalProvider.js.map +1 -1
  465. package/lib/Local/ProviderLayer.d.ts.map +1 -1
  466. package/lib/Local/ProviderLayer.js.map +1 -1
  467. package/lib/Local/RpcProvider.d.ts +2 -2
  468. package/lib/Local/RpcProvider.d.ts.map +1 -1
  469. package/lib/Local/RpcProvider.js +10 -1
  470. package/lib/Local/RpcProvider.js.map +1 -1
  471. package/lib/Local/RpcProviderProxy.d.ts +16 -0
  472. package/lib/Local/RpcProviderProxy.d.ts.map +1 -1
  473. package/lib/Local/RpcProviderProxy.js +19 -10
  474. package/lib/Local/RpcProviderProxy.js.map +1 -1
  475. package/lib/Local/RpcSerialization.d.ts +3 -2
  476. package/lib/Local/RpcSerialization.d.ts.map +1 -1
  477. package/lib/Local/RpcSerialization.js +36 -11
  478. package/lib/Local/RpcSerialization.js.map +1 -1
  479. package/lib/Local/RpcServer.d.ts +8 -2
  480. package/lib/Local/RpcServer.d.ts.map +1 -1
  481. package/lib/Local/RpcServer.js +26 -15
  482. package/lib/Local/RpcServer.js.map +1 -1
  483. package/lib/Local/RpcServerBun.d.ts.map +1 -1
  484. package/lib/Local/RpcServerBun.js +16 -6
  485. package/lib/Local/RpcServerBun.js.map +1 -1
  486. package/lib/Local/RpcServerEnvironment.d.ts +2 -3
  487. package/lib/Local/RpcServerEnvironment.d.ts.map +1 -1
  488. package/lib/Local/RpcServerEnvironment.js +2 -2
  489. package/lib/Local/RpcServerEnvironment.js.map +1 -1
  490. package/lib/Local/RpcServerNode.d.ts.map +1 -1
  491. package/lib/Local/RpcServerNode.js +23 -4
  492. package/lib/Local/RpcServerNode.js.map +1 -1
  493. package/lib/Local/RpcServerSession.d.ts +1 -1
  494. package/lib/Local/RpcServerSession.d.ts.map +1 -1
  495. package/lib/Local/RpcServerSession.js.map +1 -1
  496. package/lib/Local/RpcSpawner.d.ts +8 -8
  497. package/lib/Local/RpcSpawner.d.ts.map +1 -1
  498. package/lib/Local/RpcSpawner.js +67 -51
  499. package/lib/Local/RpcSpawner.js.map +1 -1
  500. package/lib/Local/RpcToken.d.ts +24 -0
  501. package/lib/Local/RpcToken.d.ts.map +1 -0
  502. package/lib/Local/RpcToken.js +62 -0
  503. package/lib/Local/RpcToken.js.map +1 -0
  504. package/lib/Local/Sidecar.d.ts +23 -0
  505. package/lib/Local/Sidecar.d.ts.map +1 -1
  506. package/lib/Local/Sidecar.js +23 -9
  507. package/lib/Local/Sidecar.js.map +1 -1
  508. package/lib/Mount.d.ts +76 -0
  509. package/lib/Mount.d.ts.map +1 -0
  510. package/lib/Mount.js +43 -0
  511. package/lib/Mount.js.map +1 -0
  512. package/lib/Named.d.ts.map +1 -1
  513. package/lib/Named.js.map +1 -1
  514. package/lib/Namespace.d.ts.map +1 -1
  515. package/lib/Namespace.js.map +1 -1
  516. package/lib/Nuke.d.ts +5 -23
  517. package/lib/Nuke.d.ts.map +1 -1
  518. package/lib/Nuke.js +49 -14
  519. package/lib/Nuke.js.map +1 -1
  520. package/lib/Output.d.ts +44 -3
  521. package/lib/Output.d.ts.map +1 -1
  522. package/lib/Output.js +144 -9
  523. package/lib/Output.js.map +1 -1
  524. package/lib/Phase.d.ts +2 -1
  525. package/lib/Phase.d.ts.map +1 -1
  526. package/lib/Phase.js.map +1 -1
  527. package/lib/PhysicalName.d.ts.map +1 -1
  528. package/lib/PhysicalName.js.map +1 -1
  529. package/lib/Plan.d.ts +23 -2
  530. package/lib/Plan.d.ts.map +1 -1
  531. package/lib/Plan.js +519 -183
  532. package/lib/Plan.js.map +1 -1
  533. package/lib/Platform.d.ts +5 -1
  534. package/lib/Platform.d.ts.map +1 -1
  535. package/lib/Platform.js +41 -10
  536. package/lib/Platform.js.map +1 -1
  537. package/lib/Provider.d.ts +84 -13
  538. package/lib/Provider.d.ts.map +1 -1
  539. package/lib/Provider.js +2 -2
  540. package/lib/Provider.js.map +1 -1
  541. package/lib/ProviderMode.d.ts.map +1 -1
  542. package/lib/ProviderMode.js.map +1 -1
  543. package/lib/Random.d.ts +1 -1
  544. package/lib/Random.d.ts.map +1 -1
  545. package/lib/Random.js.map +1 -1
  546. package/lib/Ref.d.ts.map +1 -1
  547. package/lib/Ref.js.map +1 -1
  548. package/lib/RemovalPolicy.d.ts +53 -2
  549. package/lib/RemovalPolicy.d.ts.map +1 -1
  550. package/lib/RemovalPolicy.js +43 -1
  551. package/lib/RemovalPolicy.js.map +1 -1
  552. package/lib/Rename.d.ts.map +1 -1
  553. package/lib/Rename.js.map +1 -1
  554. package/lib/Report.d.ts +17 -195
  555. package/lib/Report.d.ts.map +1 -1
  556. package/lib/Report.js +39 -12
  557. package/lib/Report.js.map +1 -1
  558. package/lib/Resource.d.ts +72 -7
  559. package/lib/Resource.d.ts.map +1 -1
  560. package/lib/Resource.js +60 -2
  561. package/lib/Resource.js.map +1 -1
  562. package/lib/ResourceContext.d.ts.map +1 -1
  563. package/lib/ResourceContext.js.map +1 -1
  564. package/lib/ResourceSelection.d.ts.map +1 -1
  565. package/lib/ResourceSelection.js.map +1 -1
  566. package/lib/Rpc.d.ts +19 -0
  567. package/lib/Rpc.d.ts.map +1 -1
  568. package/lib/Rpc.js +62 -8
  569. package/lib/Rpc.js.map +1 -1
  570. package/lib/Runtime/Bootstrap.d.ts +6 -7
  571. package/lib/Runtime/Bootstrap.d.ts.map +1 -1
  572. package/lib/Runtime/Bootstrap.js +6 -10
  573. package/lib/Runtime/Bootstrap.js.map +1 -1
  574. package/lib/Runtime/ExecutionMemo.d.ts.map +1 -1
  575. package/lib/Runtime/ExecutionMemo.js.map +1 -1
  576. package/lib/Runtime/Function.d.ts.map +1 -1
  577. package/lib/Runtime/Function.js.map +1 -1
  578. package/lib/Runtime/ManagedHttpShutdown.d.ts +17 -0
  579. package/lib/Runtime/ManagedHttpShutdown.d.ts.map +1 -1
  580. package/lib/Runtime/ManagedHttpShutdown.js +11 -2
  581. package/lib/Runtime/ManagedHttpShutdown.js.map +1 -1
  582. package/lib/Runtime/Process.d.ts +5 -0
  583. package/lib/Runtime/Process.d.ts.map +1 -1
  584. package/lib/Runtime/Process.js +36 -1
  585. package/lib/Runtime/Process.js.map +1 -1
  586. package/lib/Runtime.d.ts.map +1 -1
  587. package/lib/Runtime.js.map +1 -1
  588. package/lib/RuntimeContext.d.ts +29 -0
  589. package/lib/RuntimeContext.d.ts.map +1 -1
  590. package/lib/RuntimeContext.js +5 -1
  591. package/lib/RuntimeContext.js.map +1 -1
  592. package/lib/Sandbox.d.ts +144 -0
  593. package/lib/Sandbox.d.ts.map +1 -0
  594. package/lib/Sandbox.js +14 -0
  595. package/lib/Sandbox.js.map +1 -0
  596. package/lib/SandboxAgent.d.ts +55 -0
  597. package/lib/SandboxAgent.d.ts.map +1 -0
  598. package/lib/SandboxAgent.js +385 -0
  599. package/lib/SandboxAgent.js.map +1 -0
  600. package/lib/SandboxAgentClient.d.ts +154 -0
  601. package/lib/SandboxAgentClient.d.ts.map +1 -0
  602. package/lib/SandboxAgentClient.js +174 -0
  603. package/lib/SandboxAgentClient.js.map +1 -0
  604. package/lib/Schema.d.ts.map +1 -1
  605. package/lib/Schema.js.map +1 -1
  606. package/lib/Secrets/DotEnv.d.ts.map +1 -1
  607. package/lib/Secrets/DotEnv.js.map +1 -1
  608. package/lib/Secrets/Log.d.ts.map +1 -1
  609. package/lib/Secrets/Log.js.map +1 -1
  610. package/lib/Secrets/ProcessEnv.d.ts.map +1 -1
  611. package/lib/Secrets/ProcessEnv.js.map +1 -1
  612. package/lib/Secrets/Provider.d.ts +2 -1
  613. package/lib/Secrets/Provider.d.ts.map +1 -1
  614. package/lib/Secrets/Provider.js.map +1 -1
  615. package/lib/Secrets/index.d.ts.map +1 -1
  616. package/lib/Secrets/index.js.map +1 -1
  617. package/lib/Self.d.ts.map +1 -1
  618. package/lib/Self.js.map +1 -1
  619. package/lib/Stack.d.ts +49 -29
  620. package/lib/Stack.d.ts.map +1 -1
  621. package/lib/Stack.js +25 -31
  622. package/lib/Stack.js.map +1 -1
  623. package/lib/StackContext.d.ts.map +1 -1
  624. package/lib/StackContext.js.map +1 -1
  625. package/lib/Stage.d.ts.map +1 -1
  626. package/lib/Stage.js.map +1 -1
  627. package/lib/State/ActionState.d.ts.map +1 -1
  628. package/lib/State/ActionState.js.map +1 -1
  629. package/lib/State/BucketState.d.ts +2 -1
  630. package/lib/State/BucketState.d.ts.map +1 -1
  631. package/lib/State/BucketState.js +52 -21
  632. package/lib/State/BucketState.js.map +1 -1
  633. package/lib/State/Export.d.ts.map +1 -1
  634. package/lib/State/Export.js.map +1 -1
  635. package/lib/State/HttpStateApi.d.ts.map +1 -1
  636. package/lib/State/HttpStateApi.js.map +1 -1
  637. package/lib/State/HttpStateStore.d.ts.map +1 -1
  638. package/lib/State/HttpStateStore.js.map +1 -1
  639. package/lib/State/InMemoryState.d.ts.map +1 -1
  640. package/lib/State/InMemoryState.js.map +1 -1
  641. package/lib/State/LocalState.d.ts.map +1 -1
  642. package/lib/State/LocalState.js +3 -3
  643. package/lib/State/LocalState.js.map +1 -1
  644. package/lib/State/Provisioning.d.ts +7 -1
  645. package/lib/State/Provisioning.d.ts.map +1 -1
  646. package/lib/State/Provisioning.js +6 -1
  647. package/lib/State/Provisioning.js.map +1 -1
  648. package/lib/State/ResourceState.d.ts +2 -0
  649. package/lib/State/ResourceState.d.ts.map +1 -1
  650. package/lib/State/ResourceState.js.map +1 -1
  651. package/lib/State/State.d.ts +26 -0
  652. package/lib/State/State.d.ts.map +1 -1
  653. package/lib/State/State.js.map +1 -1
  654. package/lib/State/StateEncoding.d.ts +7 -0
  655. package/lib/State/StateEncoding.d.ts.map +1 -1
  656. package/lib/State/StateEncoding.js +19 -0
  657. package/lib/State/StateEncoding.js.map +1 -1
  658. package/lib/State/Sync.d.ts.map +1 -1
  659. package/lib/State/Sync.js.map +1 -1
  660. package/lib/State/Tree.d.ts.map +1 -1
  661. package/lib/State/Tree.js.map +1 -1
  662. package/lib/State/index.d.ts.map +1 -1
  663. package/lib/State/index.js +2 -2
  664. package/lib/State/index.js.map +1 -1
  665. package/lib/Tags.d.ts.map +1 -1
  666. package/lib/Tags.js.map +1 -1
  667. package/lib/Telemetry/Attributes.d.ts.map +1 -1
  668. package/lib/Telemetry/Attributes.js +1 -0
  669. package/lib/Telemetry/Attributes.js.map +1 -1
  670. package/lib/Telemetry/Layer.d.ts +2 -5
  671. package/lib/Telemetry/Layer.d.ts.map +1 -1
  672. package/lib/Telemetry/Layer.js +3 -23
  673. package/lib/Telemetry/Layer.js.map +1 -1
  674. package/lib/Telemetry/Metrics.d.ts +1 -1
  675. package/lib/Telemetry/Metrics.d.ts.map +1 -1
  676. package/lib/Telemetry/Metrics.js.map +1 -1
  677. package/lib/Telemetry.d.ts.map +1 -1
  678. package/lib/Telemetry.js.map +1 -1
  679. package/lib/TelemetryRelay.d.ts.map +1 -1
  680. package/lib/TelemetryRelay.js +1 -1
  681. package/lib/TelemetryRelay.js.map +1 -1
  682. package/lib/TelemetryRuntime.d.ts +1 -1
  683. package/lib/TelemetryRuntime.d.ts.map +1 -1
  684. package/lib/TelemetryRuntime.js +4 -3
  685. package/lib/TelemetryRuntime.js.map +1 -1
  686. package/lib/UserFacingError.d.ts.map +1 -1
  687. package/lib/UserFacingError.js.map +1 -1
  688. package/lib/Util/AtomicFile.d.ts.map +1 -1
  689. package/lib/Util/AtomicFile.js +3 -2
  690. package/lib/Util/AtomicFile.js.map +1 -1
  691. package/lib/Util/BatchedSink.d.ts.map +1 -1
  692. package/lib/Util/BatchedSink.js.map +1 -1
  693. package/lib/Util/ConfigProvider.d.ts.map +1 -1
  694. package/lib/Util/ConfigProvider.js +1 -0
  695. package/lib/Util/ConfigProvider.js.map +1 -1
  696. package/lib/Util/ConsoleSink.d.ts +23 -2
  697. package/lib/Util/ConsoleSink.d.ts.map +1 -1
  698. package/lib/Util/ConsoleSink.js +56 -14
  699. package/lib/Util/ConsoleSink.js.map +1 -1
  700. package/lib/Util/Duration.d.ts.map +1 -1
  701. package/lib/Util/Duration.js.map +1 -1
  702. package/lib/Util/Http1Dispatcher.d.ts.map +1 -1
  703. package/lib/Util/Http1Dispatcher.js.map +1 -1
  704. package/lib/Util/Ignore.d.ts +3 -1
  705. package/lib/Util/Ignore.d.ts.map +1 -1
  706. package/lib/Util/Ignore.js +20 -11
  707. package/lib/Util/Ignore.js.map +1 -1
  708. package/lib/Util/LineBuffer.d.ts.map +1 -1
  709. package/lib/Util/LineBuffer.js.map +1 -1
  710. package/lib/Util/LogAnnotation.d.ts +19 -0
  711. package/lib/Util/LogAnnotation.d.ts.map +1 -0
  712. package/lib/Util/LogAnnotation.js +19 -0
  713. package/lib/Util/LogAnnotation.js.map +1 -0
  714. package/lib/Util/LogRecord.d.ts +281 -0
  715. package/lib/Util/LogRecord.d.ts.map +1 -0
  716. package/lib/Util/LogRecord.js +267 -0
  717. package/lib/Util/LogRecord.js.map +1 -0
  718. package/lib/Util/Memoize.d.ts.map +1 -1
  719. package/lib/Util/Memoize.js.map +1 -1
  720. package/lib/Util/Node.d.ts +9 -0
  721. package/lib/Util/Node.d.ts.map +1 -1
  722. package/lib/Util/Node.js +10 -6
  723. package/lib/Util/Node.js.map +1 -1
  724. package/lib/Util/PlatformServices.d.ts +3 -2
  725. package/lib/Util/PlatformServices.d.ts.map +1 -1
  726. package/lib/Util/PlatformServices.js +18 -3
  727. package/lib/Util/PlatformServices.js.map +1 -1
  728. package/lib/Util/Redaction.d.ts.map +1 -1
  729. package/lib/Util/Redaction.js.map +1 -1
  730. package/lib/Util/ResourceOutput.d.ts +22 -11
  731. package/lib/Util/ResourceOutput.d.ts.map +1 -1
  732. package/lib/Util/ResourceOutput.js +28 -26
  733. package/lib/Util/ResourceOutput.js.map +1 -1
  734. package/lib/Util/Shutdown.d.ts +10 -0
  735. package/lib/Util/Shutdown.d.ts.map +1 -0
  736. package/lib/Util/Shutdown.js +32 -0
  737. package/lib/Util/Shutdown.js.map +1 -0
  738. package/lib/Util/Stream.d.ts.map +1 -1
  739. package/lib/Util/Stream.js.map +1 -1
  740. package/lib/Util/Terminal.d.ts +23 -12
  741. package/lib/Util/Terminal.d.ts.map +1 -1
  742. package/lib/Util/Terminal.js +26 -45
  743. package/lib/Util/Terminal.js.map +1 -1
  744. package/lib/Util/Theme.d.ts.map +1 -1
  745. package/lib/Util/Theme.js.map +1 -1
  746. package/lib/Util/TraceParent.d.ts +32 -0
  747. package/lib/Util/TraceParent.d.ts.map +1 -0
  748. package/lib/Util/TraceParent.js +42 -0
  749. package/lib/Util/TraceParent.js.map +1 -0
  750. package/lib/Util/base32.d.ts.map +1 -1
  751. package/lib/Util/base32.js.map +1 -1
  752. package/lib/Util/base64.d.ts +7 -0
  753. package/lib/Util/base64.d.ts.map +1 -0
  754. package/lib/Util/base64.js +24 -0
  755. package/lib/Util/base64.js.map +1 -0
  756. package/lib/Util/cached-function.d.ts +5 -0
  757. package/lib/Util/cached-function.d.ts.map +1 -1
  758. package/lib/Util/cached-function.js +13 -8
  759. package/lib/Util/cached-function.js.map +1 -1
  760. package/lib/Util/camel.d.ts.map +1 -1
  761. package/lib/Util/camel.js.map +1 -1
  762. package/lib/Util/data.d.ts +1 -1
  763. package/lib/Util/data.d.ts.map +1 -1
  764. package/lib/Util/data.js +1 -1
  765. package/lib/Util/data.js.map +1 -1
  766. package/lib/Util/dedent.d.ts.map +1 -1
  767. package/lib/Util/dedent.js.map +1 -1
  768. package/lib/Util/effect.d.ts.map +1 -1
  769. package/lib/Util/effect.js.map +1 -1
  770. package/lib/Util/equal.d.ts.map +1 -1
  771. package/lib/Util/equal.js +3 -2
  772. package/lib/Util/equal.js.map +1 -1
  773. package/lib/Util/exec.d.ts.map +1 -1
  774. package/lib/Util/exec.js.map +1 -1
  775. package/lib/Util/extraFiles.d.ts.map +1 -1
  776. package/lib/Util/extraFiles.js +5 -5
  777. package/lib/Util/extraFiles.js.map +1 -1
  778. package/lib/Util/index.d.ts.map +1 -1
  779. package/lib/Util/index.js.map +1 -1
  780. package/lib/Util/interactive.d.ts.map +1 -1
  781. package/lib/Util/interactive.js +1 -1
  782. package/lib/Util/interactive.js.map +1 -1
  783. package/lib/Util/ip-address.d.ts.map +1 -1
  784. package/lib/Util/ip-address.js.map +1 -1
  785. package/lib/Util/isPathWithin.d.ts.map +1 -1
  786. package/lib/Util/isPathWithin.js.map +1 -1
  787. package/lib/Util/layer-scoped.d.ts.map +1 -1
  788. package/lib/Util/layer-scoped.js.map +1 -1
  789. package/lib/Util/md5.d.ts.map +1 -1
  790. package/lib/Util/md5.js.map +1 -1
  791. package/lib/Util/poll.d.ts.map +1 -1
  792. package/lib/Util/poll.js.map +1 -1
  793. package/lib/Util/scc.d.ts +7 -1
  794. package/lib/Util/scc.d.ts.map +1 -1
  795. package/lib/Util/scc.js +16 -15
  796. package/lib/Util/scc.js.map +1 -1
  797. package/lib/Util/service.d.ts.map +1 -1
  798. package/lib/Util/service.js.map +1 -1
  799. package/lib/Util/sha256.d.ts.map +1 -1
  800. package/lib/Util/sha256.js.map +1 -1
  801. package/lib/Util/stable.d.ts.map +1 -1
  802. package/lib/Util/stable.js.map +1 -1
  803. package/lib/Util/tarGzip.d.ts +2 -1
  804. package/lib/Util/tarGzip.d.ts.map +1 -1
  805. package/lib/Util/tarGzip.js.map +1 -1
  806. package/lib/Util/type.d.ts.map +1 -1
  807. package/lib/Util/type.js.map +1 -1
  808. package/lib/Util/types.d.ts.map +1 -1
  809. package/lib/Util/types.js.map +1 -1
  810. package/lib/Util/unknown.d.ts.map +1 -1
  811. package/lib/Util/unknown.js.map +1 -1
  812. package/lib/Util/zip.d.ts.map +1 -1
  813. package/lib/Util/zip.js.map +1 -1
  814. package/lib/WebhookHost.d.ts.map +1 -1
  815. package/lib/WebhookHost.js.map +1 -1
  816. package/lib/Website/AstroOutput.d.ts +42 -0
  817. package/lib/Website/AstroOutput.d.ts.map +1 -0
  818. package/lib/Website/AstroOutput.js +34 -0
  819. package/lib/Website/AstroOutput.js.map +1 -0
  820. package/lib/Website/FrontendCore.d.ts +1 -1
  821. package/lib/Website/FrontendCore.d.ts.map +1 -1
  822. package/lib/Website/FrontendCore.js.map +1 -1
  823. package/lib/Website/Server.d.ts.map +1 -1
  824. package/lib/Website/Server.js +11 -1
  825. package/lib/Website/Server.js.map +1 -1
  826. package/lib/Website/ServerLocal.d.ts.map +1 -1
  827. package/lib/Website/ServerLocal.js.map +1 -1
  828. package/lib/Website/assets.d.ts.map +1 -1
  829. package/lib/Website/assets.js.map +1 -1
  830. package/lib/Website/packExtraFiles.d.ts.map +1 -1
  831. package/lib/Website/packExtraFiles.js.map +1 -1
  832. package/lib/Workers/DurableObject.d.ts +118 -0
  833. package/lib/Workers/DurableObject.d.ts.map +1 -0
  834. package/lib/Workers/DurableObject.js +146 -0
  835. package/lib/Workers/DurableObject.js.map +1 -0
  836. package/lib/Workers/DurableObjectBridge.d.ts +100 -0
  837. package/lib/Workers/DurableObjectBridge.d.ts.map +1 -0
  838. package/lib/Workers/DurableObjectBridge.js +146 -0
  839. package/lib/Workers/DurableObjectBridge.js.map +1 -0
  840. package/lib/Workers/DurableObjectEngine.d.ts +51 -0
  841. package/lib/Workers/DurableObjectEngine.d.ts.map +1 -0
  842. package/lib/Workers/DurableObjectEngine.js +331 -0
  843. package/lib/Workers/DurableObjectEngine.js.map +1 -0
  844. package/lib/Workers/EffectRpc.d.ts +25 -0
  845. package/lib/Workers/EffectRpc.d.ts.map +1 -0
  846. package/lib/Workers/EffectRpc.js +25 -0
  847. package/lib/Workers/EffectRpc.js.map +1 -0
  848. package/lib/Workers/EventLifetime.d.ts +57 -0
  849. package/lib/Workers/EventLifetime.d.ts.map +1 -0
  850. package/lib/Workers/EventLifetime.js +73 -0
  851. package/lib/Workers/EventLifetime.js.map +1 -0
  852. package/lib/Workers/InputGate.d.ts +107 -0
  853. package/lib/Workers/InputGate.d.ts.map +1 -0
  854. package/lib/Workers/InputGate.js +183 -0
  855. package/lib/Workers/InputGate.js.map +1 -0
  856. package/lib/Workers/RpcWebSocketClient.d.ts +30 -0
  857. package/lib/Workers/RpcWebSocketClient.d.ts.map +1 -0
  858. package/lib/Workers/RpcWebSocketClient.js +25 -0
  859. package/lib/Workers/RpcWebSocketClient.js.map +1 -0
  860. package/lib/Workers/Worker.d.ts +80 -0
  861. package/lib/Workers/Worker.d.ts.map +1 -0
  862. package/lib/Workers/Worker.js +150 -0
  863. package/lib/Workers/Worker.js.map +1 -0
  864. package/lib/Workers/WorkerBridge.d.ts +70 -0
  865. package/lib/Workers/WorkerBridge.d.ts.map +1 -0
  866. package/lib/Workers/WorkerBridge.js +91 -0
  867. package/lib/Workers/WorkerBridge.js.map +1 -0
  868. package/lib/Workers/WorkerEnvironment.d.ts +10 -0
  869. package/lib/Workers/WorkerEnvironment.d.ts.map +1 -0
  870. package/lib/Workers/WorkerEnvironment.js +8 -0
  871. package/lib/Workers/WorkerEnvironment.js.map +1 -0
  872. package/lib/Workers/Workerd/AlarmCallback.d.ts +26 -0
  873. package/lib/Workers/Workerd/AlarmCallback.d.ts.map +1 -0
  874. package/lib/Workers/Workerd/AlarmCallback.js +343 -0
  875. package/lib/Workers/Workerd/AlarmCallback.js.map +1 -0
  876. package/lib/Workers/Workerd/Bundle.d.ts +82 -0
  877. package/lib/Workers/Workerd/Bundle.d.ts.map +1 -0
  878. package/lib/Workers/Workerd/Bundle.js +166 -0
  879. package/lib/Workers/Workerd/Bundle.js.map +1 -0
  880. package/lib/Workers/Workerd/DurableObjectAlarmStorage.d.ts +14 -0
  881. package/lib/Workers/Workerd/DurableObjectAlarmStorage.d.ts.map +1 -0
  882. package/lib/Workers/Workerd/DurableObjectAlarmStorage.js +84 -0
  883. package/lib/Workers/Workerd/DurableObjectAlarmStorage.js.map +1 -0
  884. package/lib/Workers/Workerd/DurableObjectBridge.d.ts +50 -0
  885. package/lib/Workers/Workerd/DurableObjectBridge.d.ts.map +1 -0
  886. package/lib/Workers/Workerd/DurableObjectBridge.js +77 -0
  887. package/lib/Workers/Workerd/DurableObjectBridge.js.map +1 -0
  888. package/lib/Workers/Workerd/DurableObjectState.d.ts +92 -0
  889. package/lib/Workers/Workerd/DurableObjectState.d.ts.map +1 -0
  890. package/lib/Workers/Workerd/DurableObjectState.js +39 -0
  891. package/lib/Workers/Workerd/DurableObjectState.js.map +1 -0
  892. package/lib/Workers/Workerd/DurableObjectStorage.d.ts +89 -0
  893. package/lib/Workers/Workerd/DurableObjectStorage.d.ts.map +1 -0
  894. package/lib/Workers/Workerd/DurableObjectStorage.js +248 -0
  895. package/lib/Workers/Workerd/DurableObjectStorage.js.map +1 -0
  896. package/lib/Workers/Workerd/DurableObjectTransactionContext.d.ts +13 -0
  897. package/lib/Workers/Workerd/DurableObjectTransactionContext.d.ts.map +1 -0
  898. package/lib/Workers/Workerd/DurableObjectTransactionContext.js +5 -0
  899. package/lib/Workers/Workerd/DurableObjectTransactionContext.js.map +1 -0
  900. package/lib/Workers/Workerd/HttpServer.d.ts +12 -0
  901. package/lib/Workers/Workerd/HttpServer.d.ts.map +1 -0
  902. package/lib/Workers/Workerd/HttpServer.js +104 -0
  903. package/lib/Workers/Workerd/HttpServer.js.map +1 -0
  904. package/lib/Workers/Workerd/Module.d.ts +14 -0
  905. package/lib/Workers/Workerd/Module.d.ts.map +1 -0
  906. package/lib/Workers/Workerd/Module.js +23 -0
  907. package/lib/Workers/Workerd/Module.js.map +1 -0
  908. package/lib/Workers/Workerd/Request.d.ts +6 -0
  909. package/lib/Workers/Workerd/Request.d.ts.map +1 -0
  910. package/lib/Workers/Workerd/Request.js +4 -0
  911. package/lib/Workers/Workerd/Request.js.map +1 -0
  912. package/lib/Workers/Workerd/RpcDurableObject.d.ts +18 -0
  913. package/lib/Workers/Workerd/RpcDurableObject.d.ts.map +1 -0
  914. package/lib/Workers/Workerd/RpcDurableObject.js +66 -0
  915. package/lib/Workers/Workerd/RpcDurableObject.js.map +1 -0
  916. package/lib/Workers/Workerd/RpcWebSocket.d.ts +25 -0
  917. package/lib/Workers/Workerd/RpcWebSocket.d.ts.map +1 -0
  918. package/lib/Workers/Workerd/RpcWebSocket.js +248 -0
  919. package/lib/Workers/Workerd/RpcWebSocket.js.map +1 -0
  920. package/lib/Workers/Workerd/ScheduledEvents.d.ts +22 -0
  921. package/lib/Workers/Workerd/ScheduledEvents.d.ts.map +1 -0
  922. package/lib/Workers/Workerd/ScheduledEvents.js +119 -0
  923. package/lib/Workers/Workerd/ScheduledEvents.js.map +1 -0
  924. package/lib/Workers/Workerd/WebSocket.d.ts +71 -0
  925. package/lib/Workers/Workerd/WebSocket.d.ts.map +1 -0
  926. package/lib/Workers/Workerd/WebSocket.js +66 -0
  927. package/lib/Workers/Workerd/WebSocket.js.map +1 -0
  928. package/lib/Workers/Workerd/WorkerBridge.d.ts +41 -0
  929. package/lib/Workers/Workerd/WorkerBridge.d.ts.map +1 -0
  930. package/lib/Workers/Workerd/WorkerBridge.js +80 -0
  931. package/lib/Workers/Workerd/WorkerBridge.js.map +1 -0
  932. package/lib/Workers/Workerd/WorkerEvent.d.ts +18 -0
  933. package/lib/Workers/Workerd/WorkerEvent.d.ts.map +1 -0
  934. package/lib/Workers/Workerd/WorkerEvent.js +12 -0
  935. package/lib/Workers/Workerd/WorkerEvent.js.map +1 -0
  936. package/lib/Workers/Workerd/WorkerModulePlugin.d.ts +23 -0
  937. package/lib/Workers/Workerd/WorkerModulePlugin.d.ts.map +1 -0
  938. package/lib/Workers/Workerd/WorkerModulePlugin.js +52 -0
  939. package/lib/Workers/Workerd/WorkerModulePlugin.js.map +1 -0
  940. package/lib/Workers/Workerd/WorkerRuntimeContext.d.ts +26 -0
  941. package/lib/Workers/Workerd/WorkerRuntimeContext.d.ts.map +1 -0
  942. package/lib/Workers/Workerd/WorkerRuntimeContext.js +129 -0
  943. package/lib/Workers/Workerd/WorkerRuntimeContext.js.map +1 -0
  944. package/lib/Workers/Workerd/internal/StorageTransaction.d.ts +10 -0
  945. package/lib/Workers/Workerd/internal/StorageTransaction.d.ts.map +1 -0
  946. package/lib/Workers/Workerd/internal/StorageTransaction.js +15 -0
  947. package/lib/Workers/Workerd/internal/StorageTransaction.js.map +1 -0
  948. package/lib/Workers/WorkflowFailure.d.ts +47 -0
  949. package/lib/Workers/WorkflowFailure.d.ts.map +1 -0
  950. package/lib/Workers/WorkflowFailure.js +363 -0
  951. package/lib/Workers/WorkflowFailure.js.map +1 -0
  952. package/lib/Workers.d.ts +14 -0
  953. package/lib/Workers.d.ts.map +1 -0
  954. package/lib/Workers.js +14 -0
  955. package/lib/Workers.js.map +1 -0
  956. package/lib/WorkflowEncoding.d.ts.map +1 -1
  957. package/lib/WorkflowEncoding.js.map +1 -1
  958. package/lib/Workflows.d.ts +9 -0
  959. package/lib/Workflows.d.ts.map +1 -1
  960. package/lib/Workflows.js +8 -0
  961. package/lib/Workflows.js.map +1 -1
  962. package/lib/index.d.ts +1 -0
  963. package/lib/index.d.ts.map +1 -1
  964. package/lib/index.js +1 -0
  965. package/lib/index.js.map +1 -1
  966. package/package.json +25 -31
  967. package/src/AdoptPolicy.ts +76 -0
  968. package/src/Alchemist/AuthRegistry.ts +224 -0
  969. package/src/Alchemist/Drift.ts +103 -0
  970. package/src/Alchemist/Entrypoint.ts +51 -3
  971. package/src/Alchemist/Errors.ts +1 -1
  972. package/src/Alchemist/{routes/logs.ts → Logs.ts} +28 -30
  973. package/src/Alchemist/Nuke.ts +90 -0
  974. package/src/Alchemist/Operations.ts +309 -0
  975. package/src/Alchemist/{routes/profile.ts → Profile.ts} +22 -22
  976. package/src/Alchemist/{routes/provider.ts → Provider.ts} +7 -6
  977. package/src/Alchemist/Runtime.ts +46 -12
  978. package/src/Alchemist/{routes/state.ts → State.ts} +127 -42
  979. package/src/Alchemist/index.ts +32 -15
  980. package/src/Apply.ts +522 -305
  981. package/src/Artifacts.ts +14 -7
  982. package/src/Auth/AuthProvider.ts +121 -36
  983. package/src/Auth/BrowserOAuth.ts +37 -60
  984. package/src/Auth/Credentials.ts +2 -4
  985. package/src/Auth/Demand.ts +27 -18
  986. package/src/Auth/Env.ts +13 -8
  987. package/src/Auth/Inspect.ts +5 -2
  988. package/src/Auth/Lock.ts +7 -9
  989. package/src/Auth/OAuthFlow.ts +50 -29
  990. package/src/Auth/Paths.ts +3 -2
  991. package/src/Auth/Profile.ts +34 -3
  992. package/src/Auth/Registry.ts +27 -0
  993. package/src/Auth/Resolve.ts +75 -3
  994. package/src/Auth/StoredAuthProvider.ts +1 -2
  995. package/src/Binding.ts +3 -4
  996. package/src/Bundle/Bundle.ts +58 -7
  997. package/src/Bundle/NamespaceImportPlugin.ts +259 -0
  998. package/src/Bundle/index.ts +1 -0
  999. package/src/Cli/Format.ts +18 -12
  1000. package/src/Cli/GlobalLog.ts +211 -70
  1001. package/src/Cli/JsonConsole.ts +87 -0
  1002. package/src/Cli/LoggingCli.ts +41 -28
  1003. package/src/Cli/PlainCliFormatter.ts +4 -1
  1004. package/src/Cli/Present.ts +34 -0
  1005. package/src/Cli/SigilRenderer.ts +72 -0
  1006. package/src/Cli/checkVersion.ts +25 -78
  1007. package/src/Cli/commands/confirm.ts +3 -3
  1008. package/src/Cli/commands/deploy.ts +53 -44
  1009. package/src/Cli/commands/dev.ts +69 -10
  1010. package/src/Cli/commands/drift.ts +36 -19
  1011. package/src/Cli/commands/errors.ts +8 -17
  1012. package/src/Cli/commands/flags.ts +3 -1
  1013. package/src/Cli/commands/instrument.ts +39 -8
  1014. package/src/Cli/commands/logs.ts +23 -30
  1015. package/src/Cli/commands/nuke.ts +32 -27
  1016. package/src/Cli/commands/profile/commands.ts +34 -34
  1017. package/src/Cli/commands/profile/flows.ts +26 -20
  1018. package/src/Cli/commands/profile/hub.ts +16 -18
  1019. package/src/Cli/commands/provider.ts +4 -4
  1020. package/src/Cli/commands/render.ts +43 -71
  1021. package/src/Cli/commands/state.ts +316 -89
  1022. package/src/Cli/components/capabilities.ts +20 -0
  1023. package/src/Cli/components/types.ts +13 -99
  1024. package/src/Cli/components/ui/Environment.tsx +5 -5
  1025. package/src/Cli/components/ui/Interactive.tsx +36 -15
  1026. package/src/Cli/components/ui/Layout.tsx +1 -1
  1027. package/src/Cli/components/ui/Live.tsx +89 -10
  1028. package/src/Cli/components/ui/ProgramStatus.ts +14 -0
  1029. package/src/Cli/components/ui/Typography.tsx +1 -1
  1030. package/src/Cli/components/ui/index.ts +3 -2
  1031. package/src/Cli/components/view/ApprovePlan.tsx +4 -1
  1032. package/src/Cli/components/view/Format.tsx +58 -0
  1033. package/src/Cli/components/view/Help.tsx +18 -20
  1034. package/src/Cli/components/view/Logo.tsx +1 -1
  1035. package/src/Cli/components/view/Nuke.tsx +74 -49
  1036. package/src/Cli/components/view/PlanDecision.tsx +2 -1
  1037. package/src/Cli/components/view/PlanRow.tsx +1 -1
  1038. package/src/Cli/components/view/PlanTree.ts +12 -4
  1039. package/src/Cli/components/view/PlanView.tsx +6 -3
  1040. package/src/Cli/components/view/Profile.tsx +2 -2
  1041. package/src/Cli/components/view/ProfileDashboard.tsx +12 -11
  1042. package/src/Cli/components/view/Prompts.tsx +37 -75
  1043. package/src/Cli/components/view/Runtime.tsx +138 -238
  1044. package/src/Cli/components/view/SigilCli.tsx +26 -21
  1045. package/src/Cli/components/view/StackOutputs.tsx +2 -2
  1046. package/src/Cli/components/view/StateExplorer.tsx +2 -1
  1047. package/src/Cli/components/view/statusStyle.ts +2 -2
  1048. package/src/Cli/components/view/usePlanPresentation.ts +15 -1
  1049. package/src/Cli/exec.ts +52 -42
  1050. package/src/Cli/main.ts +60 -36
  1051. package/src/Cli/selectCli.ts +58 -6
  1052. package/src/Command/Command.ts +1 -1
  1053. package/src/Command/Dev.ts +129 -36
  1054. package/src/Command/Memo.ts +1 -1
  1055. package/src/Contributions.ts +142 -29
  1056. package/src/DNS/Adapter.ts +290 -0
  1057. package/src/DNS/index.ts +1 -0
  1058. package/src/Deploy.ts +11 -3
  1059. package/src/Destroy.ts +19 -13
  1060. package/src/Diff.ts +17 -4
  1061. package/src/Drift.ts +268 -127
  1062. package/src/EvalStack.ts +97 -0
  1063. package/src/Events.ts +330 -0
  1064. package/src/Interaction.ts +370 -105
  1065. package/src/Local/LocalProvider.ts +40 -9
  1066. package/src/Local/RpcProvider.ts +26 -7
  1067. package/src/Local/RpcProviderProxy.ts +29 -21
  1068. package/src/Local/RpcSerialization.ts +66 -18
  1069. package/src/Local/RpcServer.ts +38 -19
  1070. package/src/Local/RpcServerBun.ts +18 -8
  1071. package/src/Local/RpcServerEnvironment.ts +2 -2
  1072. package/src/Local/RpcServerNode.ts +26 -4
  1073. package/src/Local/RpcServerSession.ts +2 -2
  1074. package/src/Local/RpcSpawner.ts +89 -51
  1075. package/src/Local/RpcToken.ts +63 -0
  1076. package/src/Local/Sidecar.ts +10 -1
  1077. package/src/Mount.ts +113 -0
  1078. package/src/Nuke.ts +67 -44
  1079. package/src/Output.ts +185 -17
  1080. package/src/Phase.ts +2 -1
  1081. package/src/Plan.ts +700 -220
  1082. package/src/Platform.ts +82 -21
  1083. package/src/Provider.ts +108 -19
  1084. package/src/RemovalPolicy.ts +57 -4
  1085. package/src/Report.ts +77 -275
  1086. package/src/Resource.ts +124 -8
  1087. package/src/Rpc.ts +70 -8
  1088. package/src/Runtime/Bootstrap.ts +11 -15
  1089. package/src/Runtime/ManagedHttpShutdown.ts +21 -4
  1090. package/src/Runtime/Process.ts +40 -1
  1091. package/src/RuntimeContext.ts +28 -1
  1092. package/src/Sandbox.ts +189 -0
  1093. package/src/SandboxAgent.ts +585 -0
  1094. package/src/SandboxAgentClient.ts +312 -0
  1095. package/src/Secrets/Provider.ts +2 -0
  1096. package/src/Stack.ts +113 -135
  1097. package/src/State/BucketState.ts +62 -32
  1098. package/src/State/LocalState.ts +7 -9
  1099. package/src/State/Provisioning.ts +15 -2
  1100. package/src/State/ResourceState.ts +2 -0
  1101. package/src/State/State.ts +30 -0
  1102. package/src/State/StateEncoding.ts +22 -0
  1103. package/src/State/index.ts +2 -2
  1104. package/src/Telemetry/Attributes.ts +1 -0
  1105. package/src/Telemetry/Layer.ts +3 -24
  1106. package/src/Telemetry/Metrics.ts +1 -1
  1107. package/src/TelemetryRelay.ts +1 -1
  1108. package/src/TelemetryRuntime.ts +8 -8
  1109. package/src/Util/AtomicFile.ts +3 -2
  1110. package/src/Util/ConfigProvider.ts +1 -0
  1111. package/src/Util/ConsoleSink.ts +78 -13
  1112. package/src/Util/Ignore.ts +14 -8
  1113. package/src/Util/LogAnnotation.ts +18 -0
  1114. package/src/Util/LogRecord.ts +386 -0
  1115. package/src/Util/Node.ts +20 -6
  1116. package/src/Util/PlatformServices.ts +31 -5
  1117. package/src/Util/ResourceOutput.ts +33 -29
  1118. package/src/Util/Shutdown.ts +52 -0
  1119. package/src/Util/Terminal.ts +34 -58
  1120. package/src/Util/TraceParent.ts +70 -0
  1121. package/src/Util/base64.ts +22 -0
  1122. package/src/Util/cached-function.ts +30 -19
  1123. package/src/Util/data.ts +2 -2
  1124. package/src/Util/equal.ts +3 -2
  1125. package/src/Util/extraFiles.ts +9 -8
  1126. package/src/Util/interactive.ts +1 -1
  1127. package/src/Util/scc.ts +18 -13
  1128. package/src/Util/tarGzip.ts +3 -2
  1129. package/src/Website/AstroOutput.ts +83 -0
  1130. package/src/Website/Server.ts +1 -0
  1131. package/src/Workers/DurableObject.ts +307 -0
  1132. package/src/Workers/DurableObjectBridge.ts +322 -0
  1133. package/src/Workers/DurableObjectEngine.ts +609 -0
  1134. package/src/Workers/EffectRpc.ts +53 -0
  1135. package/src/Workers/EventLifetime.ts +84 -0
  1136. package/src/Workers/InputGate.ts +249 -0
  1137. package/src/Workers/RpcWebSocketClient.ts +67 -0
  1138. package/src/Workers/Worker.ts +283 -0
  1139. package/src/Workers/WorkerBridge.ts +173 -0
  1140. package/src/Workers/WorkerEnvironment.ts +9 -0
  1141. package/src/Workers/Workerd/AlarmCallback.ts +557 -0
  1142. package/src/Workers/Workerd/Bundle.ts +282 -0
  1143. package/src/Workers/Workerd/DurableObjectAlarmStorage.ts +102 -0
  1144. package/src/Workers/Workerd/DurableObjectBridge.ts +159 -0
  1145. package/src/Workers/Workerd/DurableObjectState.ts +153 -0
  1146. package/src/Workers/Workerd/DurableObjectStorage.ts +559 -0
  1147. package/src/Workers/Workerd/DurableObjectTransactionContext.ts +18 -0
  1148. package/src/Workers/Workerd/HttpServer.ts +139 -0
  1149. package/src/Workers/Workerd/Module.ts +35 -0
  1150. package/src/Workers/Workerd/Request.ts +3 -0
  1151. package/src/Workers/Workerd/RpcDurableObject.ts +121 -0
  1152. package/src/Workers/Workerd/RpcWebSocket.ts +348 -0
  1153. package/src/Workers/Workerd/ScheduledEvents.ts +191 -0
  1154. package/src/Workers/Workerd/WebSocket.ts +154 -0
  1155. package/src/Workers/Workerd/WorkerBridge.ts +149 -0
  1156. package/src/Workers/Workerd/WorkerEvent.ts +33 -0
  1157. package/src/Workers/Workerd/WorkerModulePlugin.ts +73 -0
  1158. package/src/Workers/Workerd/WorkerRuntimeContext.ts +195 -0
  1159. package/src/Workers/Workerd/internal/StorageTransaction.ts +21 -0
  1160. package/src/Workers/WorkflowFailure.ts +437 -0
  1161. package/src/Workers.ts +13 -0
  1162. package/src/Workflows.ts +11 -0
  1163. package/src/index.ts +1 -0
  1164. package/lib/Alchemist/Progress.d.ts +0 -16
  1165. package/lib/Alchemist/Progress.d.ts.map +0 -1
  1166. package/lib/Alchemist/Progress.js +0 -123
  1167. package/lib/Alchemist/Progress.js.map +0 -1
  1168. package/lib/Alchemist/Session.d.ts +0 -116
  1169. package/lib/Alchemist/Session.d.ts.map +0 -1
  1170. package/lib/Alchemist/Session.js +0 -212
  1171. package/lib/Alchemist/Session.js.map +0 -1
  1172. package/lib/Alchemist/routes/drift.d.ts +0 -55
  1173. package/lib/Alchemist/routes/drift.d.ts.map +0 -1
  1174. package/lib/Alchemist/routes/drift.js +0 -52
  1175. package/lib/Alchemist/routes/drift.js.map +0 -1
  1176. package/lib/Alchemist/routes/logs.d.ts +0 -41
  1177. package/lib/Alchemist/routes/logs.d.ts.map +0 -1
  1178. package/lib/Alchemist/routes/logs.js.map +0 -1
  1179. package/lib/Alchemist/routes/nuke.d.ts +0 -46
  1180. package/lib/Alchemist/routes/nuke.d.ts.map +0 -1
  1181. package/lib/Alchemist/routes/nuke.js +0 -80
  1182. package/lib/Alchemist/routes/nuke.js.map +0 -1
  1183. package/lib/Alchemist/routes/profile.d.ts +0 -133
  1184. package/lib/Alchemist/routes/profile.d.ts.map +0 -1
  1185. package/lib/Alchemist/routes/profile.js.map +0 -1
  1186. package/lib/Alchemist/routes/provider.d.ts.map +0 -1
  1187. package/lib/Alchemist/routes/provider.js.map +0 -1
  1188. package/lib/Alchemist/routes/stack.d.ts +0 -95
  1189. package/lib/Alchemist/routes/stack.d.ts.map +0 -1
  1190. package/lib/Alchemist/routes/stack.js +0 -73
  1191. package/lib/Alchemist/routes/stack.js.map +0 -1
  1192. package/lib/Alchemist/routes/state.d.ts +0 -81
  1193. package/lib/Alchemist/routes/state.d.ts.map +0 -1
  1194. package/lib/Alchemist/routes/state.js +0 -116
  1195. package/lib/Alchemist/routes/state.js.map +0 -1
  1196. package/lib/Cli/CliKit/CliKit.d.ts +0 -92
  1197. package/lib/Cli/CliKit/CliKit.d.ts.map +0 -1
  1198. package/lib/Cli/CliKit/CliKit.js +0 -27
  1199. package/lib/Cli/CliKit/CliKit.js.map +0 -1
  1200. package/lib/Cli/CliKit/index.d.ts +0 -9
  1201. package/lib/Cli/CliKit/index.d.ts.map +0 -1
  1202. package/lib/Cli/CliKit/index.js +0 -9
  1203. package/lib/Cli/CliKit/index.js.map +0 -1
  1204. package/lib/Cli/CliKit/interaction.d.ts +0 -13
  1205. package/lib/Cli/CliKit/interaction.d.ts.map +0 -1
  1206. package/lib/Cli/CliKit/interaction.js +0 -17
  1207. package/lib/Cli/CliKit/interaction.js.map +0 -1
  1208. package/lib/Cli/CliKit/layer.d.ts +0 -7
  1209. package/lib/Cli/CliKit/layer.d.ts.map +0 -1
  1210. package/lib/Cli/CliKit/layer.js +0 -33
  1211. package/lib/Cli/CliKit/layer.js.map +0 -1
  1212. package/lib/Local/DevLog.d.ts +0 -32
  1213. package/lib/Local/DevLog.d.ts.map +0 -1
  1214. package/lib/Local/DevLog.js +0 -112
  1215. package/lib/Local/DevLog.js.map +0 -1
  1216. package/lib/Test/Alchemy.d.ts +0 -79
  1217. package/lib/Test/Alchemy.d.ts.map +0 -1
  1218. package/lib/Test/Alchemy.js +0 -193
  1219. package/lib/Test/Alchemy.js.map +0 -1
  1220. package/lib/Test/Bun.d.ts +0 -69
  1221. package/lib/Test/Bun.d.ts.map +0 -1
  1222. package/lib/Test/Bun.js +0 -126
  1223. package/lib/Test/Bun.js.map +0 -1
  1224. package/lib/Test/Core.d.ts +0 -277
  1225. package/lib/Test/Core.d.ts.map +0 -1
  1226. package/lib/Test/Core.js +0 -362
  1227. package/lib/Test/Core.js.map +0 -1
  1228. package/lib/Test/Http.d.ts +0 -109
  1229. package/lib/Test/Http.d.ts.map +0 -1
  1230. package/lib/Test/Http.js +0 -123
  1231. package/lib/Test/Http.js.map +0 -1
  1232. package/lib/Test/TestState.d.ts +0 -12
  1233. package/lib/Test/TestState.d.ts.map +0 -1
  1234. package/lib/Test/TestState.js +0 -15
  1235. package/lib/Test/TestState.js.map +0 -1
  1236. package/lib/Test/Vitest.d.ts +0 -60
  1237. package/lib/Test/Vitest.d.ts.map +0 -1
  1238. package/lib/Test/Vitest.js +0 -132
  1239. package/lib/Test/Vitest.js.map +0 -1
  1240. package/lib/Test/index.d.ts +0 -3
  1241. package/lib/Test/index.d.ts.map +0 -1
  1242. package/lib/Test/index.js +0 -3
  1243. package/lib/Test/index.js.map +0 -1
  1244. package/lib/Util/FileLogger.d.ts +0 -7
  1245. package/lib/Util/FileLogger.d.ts.map +0 -1
  1246. package/lib/Util/FileLogger.js +0 -16
  1247. package/lib/Util/FileLogger.js.map +0 -1
  1248. package/lib/Util/proxy-chain.d.ts +0 -36
  1249. package/lib/Util/proxy-chain.d.ts.map +0 -1
  1250. package/lib/Util/proxy-chain.js +0 -133
  1251. package/lib/Util/proxy-chain.js.map +0 -1
  1252. package/src/Alchemist/Progress.ts +0 -167
  1253. package/src/Alchemist/Session.ts +0 -415
  1254. package/src/Alchemist/routes/drift.ts +0 -87
  1255. package/src/Alchemist/routes/nuke.ts +0 -131
  1256. package/src/Alchemist/routes/stack.ts +0 -173
  1257. package/src/Cli/CliKit/CliKit.ts +0 -159
  1258. package/src/Cli/CliKit/index.ts +0 -41
  1259. package/src/Cli/CliKit/interaction.ts +0 -19
  1260. package/src/Cli/CliKit/layer.ts +0 -44
  1261. package/src/Local/DevLog.ts +0 -122
  1262. package/src/Test/Alchemy.ts +0 -334
  1263. package/src/Test/Bun.ts +0 -230
  1264. package/src/Test/Core.ts +0 -785
  1265. package/src/Test/Http.ts +0 -201
  1266. package/src/Test/TestState.ts +0 -35
  1267. package/src/Test/Vitest.ts +0 -239
  1268. package/src/Test/index.ts +0 -2
  1269. package/src/Util/FileLogger.ts +0 -20
  1270. package/src/Util/proxy-chain.ts +0 -161
package/src/Plan.ts CHANGED
@@ -1,4 +1,3 @@
1
- /** @effect-diagnostics anyUnknownInErrorContext:off */
2
1
  /** @effect-diagnostics missingEffectError:off */
3
2
  import * as Cause from "effect/Cause";
4
3
  import * as Config from "effect/Config";
@@ -10,7 +9,13 @@ import * as Option from "effect/Option";
10
9
  import * as Ref from "effect/Ref";
11
10
  import { asEffect } from ".//Util/types.ts";
12
11
  import { isAction, type ActionLike } from "./Action.ts";
13
- import { AdoptPolicy, OwnedBySomeoneElse, stripUnowned, Unowned } from "./AdoptPolicy.ts";
12
+ import {
13
+ AdoptPolicy,
14
+ OwnedBySomeoneElse,
15
+ stripUnowned,
16
+ Unowned,
17
+ UnverifiableReplacement,
18
+ } from "./AdoptPolicy.ts";
14
19
  import { AlchemyContext } from "./AlchemyContext.ts";
15
20
  import {
16
21
  Artifacts,
@@ -29,6 +34,7 @@ import {
29
34
  type ReplaceDiff,
30
35
  type UpdateDiff,
31
36
  } from "./Diff.ts";
37
+ import { emit, type PlannedAction, type PlannedBinding, type PlannedResource } from "./Events.ts";
32
38
  import { parseFqn } from "./FQN.ts";
33
39
  import { generateInstanceId } from "./InstanceId.ts";
34
40
  import * as Output from "./Output.ts";
@@ -41,14 +47,10 @@ import {
41
47
  type ProviderService,
42
48
  } from "./Provider.ts";
43
49
  import { defaultProviderMode, stampedMode, type ProviderMode } from "./ProviderMode.ts";
44
- import {
45
- Progress,
46
- type PlannedAction,
47
- type PlannedBinding,
48
- type PlannedResource,
49
- } from "./Report.ts";
50
+ import { ProtectedResource } from "./RemovalPolicy.ts";
50
51
  import {
51
52
  isResource,
53
+ LookupOfManagedResourceError,
52
54
  missingImplementation,
53
55
  type ResourceBinding,
54
56
  type ResourceLike,
@@ -80,7 +82,7 @@ import {
80
82
  type UpdatingReourceState,
81
83
  } from "./State/index.ts";
82
84
  import { isPlainData, mapPlainData } from "./Util/data.ts";
83
- import { findCycleMembers } from "./Util/scc.ts";
85
+ import { findCycleMembers, findCycles } from "./Util/scc.ts";
84
86
  import { hashInput } from "./Util/sha256.ts";
85
87
 
86
88
  export type PlanError = never;
@@ -191,6 +193,8 @@ export interface Replace<R extends ResourceLike = ResourceLike> extends ApplyNod
191
193
  props: any;
192
194
  deleteFirst: boolean;
193
195
  restart?: boolean;
196
+ /** Ownership probe of the replacement's physical identity, run before any mutation. */
197
+ deferredAdoption?: { adopt: boolean };
194
198
  state:
195
199
  | CreatingResourceState
196
200
  | CreatedResourceState
@@ -370,6 +374,93 @@ export function make<A>(stack: StackSpec<A>, options: FilteredPlanOptions = {})
370
374
  return makePlan(stack, options);
371
375
  }
372
376
 
377
+ /**
378
+ * Bind every ref to a resource this program declares in its own stack and
379
+ * stage, so the ref is a dependency like a direct reference: the target is
380
+ * created first and deleted last, and the ref resolves to the target's fresh
381
+ * attributes (see `Output.bindRef`). A ref is matched by its id against the
382
+ * declared resource's FQN, which is what the ref reads from state. A
383
+ * resource's ref to itself stays unbound: it reads its own persisted state.
384
+ */
385
+ const bindSameStackRefs = (
386
+ stack: StackSpec<any>,
387
+ resources: ReadonlyArray<ResourceLike>,
388
+ actions: ReadonlyArray<ActionLike>,
389
+ ): ReadonlyArray<RefEdge> => {
390
+ const byFqn = new Map(resources.map((resource) => [resource.FQN, resource]));
391
+ const bind = (owner: string, value: unknown) => {
392
+ const edges: RefEdge[] = [];
393
+ for (const ref of Output.collectRefs(value)) {
394
+ if ((ref.stack ?? stack.name) !== stack.name) continue;
395
+ if ((ref.stage ?? stack.stage) !== stack.stage) continue;
396
+ if (ref.resourceId === owner) continue;
397
+ const target = byFqn.get(ref.resourceId);
398
+ if (target !== undefined) {
399
+ Output.bindRef(ref, target);
400
+ edges.push({ owner, target: target.FQN });
401
+ }
402
+ }
403
+ return edges;
404
+ };
405
+ const propEdges: RefEdge[] = [];
406
+ for (const resource of resources) {
407
+ propEdges.push(...bind(resource.FQN, resource.Props));
408
+ bind(resource.FQN, stack.bindings[resource.FQN] ?? []);
409
+ }
410
+ for (const action of actions) {
411
+ bind(action.FQN, [action.Input, action.Captures]);
412
+ }
413
+ return propEdges;
414
+ };
415
+
416
+ /** A same-stack ref in `owner`'s props, bound to the declared `target`. */
417
+ interface RefEdge {
418
+ readonly owner: string;
419
+ readonly target: string;
420
+ }
421
+
422
+ /**
423
+ * A same-stack ref in a resource's props closes a cycle through props: the
424
+ * ref's target depends, through props, on the resource holding the ref. A
425
+ * direct reference can't form this cycle (it needs the declaration first),
426
+ * so only a ref can, and neither resource can resolve its props before the
427
+ * other. The plan fails instead of waiting forever or deploying a stale
428
+ * value. The fix belongs to the provider whose props carry the ref: keep in
429
+ * props only what the provider can't move into a binding.
430
+ */
431
+ export class RefCycleError extends Data.TaggedError("RefCycleError")<{
432
+ message: string;
433
+ owner: string;
434
+ target: string;
435
+ }> {}
436
+
437
+ /**
438
+ * The first ref edge whose target reaches its owner through props, if any
439
+ * (see {@link RefCycleError}).
440
+ */
441
+ const findRefCycle = (
442
+ edges: ReadonlyArray<RefEdge>,
443
+ upstream: { readonly [fqn: string]: ReadonlyArray<string> },
444
+ ): { edge: RefEdge; path: string[] } | undefined => {
445
+ for (const edge of edges) {
446
+ // Depth-first from the target along prop dependencies, back to the owner.
447
+ const visited = new Set<string>();
448
+ const walk = (fqn: string, path: string[]): string[] | undefined => {
449
+ if (fqn === edge.owner) return path;
450
+ if (visited.has(fqn)) return undefined;
451
+ visited.add(fqn);
452
+ for (const next of upstream[fqn] ?? []) {
453
+ const found = walk(next, [...path, next]);
454
+ if (found) return found;
455
+ }
456
+ return undefined;
457
+ };
458
+ const path = walk(edge.target, [edge.target]);
459
+ if (path) return { edge, path: [edge.owner, ...path] };
460
+ }
461
+ return undefined;
462
+ };
463
+
373
464
  const makePlan = <A>(
374
465
  stack: StackSpec<A>,
375
466
  options: FilteredPlanOptions = {},
@@ -377,13 +468,13 @@ const makePlan = <A>(
377
468
  // @ts-expect-error
378
469
  Effect.gen(function* () {
379
470
  // Per-resource plan progress and phase markers are reported through
380
- // the ambient Progress reporter as the work happens, so a renderer can show
471
+ // events as the work happens, so a renderer can show
381
472
  // plan computation while it runs. The default reporter is a no-op.
382
- const reportPlanned = yield* Progress;
383
473
 
384
474
  const declaredResources = Object.values(stack.resources);
385
475
  const declaredActions = Object.values(stack.actions ?? {});
386
476
  const declared = [...declaredResources, ...declaredActions];
477
+ const refPropEdges = bindSameStackRefs(stack, declaredResources, declaredActions);
387
478
  const upstream = (node: ResourceLike | ActionLike) =>
388
479
  Object.keys(
389
480
  Output.upstreamAny(
@@ -397,7 +488,7 @@ const makePlan = <A>(
397
488
  const actions = declaredActions.filter((node) => !selected || selected.has(node.FQN));
398
489
 
399
490
  // Resolving the state service may bootstrap a remote store.
400
- yield* reportPlanned({ _tag: "plan.phase", phase: "loading-state" });
491
+ yield* emit({ type: "plan.phase", phase: "loading-state" });
401
492
  const state = yield* yield* State;
402
493
 
403
494
  // A bare platform tag yields a forward reference registered with
@@ -483,8 +574,9 @@ const makePlan = <A>(
483
574
  stack: stackName,
484
575
  stage: stage,
485
576
  });
486
- const oldResources = yield* Effect.all(
487
- resourceFqns.map((fqn) => state.get({ stack: stackName, stage: stage, fqn })),
577
+ const oldResources = yield* Effect.forEach(
578
+ resourceFqns,
579
+ (fqn) => state.get({ stack: stackName, stage: stage, fqn }),
488
580
  { concurrency: "unbounded" },
489
581
  );
490
582
 
@@ -551,7 +643,7 @@ const makePlan = <A>(
551
643
  if (remote.length > 0) yield* demandRemoteCredentials(remote);
552
644
  }
553
645
 
554
- yield* reportPlanned({ _tag: "plan.phase", phase: "computing-plan" });
646
+ yield* emit({ type: "plan.phase", phase: "computing-plan" });
555
647
 
556
648
  // ── FQN renames ──────────────────────────────────────────────────────
557
649
  // Map every former FQN claimed via `renamedFrom(...)` to its claimant's
@@ -739,135 +831,296 @@ const makePlan = <A>(
739
831
  // `cachedInScope`): a diff that fails or is cancelled must not take the
740
832
  // resolution every other diff is waiting on down with it.
741
833
  const memoScope = yield* Effect.scope;
742
- const resolvedResources: Record<string, Effect.Effect<any>> = {};
743
834
 
744
- const resolveResource = (
835
+ /**
836
+ * How the members of a cycle resolve while one of them is resolved: to
837
+ * `exposures` once those are known, and until then to their first pass,
838
+ * which leaves the data bound to them out. A member cannot wait on what
839
+ * the rest of the plan sees of its peers, since that waits on the member.
840
+ */
841
+ interface Peers {
842
+ readonly members: ReadonlySet<string>;
843
+ readonly exposures?: ReadonlyMap<string, unknown>;
844
+ }
845
+
846
+ /** What a node's outputs resolve to for the nodes that read them. */
847
+ interface Exposure {
848
+ readonly value: unknown;
849
+ /**
850
+ * How much of what the node last settled on `value` holds: all of it
851
+ * (`settled`), the attributes that survive its update, or `nothing`.
852
+ */
853
+ readonly extent: string;
854
+ /**
855
+ * The persisted bindings of a settled resource, for comparing them once
856
+ * the peers of its cycle are known.
857
+ */
858
+ readonly oldBindings?: ResourceBinding[];
859
+ /** The replacement its provider asked for. */
860
+ readonly replace?: ReplaceDiff;
861
+ }
862
+
863
+ const haveBindingsChanged = (olds: ResourceBinding[], news: ResourceBinding[]) =>
864
+ diffBindings(olds, news).some((binding) => binding.action !== "noop");
865
+
866
+ const exposeResource = (
745
867
  resourceExpr: Output.ResourceExpr<any, any>,
746
- ): Effect.Effect<any, Config.ConfigError | StateStoreError> =>
868
+ peers: Peers | undefined,
869
+ ): Effect.Effect<Exposure, Config.ConfigError | StateStoreError> =>
870
+ // @ts-expect-error
747
871
  Effect.gen(function* () {
748
- if (selected && !selected.has(resourceExpr.src.FQN)) {
749
- return yield* Effect.die(
750
- new UnsafeSelectionBoundary({
751
- message: `Output evaluation discovered unselected dependency '${resourceExpr.src.FQN}'. Declare the dependency explicitly or run a full deployment.`,
752
- }),
753
- );
872
+ const resource = resourceExpr.src;
873
+ const nothing: Exposure = { value: resourceExpr, extent: "nothing" };
874
+
875
+ const { provider, mode } = yield* resolveProviderAndMode(resource);
876
+ const props = materializeStableRefs(yield* resolveInput(resource.Props, undefined, peers));
877
+ // Falls back to the row at a former FQN (`renamedFrom`) so a
878
+ // renamed resource's stable attributes keep flowing to
879
+ // downstream diffs across the migration.
880
+ const { row: oldState } = yield* getPersistedRow(resource);
881
+
882
+ if (!oldState || oldState.status === "creating") {
883
+ return nothing;
754
884
  }
755
- if (isAction(resourceExpr.src)) {
756
- const node = yield* diffAction(resourceExpr.src);
757
- return node.action === "noop" ? node.state.output : resourceExpr;
885
+
886
+ // The resource is switching provider modes (local ⇄ live):
887
+ // it will be replaced, so nothing about the persisted attrs
888
+ // is stable for downstream consumers.
889
+ if (hasModeSwitched(mode, oldState)) {
890
+ return nothing;
758
891
  }
759
- // @ts-expect-error
760
- return yield* (resolvedResources[resourceExpr.src.FQN] ??= yield* cachedInScope(memoScope)(
761
- Effect.gen(function* () {
762
- const resource = resourceExpr.src;
763
892
 
764
- const { provider, mode } = yield* resolveProviderAndMode(resource);
765
- const props = materializeStableRefs(yield* resolveInput(resource.Props));
766
- // Falls back to the row at a former FQN (`renamedFrom`) so a
767
- // renamed resource's stable attributes keep flowing to
768
- // downstream diffs across the migration.
769
- const { row: oldState } = yield* getPersistedRow(resource);
893
+ const oldProps = oldState.status === "updating" ? oldState.old.props : oldState.props;
894
+
895
+ // Normalize both sides through `dedupeBindings` so the binding
896
+ // sets handed to `diff` are deduped AND sid-sorted — provider
897
+ // diffs that hash/compare the arrays never churn on
898
+ // registration-order flips (or on legacy unsorted state).
899
+ const oldBindings = dedupeBindings(oldState.bindings ?? []);
900
+ const bindings = stack.bindings[resource.FQN] ?? [];
901
+ // A cycle member's bindings hold its peers' outputs: they stay
902
+ // unresolved, and are left out of the comparison, until those are known.
903
+ const blind = peers !== undefined && peers.exposures === undefined;
904
+ const newBindings = dedupeBindings(
905
+ blind ? bindings : yield* resolveInput(bindings, undefined, peers),
906
+ );
770
907
 
771
- if (!oldState || oldState.status === "creating") {
772
- return resourceExpr;
773
- }
908
+ const diff = yield* provider.diff
909
+ ? provider
910
+ .diff({
911
+ id: resource.LogicalId,
912
+ fqn: resource.FQN,
913
+ olds: oldProps,
914
+ instanceId: oldState.instanceId,
915
+ news: props,
916
+ output: oldState.attr,
917
+ oldBindings,
918
+ newBindings,
919
+ })
920
+ .pipe(providePlanScope(resource, oldState.instanceId))
921
+ : Effect.undefined;
922
+
923
+ // A present `diff.stables` is authoritative for this update and
924
+ // overrides `provider.stables`. We only fall back to the
925
+ // provider-level "always stable" list when the diff does not
926
+ // return one (e.g. no diff fn, or a diff that omits `stables`).
927
+ const stables: string[] = diff?.stables ?? provider.stables ?? [];
928
+
929
+ const surviving: Exposure =
930
+ stables.length > 0
931
+ ? {
932
+ value: new Output.ResourceExpr(
933
+ resourceExpr.src,
934
+ Object.fromEntries(stables.map((stable) => [stable, oldState.attr?.[stable]])),
935
+ ),
936
+ extent: `stables:${[...stables].sort().join(",")}`,
937
+ }
938
+ : // if there are no stable properties, treat every property as changed
939
+ nothing;
774
940
 
775
- // The resource is switching provider modes (local ⇄ live):
776
- // it will be replaced, so nothing about the persisted attrs
777
- // is stable for downstream consumers.
778
- if (hasModeSwitched(mode, oldState)) {
779
- return resourceExpr;
780
- }
941
+ if (diff == null) {
942
+ if (
943
+ havePropsChanged(oldProps, props) ||
944
+ (!blind && haveBindingsChanged(oldBindings, newBindings))
945
+ ) {
946
+ // the props have changed but the provider did not provide any hints as to what is stable
947
+ // so we must assume everything has changed
948
+ return surviving;
949
+ }
950
+ } else if (diff.action === "update") {
951
+ return surviving;
952
+ } else if (diff.action === "replace") {
953
+ return { ...nothing, replace: diff };
954
+ }
955
+ // `--force` upgrades this resource's noop to an update (see the
956
+ // diff mapping in the resource-graph pass below), so its
957
+ // `reconcile` WILL re-run and may produce fresh attributes —
958
+ // that is the point of --force. Returning the persisted attr
959
+ // snapshot here would bake potentially-stale values into every
960
+ // consumer's plan props and binding data, so consumers would
961
+ // keep the stale attrs even though the upstream just
962
+ // re-reconciled. Expose only the stable attributes and let
963
+ // apply re-evaluate the rest against the forced reconcile's
964
+ // fresh output. A noop diff may carry `stables` for exactly this
965
+ // case (conditional stables such as a rename-mutable `name`);
966
+ // without them the forced upstream would only expose
967
+ // `provider.stables` and identity-sensitive consumers would
968
+ // falsely plan a replacement (#1832).
969
+ if (options.force) {
970
+ return surviving;
971
+ }
972
+ if (
973
+ oldState.status === "created" ||
974
+ oldState.status === "updated" ||
975
+ oldState.status === "replaced"
976
+ ) {
977
+ // we can safely return the attributes if we know they have stabilized
978
+ return { value: oldState.attr, extent: "settled", oldBindings };
979
+ } else {
980
+ // we must assume the resource doesn't exist if it hasn't stabilized
981
+ return nothing;
982
+ }
983
+ });
781
984
 
782
- const oldProps = oldState.status === "updating" ? oldState.old.props : oldState.props;
985
+ const exposeAction = (
986
+ resourceExpr: Output.ResourceExpr<any, any>,
987
+ node: ActionRun | ActionNoop,
988
+ ): Exposure =>
989
+ node.action === "noop"
990
+ ? { value: node.state.output, extent: "settled" }
991
+ : { value: resourceExpr, extent: "nothing" };
992
+
993
+ // A node's exposure with the peers of its cycle, if it has one, at their
994
+ // own first pass.
995
+ const firstPasses: Record<
996
+ string,
997
+ Effect.Effect<Exposure, Config.ConfigError | StateStoreError>
998
+ > = {};
999
+ const firstPass = (
1000
+ resourceExpr: Output.ResourceExpr<any, any>,
1001
+ ): Effect.Effect<Exposure, Config.ConfigError | StateStoreError> =>
1002
+ Effect.gen(function* () {
1003
+ const node = resourceExpr.src;
1004
+ return yield* (firstPasses[node.FQN] ??= yield* cachedInScope(memoScope)(
1005
+ isAction(node)
1006
+ ? Effect.map(firstActionPlan(node), (plan) => exposeAction(resourceExpr, plan))
1007
+ : exposeResource(resourceExpr, peersOf(node.FQN)),
1008
+ ));
1009
+ });
783
1010
 
784
- // Normalize both sides through `dedupeBindings` so the binding
785
- // sets handed to `diff` are deduped AND sid-sorted — provider
786
- // diffs that hash/compare the arrays never churn on
787
- // registration-order flips (or on legacy unsorted state).
788
- const oldBindings = dedupeBindings(oldState.bindings ?? []);
789
- const bindings = stack.bindings[resource.FQN] ?? [];
790
- const newBindings = dedupeBindings(
791
- combinedCycleMembers.has(resource.FQN) ? bindings : yield* resolveInput(bindings),
1011
+ /**
1012
+ * The exposure of every member of a cycle.
1013
+ *
1014
+ * A member's first pass cannot see the data bound to it, since that holds
1015
+ * its peers' outputs. So a member that settled is compared again with its
1016
+ * peers known, and the ones that turn out to have changed stop exposing
1017
+ * what they persisted, which may in turn change the members that read
1018
+ * them, until nothing more does. Without this a pool whose bound env
1019
+ * changed keeps handing the env it persisted to the host that runs it.
1020
+ */
1021
+ interface Settled {
1022
+ readonly exposures: ReadonlyMap<string, unknown>;
1023
+ /** Actions whose first pass reused an output an input of which changed. */
1024
+ readonly reruns: ReadonlySet<string>;
1025
+ }
1026
+ const settledCycles = new Map<
1027
+ ReadonlySet<string>,
1028
+ Effect.Effect<Settled, Config.ConfigError | StateStoreError>
1029
+ >();
1030
+ const settle = (
1031
+ members: ReadonlySet<string>,
1032
+ ): Effect.Effect<Settled, Config.ConfigError | StateStoreError> =>
1033
+ Effect.gen(function* () {
1034
+ const cached = settledCycles.get(members);
1035
+ if (cached) return yield* cached;
1036
+ const settling = yield* cachedInScope(memoScope)(
1037
+ Effect.gen(function* () {
1038
+ const nodes = [...members].map(
1039
+ (fqn) => Output.of(nodesByFqn.get(fqn) as any) as Output.ResourceExpr<any, any>,
792
1040
  );
793
-
794
- const diff = yield* provider.diff
795
- ? provider
796
- .diff({
797
- id: resource.LogicalId,
798
- fqn: resource.FQN,
799
- olds: oldProps,
800
- instanceId: oldState.instanceId,
801
- news: props,
802
- output: oldState.attr,
803
- oldBindings,
804
- newBindings,
805
- })
806
- .pipe(providePlanScope(resource, oldState.instanceId))
807
- : Effect.succeed(undefined);
808
-
809
- // A present `diff.stables` is authoritative for this update and
810
- // overrides `provider.stables`. We only fall back to the
811
- // provider-level "always stable" list when the diff does not
812
- // return one (e.g. no diff fn, or a diff that omits `stables`).
813
- const stables: string[] = diff?.stables ?? provider.stables ?? [];
814
-
815
- const withStables = (output: any) =>
816
- stables.length > 0
817
- ? new Output.ResourceExpr(
818
- resourceExpr.src,
819
- Object.fromEntries(stables.map((stable) => [stable, output?.[stable]])),
820
- )
821
- : // if there are no stable properties, treat every property as changed
822
- resourceExpr;
823
-
824
- if (diff == null) {
825
- if (
826
- havePropsChanged(oldProps, props) ||
827
- (!combinedCycleMembers.has(resource.FQN) &&
828
- diffBindings(oldBindings, newBindings).some(
829
- (binding) => binding.action !== "noop",
830
- ))
831
- ) {
832
- // the props have changed but the provider did not provide any hints as to what is stable
833
- // so we must assume everything has changed
834
- return withStables(oldState?.attr);
835
- }
836
- } else if (diff.action === "update") {
837
- return withStables(oldState?.attr);
838
- } else if (diff.action === "replace") {
839
- return resourceExpr;
840
- }
841
- // `--force` upgrades this resource's noop to an update (see the
842
- // diff mapping in the resource-graph pass below), so its
843
- // `reconcile` WILL re-run and may produce fresh attributes —
844
- // that is the point of --force. Returning the persisted attr
845
- // snapshot here would bake potentially-stale values into every
846
- // consumer's plan props and binding data, so consumers would
847
- // keep the stale attrs even though the upstream just
848
- // re-reconciled. Expose only the stable attributes and let
849
- // apply re-evaluate the rest against the forced reconcile's
850
- // fresh output. A noop diff may carry `stables` for exactly this
851
- // case (conditional stables such as a rename-mutable `name`);
852
- // without them the forced upstream would only expose
853
- // `provider.stables` and identity-sensitive consumers would
854
- // falsely plan a replacement (#1832).
855
- if (options.force) {
856
- return withStables(oldState?.attr);
857
- }
858
- if (
859
- oldState.status === "created" ||
860
- oldState.status === "updated" ||
861
- oldState.status === "replaced"
862
- ) {
863
- // we can safely return the attributes if we know they have stabilized
864
- return oldState?.attr;
865
- } else {
866
- // we must assume the resource doesn't exist if it hasn't stabilized
867
- return resourceExpr;
1041
+ const first = yield* Effect.forEach(nodes, firstPass, { concurrency: "unbounded" });
1042
+ const exposures = new Map<string, unknown>(
1043
+ nodes.map((node, i) => [node.src.FQN, first[i].value]),
1044
+ );
1045
+ const peers: Peers = { members, exposures };
1046
+ const extents = new Map<string, string>(
1047
+ nodes.map((node, i) => [node.src.FQN, first[i].extent]),
1048
+ );
1049
+ const reruns = new Set<string>();
1050
+ const expose = (node: Output.ResourceExpr<any, any>) =>
1051
+ isAction(node.src)
1052
+ ? Effect.map(planAction(node.src, peers), (plan) => exposeAction(node, plan))
1053
+ : exposeResource(node, peers);
1054
+ // The members to look at again: first the ones whose bound data
1055
+ // differs from what they persisted, then the ones that read a
1056
+ // member that changed.
1057
+ let suspects = (yield* Effect.forEach(
1058
+ nodes,
1059
+ (node, i) => {
1060
+ const { oldBindings } = first[i];
1061
+ return oldBindings === undefined
1062
+ ? Effect.succeed([])
1063
+ : resolveInput(stack.bindings[node.src.FQN] ?? [], undefined, peers).pipe(
1064
+ Effect.map((bindings) =>
1065
+ haveBindingsChanged(oldBindings, dedupeBindings(bindings)) ? [node] : [],
1066
+ ),
1067
+ );
1068
+ },
1069
+ { concurrency: "unbounded" },
1070
+ )).flat();
1071
+ // A member only ever exposes less, so this ends; the bound guards
1072
+ // a provider whose stable attributes come and go.
1073
+ for (let round = 0; suspects.length > 0 && round <= 2 * nodes.length; round++) {
1074
+ const exposed = yield* Effect.forEach(suspects, expose, {
1075
+ concurrency: "unbounded",
1076
+ });
1077
+ const changing = new Set<string>();
1078
+ suspects.forEach((node, i) => {
1079
+ const fqn: string = node.src.FQN;
1080
+ const { extent } = exposed[i];
1081
+ if (extent === extents.get(fqn)) return;
1082
+ extents.set(fqn, extent);
1083
+ exposures.set(fqn, exposed[i].value);
1084
+ changing.add(fqn);
1085
+ if (isAction(node.src)) reruns.add(fqn);
1086
+ });
1087
+ suspects = nodes.filter(
1088
+ (node) =>
1089
+ extents.get(node.src.FQN) !== "nothing" &&
1090
+ (allUpstreamDependencies[node.src.FQN] ?? []).some((upstream) =>
1091
+ changing.has(upstream),
1092
+ ),
1093
+ );
868
1094
  }
1095
+ return { exposures, reruns } satisfies Settled;
869
1096
  }),
870
- ));
1097
+ );
1098
+ settledCycles.set(members, settling);
1099
+ return yield* settling;
1100
+ });
1101
+
1102
+ const resolveResource = (
1103
+ resourceExpr: Output.ResourceExpr<any, any>,
1104
+ peers?: Peers,
1105
+ ): Effect.Effect<any, Config.ConfigError | StateStoreError> =>
1106
+ Effect.gen(function* () {
1107
+ const fqn: string = resourceExpr.src.FQN;
1108
+ if (selected && !selected.has(fqn)) {
1109
+ return yield* Effect.die(
1110
+ new UnsafeSelectionBoundary({
1111
+ message: `Output evaluation discovered unselected dependency '${fqn}'. Declare the dependency explicitly or run a full deployment.`,
1112
+ }),
1113
+ );
1114
+ }
1115
+ if (peers?.members.has(fqn)) {
1116
+ return peers.exposures
1117
+ ? peers.exposures.get(fqn)
1118
+ : (yield* firstPass(resourceExpr)).value;
1119
+ }
1120
+ const cycle = combinedCycles.get(fqn);
1121
+ return cycle
1122
+ ? (yield* settle(cycle)).exposures.get(fqn)
1123
+ : (yield* firstPass(resourceExpr)).value;
871
1124
  });
872
1125
 
873
1126
  /**
@@ -888,12 +1141,14 @@ const makePlan = <A>(
888
1141
  // a shared visited-set) keeps legitimately-shared diamond references
889
1142
  // intact and is race-free under `concurrency: "unbounded"` (#1082).
890
1143
  ancestors: ReadonlySet<object> = new Set(),
1144
+ // The cycle being resolved, if any.
1145
+ peers?: Peers,
891
1146
  ): Effect.Effect<any, Config.ConfigError | StateStoreError> =>
892
1147
  Effect.gen(function* () {
893
1148
  if (!input) {
894
1149
  return input;
895
1150
  } else if (Output.isExpr(input)) {
896
- return yield* resolveOutput(input);
1151
+ return yield* resolveOutput(input, peers);
897
1152
  } else if (Config.isConfig(input)) {
898
1153
  // Config is a lazy reference to the deploy environment. Resolve it
899
1154
  // here so the concrete value flows into diffing/hashing (an opaque
@@ -901,36 +1156,35 @@ const makePlan = <A>(
901
1156
  // providers receive a resolved value instead of a Config object.
902
1157
  // `Config.Redacted` resolves to a `Redacted`, which stays opaque via
903
1158
  // the branch below.
904
- return yield* resolveInput(yield* input, ancestors);
1159
+ return yield* resolveInput(yield* input, ancestors, peers);
905
1160
  } else if (isResource(input)) {
906
1161
  // Resource objects have dynamic properties (path, hash, etc.) that are
907
1162
  // created on-demand by a Proxy getter and aren't enumerable via Object.entries.
908
1163
  // Resolve the ResourceExpr to get the actual resource output, then continue
909
1164
  // resolving any nested outputs in the result.
910
1165
  const resourceExpr = Output.of(input);
911
- const resolved = yield* resolveOutput(resourceExpr);
1166
+ const resolved = yield* resolveOutput(resourceExpr, peers);
912
1167
  if (Output.isResourceExpr(resolved)) {
913
1168
  // Still-unresolved reference (creating, replacing, or updating
914
1169
  // upstream) — keep it evaluable for Apply.
915
1170
  return resolved;
916
1171
  }
917
- return yield* resolveInput(resolved, ancestors);
1172
+ return yield* resolveInput(resolved, ancestors, peers);
918
1173
  } else if (isPlainData(input)) {
919
1174
  if (ancestors.has(input)) {
920
1175
  return undefined;
921
1176
  }
922
1177
  const nested = new Set(ancestors).add(input);
923
1178
  if (Array.isArray(input)) {
924
- return yield* Effect.all(
925
- input.map((item) => resolveInput(item, nested)),
926
- { concurrency: "unbounded" },
927
- );
1179
+ return yield* Effect.forEach(input, (item) => resolveInput(item, nested, peers), {
1180
+ concurrency: "unbounded",
1181
+ });
928
1182
  }
929
1183
  return Object.fromEntries(
930
- yield* Effect.all(
931
- Object.entries(input).map(([key, value]) =>
932
- resolveInput(value, nested).pipe(Effect.map((value) => [key, value])),
933
- ),
1184
+ yield* Effect.forEach(
1185
+ Object.entries(input),
1186
+ ([key, value]) =>
1187
+ resolveInput(value, nested, peers).pipe(Effect.map((value) => [key, value])),
934
1188
  { concurrency: "unbounded" },
935
1189
  ),
936
1190
  );
@@ -982,35 +1236,90 @@ const makePlan = <A>(
982
1236
  return mapPlainData(input, ancestors, (child) => materializeStableRefs(child, ancestors));
983
1237
  };
984
1238
 
1239
+ // A lookup that finds a resource this stack manages would bind it with
1240
+ // no dependency edge. Detected by the provider's static `stables`, the
1241
+ // properties that identify a resource; providers without them go unchecked.
1242
+ const rejectManagedLookup = Effect.fn(function* (
1243
+ expr: Output.LookupExpr<any>,
1244
+ props: unknown,
1245
+ attrs: Record<string, unknown>,
1246
+ ) {
1247
+ const provider = yield* tryFindProviderByType(expr.lookupType, "live");
1248
+ const stables = Option.getOrUndefined(provider)?.stables ?? [];
1249
+ if (stables.length === 0) return;
1250
+ for (const [fqn, row] of persistedRows) {
1251
+ if (row === undefined || isActionState(row) || row.resourceType !== expr.lookupType) {
1252
+ continue;
1253
+ }
1254
+ const attr = row.attr as Record<string, unknown> | undefined;
1255
+ // An optional stable (a zone id on an account-level resource) is
1256
+ // undefined on both sides and still matches; at least one stable
1257
+ // must be set so an empty row never matches everything.
1258
+ if (
1259
+ attr !== undefined &&
1260
+ stables.some((key) => attr[key] !== undefined) &&
1261
+ stables.every((key) => attr[key] === attrs[key])
1262
+ ) {
1263
+ return yield* Effect.die(
1264
+ new LookupOfManagedResourceError({
1265
+ message: `${expr.lookupType}.lookup(${JSON.stringify(props)}) found '${fqn}', which this stack manages. Reference the declared resource instead: a lookup would not stop this stack deleting or replacing it.`,
1266
+ type: expr.lookupType,
1267
+ props,
1268
+ fqn,
1269
+ }),
1270
+ );
1271
+ }
1272
+ }
1273
+ });
1274
+
985
1275
  const resolveOutput = (
986
1276
  expr: Output.Expr<any>,
1277
+ // The cycle being resolved, if any.
1278
+ peers?: Peers,
987
1279
  ): Effect.Effect<any, Config.ConfigError | StateStoreError> =>
988
1280
  Effect.gen(function* () {
989
1281
  if (Output.isResourceExpr(expr)) {
990
- return yield* resolveResource(expr);
1282
+ return yield* resolveResource(expr, peers);
991
1283
  } else if (Output.isPropExpr(expr)) {
992
- const upstream = yield* resolveOutput(expr.expr);
1284
+ const upstream = yield* resolveOutput(expr.expr, peers);
993
1285
  return upstream?.[expr.identifier];
994
1286
  } else if (Output.isApplyExpr(expr)) {
995
- const upstream = yield* resolveOutput(expr.expr);
1287
+ const upstream = yield* resolveOutput(expr.expr, peers);
996
1288
  return Output.hasOutputs(upstream) ? expr : expr.f(upstream);
1289
+ } else if (Output.isLookupExpr(expr)) {
1290
+ // Props that depend on a resource still being created resolve at
1291
+ // apply, like any other Output.
1292
+ const props = yield* resolveInput(expr.expr, undefined, peers);
1293
+ if (Output.hasOutputs(props)) return expr;
1294
+ const attrs = yield* expr.f(props);
1295
+ yield* rejectManagedLookup(expr, props, attrs);
1296
+ return attrs;
997
1297
  } else if (Output.isEffectExpr(expr)) {
998
- const upstream = yield* resolveOutput(expr.expr);
1298
+ const upstream = yield* resolveOutput(expr.expr, peers);
999
1299
  return Output.hasOutputs(upstream) ? expr : yield* expr.f(upstream);
1000
1300
  } else if (Output.isFlatMapExpr(expr)) {
1001
- const upstream = yield* resolveOutput(expr.expr);
1301
+ const upstream = yield* resolveOutput(expr.expr, peers);
1002
1302
  // Source still unresolved -> keep the flatMap intact for a later pass.
1003
1303
  // Otherwise run `f` to produce the next Output and resolve into it.
1004
1304
  return Output.hasOutputs(upstream)
1005
1305
  ? expr
1006
- : yield* resolveOutput(Output.asOutput(expr.f(upstream)) as Output.Expr<any>);
1306
+ : yield* resolveOutput(Output.asOutput(expr.f(upstream)) as Output.Expr<any>, peers);
1007
1307
  } else if (Output.isAllExpr(expr)) {
1008
- return yield* Effect.all(expr.outs.map(resolveOutput), {
1308
+ return yield* Effect.forEach(expr.outs, (out) => resolveOutput(out, peers), {
1009
1309
  concurrency: "unbounded",
1010
1310
  });
1011
1311
  } else if (Output.isLiteralExpr(expr)) {
1012
1312
  return expr.value;
1013
1313
  } else if (Output.isRefExpr(expr)) {
1314
+ // A ref bound to a declared resource resolves like a direct
1315
+ // reference: unknown while that resource is being created.
1316
+ const target = Output.refTarget(expr);
1317
+ if (target !== undefined) {
1318
+ return yield* resolveResource(
1319
+ Output.of(target as any) as Output.ResourceExpr<any, any>,
1320
+ peers,
1321
+ );
1322
+ }
1014
1323
  const refStack = expr.stack ?? stackName;
1015
1324
  const refStage = expr.stage ?? stage;
1016
1325
  const refState = yield* state
@@ -1052,7 +1361,7 @@ const makePlan = <A>(
1052
1361
  }
1053
1362
  return output;
1054
1363
  } else if (Output.isNamedExpr(expr)) {
1055
- return yield* resolveOutput(expr.expr);
1364
+ return yield* resolveOutput(expr.expr, peers);
1056
1365
  }
1057
1366
  return yield* Effect.die(new Error("Not implemented yet" + (expr as any).kind));
1058
1367
  });
@@ -1091,6 +1400,28 @@ const makePlan = <A>(
1091
1400
  ),
1092
1401
  ]);
1093
1402
 
1403
+ // Fail before resolving anything: a ref that closes a cycle through
1404
+ // props would leave both resources waiting on each other (#3112).
1405
+ const refCycle = findRefCycle(
1406
+ refPropEdges.filter((edge) => newResourceFqns.has(edge.owner)),
1407
+ newUpstreamDependencies,
1408
+ );
1409
+ if (refCycle !== undefined) {
1410
+ const { edge, path } = refCycle;
1411
+ return yield* Effect.die(
1412
+ new RefCycleError({
1413
+ message:
1414
+ `'${edge.owner}' references '${edge.target}' through a ref in its props, and ` +
1415
+ `'${edge.target}' depends on '${edge.owner}' through props ` +
1416
+ `(${path.join(" -> ")}). Neither can be planned before the other. ` +
1417
+ `Bind the reference instead of passing it as a prop, so the cycle runs ` +
1418
+ `through bindings.`,
1419
+ owner: edge.owner,
1420
+ target: edge.target,
1421
+ }),
1422
+ );
1423
+ }
1424
+
1094
1425
  // Map FQN -> list of upstream FQNs from bindings
1095
1426
  const bindingUpstreamDependencies: {
1096
1427
  [fqn: string]: string[];
@@ -1141,7 +1472,15 @@ const makePlan = <A>(
1141
1472
  // Resources that participate in a cycle when both prop and binding
1142
1473
  // edges are considered. Used below to decide whether an acyclic
1143
1474
  // binding edge should also become a downstream edge.
1144
- const combinedCycleMembers = findCycleMembers(allUpstreamDependencies);
1475
+ const combinedCycles = findCycles(allUpstreamDependencies);
1476
+ const combinedCycleMembers = new Set(combinedCycles.keys());
1477
+ const peersOf = (fqn: string): Peers | undefined => {
1478
+ const members = combinedCycles.get(fqn);
1479
+ return members && { members };
1480
+ };
1481
+ const nodesByFqn = new Map<string, ResourceLike | ActionLike>(
1482
+ [...resources, ...actions].map((node) => [node.FQN, node]),
1483
+ );
1145
1484
  const inputCycleMembers = findCycleMembers({
1146
1485
  ...newUpstreamDependencies,
1147
1486
  ...Object.fromEntries(
@@ -1217,56 +1556,75 @@ const makePlan = <A>(
1217
1556
  ...actions.map((action) => [action.FQN, computeDownstream(action.FQN)] as const),
1218
1557
  ]);
1219
1558
 
1559
+ const planAction = Effect.fn(function* (action: ActionLike, peers: Peers | undefined) {
1560
+ const fqn = action.FQN;
1561
+ const downstream = newDownstreamDependencies[fqn] ?? [];
1562
+ const oldState = yield* state.get({ stack: stackName, stage, fqn });
1563
+ const prior = isActionState(oldState) ? oldState : undefined;
1564
+ const resolvedInput = inputCycleMembers.has(fqn)
1565
+ ? action.Input
1566
+ : yield* resolveInput(action.Input, undefined, peers);
1567
+ // Actions are pure in their inputs. Only a completed, unforced run
1568
+ // with fully known, identical inputs has a reusable output.
1569
+ if (
1570
+ prior?.status === "ran" &&
1571
+ !options.force &&
1572
+ !inputCycleMembers.has(fqn) &&
1573
+ isResolved(resolvedInput) &&
1574
+ prior.inputHash === (yield* hashInput(resolvedInput))
1575
+ ) {
1576
+ return {
1577
+ kind: "action",
1578
+ action: "noop",
1579
+ def: action,
1580
+ state: prior,
1581
+ downstream,
1582
+ } satisfies ActionNoop;
1583
+ }
1584
+ return {
1585
+ kind: "action",
1586
+ action: "run",
1587
+ def: action,
1588
+ input: action.Input,
1589
+ state: prior,
1590
+ downstream,
1591
+ forced: !!options.force,
1592
+ } satisfies ActionRun;
1593
+ });
1220
1594
  const actionPlans: Record<
1221
1595
  string,
1222
1596
  Effect.Effect<ActionRun | ActionNoop, Config.ConfigError | StateStoreError>
1223
1597
  > = {};
1224
- const diffAction = Effect.fn("plan.diff.action")(function* (action: ActionLike) {
1598
+ // An Action's plan with the peers of its cycle, if it has one, at their
1599
+ // first pass.
1600
+ const firstActionPlan = Effect.fn(function* (action: ActionLike) {
1225
1601
  return yield* (actionPlans[action.FQN] ??= yield* cachedInScope(memoScope)(
1226
- Effect.gen(function* () {
1227
- const fqn = action.FQN;
1228
- const downstream = newDownstreamDependencies[fqn] ?? [];
1229
- const oldState = yield* state.get({ stack: stackName, stage, fqn });
1230
- const prior = isActionState(oldState) ? oldState : undefined;
1231
- const resolvedInput = inputCycleMembers.has(fqn)
1232
- ? action.Input
1233
- : yield* resolveInput(action.Input);
1234
- // Actions are pure in their inputs. Only a completed, unforced run
1235
- // with fully known, identical inputs has a reusable output.
1236
- if (
1237
- prior?.status === "ran" &&
1238
- !options.force &&
1239
- !inputCycleMembers.has(fqn) &&
1240
- isResolved(resolvedInput) &&
1241
- prior.inputHash === (yield* hashInput(resolvedInput))
1242
- ) {
1243
- return {
1244
- kind: "action",
1245
- action: "noop",
1246
- def: action,
1247
- state: prior,
1248
- downstream,
1249
- } satisfies ActionNoop;
1250
- }
1251
- return {
1602
+ planAction(action, peersOf(action.FQN)),
1603
+ ));
1604
+ });
1605
+ const diffAction = Effect.fn("plan.diff.action")(function* (action: ActionLike) {
1606
+ const plan = yield* firstActionPlan(action);
1607
+ const cycle = combinedCycles.get(action.FQN);
1608
+ // An input of a cycle member can change with what is bound to a peer.
1609
+ return plan.action === "noop" && cycle && (yield* settle(cycle)).reruns.has(action.FQN)
1610
+ ? ({
1252
1611
  kind: "action",
1253
1612
  action: "run",
1254
1613
  def: action,
1255
1614
  input: action.Input,
1256
- state: prior,
1257
- downstream,
1258
- forced: !!options.force,
1259
- } satisfies ActionRun;
1260
- }),
1261
- ));
1615
+ state: plan.state,
1616
+ downstream: plan.downstream,
1617
+ forced: false,
1618
+ } satisfies ActionRun)
1619
+ : plan;
1262
1620
  });
1263
1621
 
1264
1622
  const plannedCount = yield* Ref.make(0);
1265
1623
  const resourcePlanned = (node: CRUD) =>
1266
1624
  Ref.updateAndGet(plannedCount, (count) => count + 1).pipe(
1267
1625
  Effect.flatMap((completed) =>
1268
- reportPlanned({
1269
- _tag: "plan.resource.completed",
1626
+ emit({
1627
+ type: "plan.resource.completed",
1270
1628
  ...describeResource(node),
1271
1629
  completed,
1272
1630
  total: resources.length,
@@ -1281,8 +1639,8 @@ const makePlan = <A>(
1281
1639
  // Paired with the resource-planned completion below so renderers can
1282
1640
  // show what is actually in flight (diffs may read the cloud and run
1283
1641
  // concurrently — completions alone hide the slow tail).
1284
- yield* reportPlanned({
1285
- _tag: "plan.resource.started",
1642
+ yield* emit({
1643
+ type: "plan.resource.started",
1286
1644
  fqn,
1287
1645
  logicalId: id,
1288
1646
  resourceType: resource.Type,
@@ -1486,11 +1844,16 @@ const makePlan = <A>(
1486
1844
  renamedFrom,
1487
1845
  adoptionBlocked: reusesMigratedFqn ? "migrated-fqn" : undefined,
1488
1846
  deferredAdoption:
1489
- node.action === "create" &&
1490
- provider.read &&
1847
+ (provider.read || provider.observe) &&
1491
1848
  !reusesMigratedFqn &&
1492
- ((oldState === undefined && !isResolved(news)) ||
1493
- (oldState?.status === "creating" && oldState.attr === undefined))
1849
+ // A replacement targets a new physical identity, which may belong
1850
+ // to someone else — admit it like a fresh create.
1851
+ (node.action === "replace" ||
1852
+ (node.action === "create" &&
1853
+ // Plan reads resolved props itself; without `read`, Apply
1854
+ // admits them through `observe`.
1855
+ ((oldState === undefined && (!isResolved(news) || !provider.read)) ||
1856
+ (oldState?.status === "creating" && oldState.attr === undefined))))
1494
1857
  ? { adopt: adoptThis }
1495
1858
  : undefined,
1496
1859
  }) as any as T;
@@ -1516,7 +1879,16 @@ const makePlan = <A>(
1516
1879
  // `output` is undefined (as it is here), so handing them
1517
1880
  // unresolved exprs crashes. Skip the probe — same behavior as
1518
1881
  // a read that found nothing — and re-drive the create.
1519
- if (provider.read && !reusesMigratedFqn && isResolved(oldState.props)) {
1882
+ //
1883
+ // A checkpoint whose unresolved props were stripped (`propsIncomplete`)
1884
+ // can't identify the attempt at all: a lookup could match a different
1885
+ // resource. Skip it too and let the diff below decide.
1886
+ if (
1887
+ provider.read &&
1888
+ !reusesMigratedFqn &&
1889
+ !oldState.propsIncomplete &&
1890
+ isResolved(oldState.props)
1891
+ ) {
1520
1892
  const attr = yield* provider
1521
1893
  .read({
1522
1894
  id,
@@ -1586,6 +1958,14 @@ const makePlan = <A>(
1586
1958
  // comparing props across runtimes is meaningless (and the new
1587
1959
  // mode's provider has never seen the old mode's state). The
1588
1960
  // action is a replacement by definition.
1961
+ // The props above hold what a cycle's members settle on, which a
1962
+ // member's own replacement can leave unresolved: the peers it reads
1963
+ // change because it does. A provider can't compare unresolved props, so
1964
+ // the replacement it asked for over its peers' first pass stands.
1965
+ const replace = combinedCycles.has(fqn)
1966
+ ? (yield* firstPass(Output.of(resource) as Output.ResourceExpr<any, any>)).replace
1967
+ : undefined;
1968
+
1589
1969
  const diff = modeSwitched
1590
1970
  ? ({
1591
1971
  action: "replace",
@@ -1650,6 +2030,7 @@ const makePlan = <A>(
1650
2030
  ? ({ action: "update" } satisfies UpdateDiff)
1651
2031
  : diff,
1652
2032
  ),
2033
+ Effect.map((diff) => (replace && diff.action !== "replace" ? replace : diff)),
1653
2034
  );
1654
2035
 
1655
2036
  if (oldState.status === "creating") {
@@ -1813,8 +2194,9 @@ const makePlan = <A>(
1813
2194
  // interrupt-only for any other reason) that can be a bare interruption,
1814
2195
  // hiding the InvalidReferenceError or provider error that actually
1815
2196
  // broke the plan.
1816
- const diffExits = yield* Effect.all(
1817
- resources.map((resource) => Effect.exit(Effect.tap(diffResource(resource), resourcePlanned))),
2197
+ const diffExits = yield* Effect.forEach(
2198
+ resources,
2199
+ (resource) => Effect.exit(Effect.tap(diffResource(resource), resourcePlanned)),
1818
2200
  { concurrency: "unbounded" },
1819
2201
  );
1820
2202
  const diffFailures = diffExits.filter(Exit.isFailure);
@@ -1886,7 +2268,7 @@ const makePlan = <A>(
1886
2268
  if (excluded && (bindingEvidence || incompleteHistory)) {
1887
2269
  return yield* Effect.die(
1888
2270
  new UnsafeSelectionBoundary({
1889
- message: `Cannot replace or collect old generations of '${fqn}' while '${excluded[0]}' is unselected. ${bindingEvidence ? `Historical binding-cycle dependencies recorded on '${bindingEvidence}'` : `Historical dependencies missing from '${incompleteHistory}'`} cannot be proven safe; run a full deployment.`,
2271
+ message: `Cannot replace or collect old generations of '${fqn}' while '${String(excluded[0])}' is unselected. ${bindingEvidence ? `Historical binding-cycle dependencies recorded on '${bindingEvidence}'` : `Historical dependencies missing from '${incompleteHistory}'`} cannot be proven safe; run a full deployment.`,
1890
2272
  }),
1891
2273
  );
1892
2274
  }
@@ -1910,7 +2292,7 @@ const makePlan = <A>(
1910
2292
  new UnsafeSelectionBoundary({
1911
2293
  message: `Cannot reconcile '${fqn}' with incomplete historical downstream metadata while persisted nodes are unselected: ${excludedRows
1912
2294
  .map(([id]) => id)
1913
- .sort()
2295
+ .sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))
1914
2296
  .join(", ")}. Select them or run a full deployment.`,
1915
2297
  }),
1916
2298
  );
@@ -1943,7 +2325,7 @@ const makePlan = <A>(
1943
2325
  new UnsafeSelectionBoundary({
1944
2326
  message: `Cannot discard the last historical binding evidence while persisted nodes are unselected: ${excludedRows
1945
2327
  .map(([fqn]) => fqn)
1946
- .sort()
2328
+ .sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))
1947
2329
  .join(", ")}. Select them or run a full deployment.`,
1948
2330
  }),
1949
2331
  );
@@ -1957,8 +2339,8 @@ const makePlan = <A>(
1957
2339
  const actionPlanned = (entry: readonly [string, ActionApply]) =>
1958
2340
  Ref.updateAndGet(actionCount, (count) => count + 1).pipe(
1959
2341
  Effect.flatMap((completed) =>
1960
- reportPlanned({
1961
- _tag: "plan.action.completed",
2342
+ emit({
2343
+ type: "plan.action.completed",
1962
2344
  ...describeAction(entry[1]),
1963
2345
  completed,
1964
2346
  total: actions.length,
@@ -1967,22 +2349,43 @@ const makePlan = <A>(
1967
2349
  );
1968
2350
 
1969
2351
  const actionGraph = Object.fromEntries(
1970
- (yield* Effect.all(
1971
- actions.map((action) =>
2352
+ (yield* Effect.forEach(
2353
+ actions,
2354
+ (action) =>
1972
2355
  diffAction(action).pipe(
1973
2356
  Effect.map((node) => [action.FQN, node] as const),
1974
2357
  Effect.tap(actionPlanned),
1975
2358
  ),
1976
- ),
1977
2359
  { concurrency: "unbounded" },
1978
2360
  )) as ReadonlyArray<readonly [string, ActionApply]>,
1979
2361
  ) as Plan["actions"];
1980
2362
 
1981
- // SCC membership of the combined upstream graph. Apply uses it to
1982
- // decide whether an update node must publish its prior attr early to
1983
- // break a cycle, or can simply wait for upstreams like a DAG node
1984
- // (the common case). Computed once, above, for the downstream graph.
1985
- const cycleMembers = combinedCycleMembers;
2363
+ // SCC membership of the graph Apply schedules. Apply uses it to decide
2364
+ // whether an update node must publish its prior attr early to break a
2365
+ // cycle, or can simply wait for upstreams like a DAG node (the common
2366
+ // case). The edges are the ones each node still carries — exactly what
2367
+ // Apply's `waitForDeps` waits on. A declared reference to an upstream's
2368
+ // stable attribute resolves to its value during planning and orders
2369
+ // nothing, so it cannot close a cycle: two updating Workers that bind
2370
+ // each other only by `workerName` are not a cycle, and a node that
2371
+ // still references a peer's changing attribute waits for it (#3103).
2372
+ const cycleMembers = findCycleMembers(
2373
+ Object.fromEntries([
2374
+ ...Object.entries(resourceGraph).map(([fqn, node]): [string, string[]] => [
2375
+ fqn,
2376
+ [
2377
+ ...new Set([
2378
+ ...Object.keys(Output.resolveUpstream("props" in node ? node.props : undefined)),
2379
+ ...Object.keys(Output.resolveUpstream(node.bindings)),
2380
+ ]),
2381
+ ].filter((dep) => newNodeFqns.has(dep)),
2382
+ ]),
2383
+ ...actions.map((action): [string, string[]] => [
2384
+ action.FQN,
2385
+ allUpstreamDependencies[action.FQN] ?? [],
2386
+ ]),
2387
+ ]),
2388
+ );
1986
2389
 
1987
2390
  // Detect unsatisfiable dependency cycles among create/replace nodes.
1988
2391
  // Update/noop nodes signal their Deferred before waitForDeps when in a
@@ -2036,6 +2439,37 @@ const makePlan = <A>(
2036
2439
  }
2037
2440
  }
2038
2441
 
2442
+ // A delete-first replacement in a cycle deletes its previous generation
2443
+ // before precreate. Apply resolves the props that upstreams outside the
2444
+ // cycle determine first, so only props derived from a cycle peer are
2445
+ // still unresolved then, and only the provider's `observe` can check
2446
+ // ownership before that delete. Without it, refuse here — before apply
2447
+ // touches anything — unless adoption is allowed.
2448
+ for (const [fqn, node] of Object.entries(resourceGraph)) {
2449
+ if (
2450
+ node.action === "replace" &&
2451
+ node.deleteFirst &&
2452
+ cycleMembers.has(fqn) &&
2453
+ !node.provider.observe &&
2454
+ node.deferredAdoption?.adopt === false &&
2455
+ !isResolved(node.props) &&
2456
+ Object.keys(Output.resolveUpstream(node.props)).some((dep) => cycleMembers.has(dep)) &&
2457
+ // A resumed replacement already holds its precreated identity.
2458
+ !(node.state.status === "replacing" && !node.restart && node.state.attr !== undefined)
2459
+ ) {
2460
+ return yield* new UnverifiableReplacement({
2461
+ message:
2462
+ `Cannot replace resource '${fqn}' (${node.resource.Type}): ` +
2463
+ "it must be deleted before its replacement is pre-created, but " +
2464
+ "the replacement's identity depends on outputs that are not " +
2465
+ "resolved yet, so its ownership cannot be checked first. Re-run " +
2466
+ "with `--adopt` (or wrap the effect in `adopt(true)`) to replace it anyway.",
2467
+ resourceType: node.resource.Type,
2468
+ logicalId: node.resource.LogicalId,
2469
+ });
2470
+ }
2471
+ }
2472
+
2039
2473
  // Both orphan passes (task rows below, resource rows further down)
2040
2474
  // examine every persisted row of this stack instance.
2041
2475
  const persistedFqns = selected ? [] : yield* state.list({ stack: stackName, stage });
@@ -2049,8 +2483,8 @@ const makePlan = <A>(
2049
2483
  Effect.flatMap((completed) =>
2050
2484
  entry === undefined
2051
2485
  ? Effect.void
2052
- : reportPlanned({
2053
- _tag: "plan.action.completed",
2486
+ : emit({
2487
+ type: "plan.action.completed",
2054
2488
  ...describeAction(entry[1]),
2055
2489
  completed,
2056
2490
  total: persistedFqns.length,
@@ -2093,12 +2527,12 @@ const makePlan = <A>(
2093
2527
  });
2094
2528
 
2095
2529
  const actionDeletions: Plan["actionDeletions"] = Object.fromEntries(
2096
- (yield* Effect.all(
2097
- persistedFqns.map((fqn) =>
2530
+ (yield* Effect.forEach(
2531
+ persistedFqns,
2532
+ (fqn) =>
2098
2533
  diffActionDeletion(fqn).pipe(
2099
2534
  Effect.tap((entry) => actionDeletionPlanned(entry ?? undefined)),
2100
2535
  ),
2101
- ),
2102
2536
  { concurrency: "unbounded" },
2103
2537
  )).filter((v): v is NonNullable<typeof v> => !!v),
2104
2538
  );
@@ -2113,8 +2547,8 @@ const makePlan = <A>(
2113
2547
  Effect.flatMap((completed) =>
2114
2548
  entry === undefined
2115
2549
  ? Effect.void
2116
- : reportPlanned({
2117
- _tag: "plan.resource.completed",
2550
+ : emit({
2551
+ type: "plan.resource.completed",
2118
2552
  ...describeResource(entry[1]),
2119
2553
  completed,
2120
2554
  total: deletionCandidates.length,
@@ -2200,6 +2634,7 @@ const makePlan = <A>(
2200
2634
  FormerFqns: undefined,
2201
2635
  RuntimeContext: undefined!,
2202
2636
  Providers: undefined,
2637
+ Lookup: undefined as never,
2203
2638
  } as ResourceLike,
2204
2639
  downstream: [...downstream],
2205
2640
  bindings: oldState.bindings.map((binding) => ({
@@ -2213,10 +2648,9 @@ const makePlan = <A>(
2213
2648
  });
2214
2649
 
2215
2650
  const deletions = Object.fromEntries(
2216
- (yield* Effect.all(
2217
- deletionCandidates.map((fqn) =>
2218
- diffDeletion(fqn).pipe(Effect.tap((entry) => deletionPlanned(entry ?? undefined))),
2219
- ),
2651
+ (yield* Effect.forEach(
2652
+ deletionCandidates,
2653
+ (fqn) => diffDeletion(fqn).pipe(Effect.tap((entry) => deletionPlanned(entry ?? undefined))),
2220
2654
  { concurrency: "unbounded" },
2221
2655
  )).filter((v) => !!v),
2222
2656
  );
@@ -2237,6 +2671,52 @@ const makePlan = <A>(
2237
2671
  }
2238
2672
  }
2239
2673
 
2674
+ // `RemovalPolicy.protect()`: refuse the whole plan, before anything is
2675
+ // applied, when it would start replacing or delete a protected resource. Both
2676
+ // the declaration and the persisted row count, so dropping `protect()`
2677
+ // in the same deploy as the replacement is refused too.
2678
+ yield* Effect.forEach(
2679
+ // An Action declared at a protected resource's FQN would overwrite its
2680
+ // row without ever planning a delete, abandoning the resource.
2681
+ persistedFqns.filter((fqn) => newActionFqns.has(fqn) && !newResourceFqns.has(fqn)),
2682
+ (fqn) =>
2683
+ state.get({ stack: stackName, stage, fqn }).pipe(Effect.map((row) => [fqn, row] as const)),
2684
+ { concurrency: "unbounded" },
2685
+ ).pipe(
2686
+ Effect.flatMap((takenOverByActions) => {
2687
+ const refused = [
2688
+ ...Object.entries(resourceGraph).flatMap(([fqn, node]) =>
2689
+ node.action === "replace" &&
2690
+ // Finishing a `replaced` row's drain only deletes an old generation
2691
+ // the dependents already left; the current one is untouched.
2692
+ !(node.state.status === "replaced" && !node.restart) &&
2693
+ (node.resource.RemovalPolicy === "protect" || node.state.removalPolicy === "protect")
2694
+ ? [{ fqn, action: "replace" as const }]
2695
+ : [],
2696
+ ),
2697
+ ...Object.entries(deletions).flatMap(([fqn, node]) =>
2698
+ node?.state.removalPolicy === "protect" ? [{ fqn, action: "delete" as const }] : [],
2699
+ ),
2700
+ ...takenOverByActions.flatMap(([fqn, row]) =>
2701
+ !isActionState(row) && (row as ResourceState | undefined)?.removalPolicy === "protect"
2702
+ ? [{ fqn, action: "delete" as const }]
2703
+ : [],
2704
+ ),
2705
+ ];
2706
+ return refused.length === 0
2707
+ ? Effect.void
2708
+ : Effect.fail(
2709
+ new ProtectedResource({
2710
+ message:
2711
+ `Refusing to ${refused.map((r) => `${r.action} '${r.fqn}'`).join(", ")}: ` +
2712
+ "protected by RemovalPolicy.protect(). Deploy it without protect() first " +
2713
+ "to replace or delete it deliberately.",
2714
+ resources: refused,
2715
+ }),
2716
+ );
2717
+ }),
2718
+ );
2719
+
2240
2720
  return {
2241
2721
  resources: resourceGraph,
2242
2722
  actions: actionGraph,