alchemy 2.0.0-beta.36 → 2.0.0-beta.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/exec.js +646 -104
- package/bin/exec.js.map +1 -1
- package/lib/AWS/AutoScaling/LaunchTemplate.d.ts +1 -1
- package/lib/AWS/CloudWatch/common.d.ts +1 -1
- package/lib/AWS/Credentials.d.ts.map +1 -1
- package/lib/AWS/Credentials.js +1 -2
- package/lib/AWS/Credentials.js.map +1 -1
- package/lib/AWS/DynamoDB/Stream.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/Stream.js +1 -1
- package/lib/AWS/DynamoDB/Stream.js.map +1 -1
- package/lib/AWS/EC2/Instance.d.ts +1 -1
- package/lib/AWS/EC2/hosted.d.ts +1 -1
- package/lib/AWS/EC2/hosted.d.ts.map +1 -1
- package/lib/AWS/EC2/hosted.js +3 -5
- package/lib/AWS/EC2/hosted.js.map +1 -1
- package/lib/AWS/ECS/Task.d.ts +1 -1
- package/lib/AWS/ECS/Task.d.ts.map +1 -1
- package/lib/AWS/ECS/Task.js +3 -5
- package/lib/AWS/ECS/Task.js.map +1 -1
- package/lib/AWS/Endpoint.d.ts.map +1 -1
- package/lib/AWS/Endpoint.js +1 -2
- package/lib/AWS/Endpoint.js.map +1 -1
- package/lib/AWS/Environment.d.ts +2 -2
- package/lib/AWS/EventBridge/EventSource.d.ts.map +1 -1
- package/lib/AWS/EventBridge/EventSource.js +1 -1
- package/lib/AWS/EventBridge/EventSource.js.map +1 -1
- package/lib/AWS/Kinesis/StreamEventSource.d.ts.map +1 -1
- package/lib/AWS/Kinesis/StreamEventSource.js +1 -1
- package/lib/AWS/Kinesis/StreamEventSource.js.map +1 -1
- package/lib/AWS/Lambda/BucketEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/EventBridgeEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/Function.d.ts +1 -1
- package/lib/AWS/Lambda/Function.d.ts.map +1 -1
- package/lib/AWS/Lambda/Function.js +29 -13
- package/lib/AWS/Lambda/Function.js.map +1 -1
- package/lib/AWS/Lambda/QueueEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/StreamEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/TableEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/TopicEventSource.d.ts +1 -1
- package/lib/AWS/Organizations/common.d.ts +1 -1
- package/lib/AWS/Providers.d.ts.map +1 -1
- package/lib/AWS/Providers.js +21 -3
- package/lib/AWS/Providers.js.map +1 -1
- package/lib/AWS/Region.d.ts +1 -1
- package/lib/AWS/Region.d.ts.map +1 -1
- package/lib/AWS/Region.js +2 -3
- package/lib/AWS/Region.js.map +1 -1
- package/lib/AWS/S3/Bucket.d.ts.map +1 -1
- package/lib/AWS/S3/Bucket.js +5 -2
- package/lib/AWS/S3/Bucket.js.map +1 -1
- package/lib/AWS/S3/BucketNotifications.d.ts.map +1 -1
- package/lib/AWS/S3/BucketNotifications.js +1 -1
- package/lib/AWS/S3/BucketNotifications.js.map +1 -1
- package/lib/AWS/SNS/TopicEventSource.d.ts.map +1 -1
- package/lib/AWS/SNS/TopicEventSource.js +1 -1
- package/lib/AWS/SNS/TopicEventSource.js.map +1 -1
- package/lib/AWS/SQS/Queue.d.ts.map +1 -1
- package/lib/AWS/SQS/Queue.js +23 -5
- package/lib/AWS/SQS/Queue.js.map +1 -1
- package/lib/Action.d.ts +77 -0
- package/lib/Action.d.ts.map +1 -0
- package/lib/Action.js +89 -0
- package/lib/Action.js.map +1 -0
- package/lib/AlchemyContext.d.ts +1 -1
- package/lib/Apply.d.ts.map +1 -1
- package/lib/Apply.js +228 -4
- package/lib/Apply.js.map +1 -1
- package/lib/Artifacts.d.ts +1 -1
- package/lib/Artifacts.d.ts.map +1 -1
- package/lib/Artifacts.js +1 -1
- package/lib/Artifacts.js.map +1 -1
- package/lib/Auth/AuthProvider.js +1 -1
- package/lib/Auth/AuthProvider.js.map +1 -1
- package/lib/Auth/Env.d.ts.map +1 -1
- package/lib/Auth/Env.js +4 -12
- package/lib/Auth/Env.js.map +1 -1
- package/lib/Binding.d.ts.map +1 -1
- package/lib/Binding.js +5 -5
- package/lib/Binding.js.map +1 -1
- package/lib/Build/Command.d.ts +1 -1
- package/lib/Build/Memo.d.ts +1 -1
- package/lib/Bundle/Docker.d.ts +3 -3
- package/lib/Bundle/Docker.js +1 -1
- package/lib/Bundle/Docker.js.map +1 -1
- package/lib/Bundle/TempRoot.d.ts +3 -3
- package/lib/Cli/Event.d.ts +1 -1
- package/lib/Cli/Event.d.ts.map +1 -1
- package/lib/Cli/NamespaceTree.d.ts +11 -5
- package/lib/Cli/NamespaceTree.d.ts.map +1 -1
- package/lib/Cli/NamespaceTree.js +28 -1
- package/lib/Cli/NamespaceTree.js.map +1 -1
- package/lib/Cli/commands/_shared.d.ts +1 -1
- package/lib/Cli/commands/_shared.js +2 -2
- package/lib/Cli/commands/_shared.js.map +1 -1
- package/lib/Cli/commands/aws.d.ts +1 -1
- package/lib/Cli/commands/cloudflare.d.ts +2 -2
- package/lib/Cli/commands/cloudflare.d.ts.map +1 -1
- package/lib/Cli/commands/deploy.d.ts +9 -9
- package/lib/Cli/commands/deploy.js +1 -1
- package/lib/Cli/commands/deploy.js.map +1 -1
- package/lib/Cli/commands/login.d.ts +1 -1
- package/lib/Cli/commands/logs.d.ts +1 -1
- package/lib/Cli/commands/logs.js.map +1 -1
- package/lib/Cli/commands/profile.d.ts +1 -3
- package/lib/Cli/commands/profile.d.ts.map +1 -1
- package/lib/Cli/commands/state.d.ts +1 -1
- package/lib/Cli/commands/state.d.ts.map +1 -1
- package/lib/Cli/commands/tail.d.ts +1 -1
- package/lib/Cli/commands/tail.js.map +1 -1
- package/lib/Cli/tui/components/Plan.d.ts.map +1 -1
- package/lib/Cli/tui/components/Plan.js +27 -13
- package/lib/Cli/tui/components/Plan.js.map +1 -1
- package/lib/Cli/tui/components/PlanProgress.d.ts +8 -1
- package/lib/Cli/tui/components/PlanProgress.d.ts.map +1 -1
- package/lib/Cli/tui/components/PlanProgress.js +95 -16
- package/lib/Cli/tui/components/PlanProgress.js.map +1 -1
- package/lib/Cloudflare/Access.js +0 -1
- package/lib/Cloudflare/Access.js.map +1 -1
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.d.ts +54 -0
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.d.ts.map +1 -0
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.js +17 -0
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.js.map +1 -0
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.d.ts +37 -0
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.d.ts.map +1 -0
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js +45 -0
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js.map +1 -0
- package/lib/Cloudflare/AnalyticsEngine/index.d.ts +3 -0
- package/lib/Cloudflare/AnalyticsEngine/index.d.ts.map +1 -0
- package/lib/Cloudflare/AnalyticsEngine/index.js +3 -0
- package/lib/Cloudflare/AnalyticsEngine/index.js.map +1 -0
- package/lib/Cloudflare/Artifacts/ArtifactsBinding.js +1 -1
- package/lib/Cloudflare/Artifacts/ArtifactsBinding.js.map +1 -1
- package/lib/Cloudflare/CloudflareEnvironment.d.ts +1 -1
- package/lib/Cloudflare/Container/Container.js +0 -1
- package/lib/Cloudflare/Container/Container.js.map +1 -1
- package/lib/Cloudflare/Container/ContainerApplication.d.ts +1 -1
- package/lib/Cloudflare/Container/ContainerApplication.d.ts.map +1 -1
- package/lib/Cloudflare/Container/ContainerApplication.js +4 -6
- package/lib/Cloudflare/Container/ContainerApplication.js.map +1 -1
- package/lib/Cloudflare/Container/ContainerBinding.js +2 -2
- package/lib/Cloudflare/Container/ContainerBinding.js.map +1 -1
- package/lib/Cloudflare/D1/D1Connection.d.ts +47 -3
- package/lib/Cloudflare/D1/D1Connection.d.ts.map +1 -1
- package/lib/Cloudflare/D1/D1Connection.js +62 -5
- package/lib/Cloudflare/D1/D1Connection.js.map +1 -1
- package/lib/Cloudflare/D1/D1Database.d.ts +1 -1
- package/lib/Cloudflare/D1/D1SqlFile.d.ts +2 -2
- package/lib/Cloudflare/Email/EmailAddress.d.ts +45 -0
- package/lib/Cloudflare/Email/EmailAddress.d.ts.map +1 -0
- package/lib/Cloudflare/Email/EmailAddress.js +99 -0
- package/lib/Cloudflare/Email/EmailAddress.js.map +1 -0
- package/lib/Cloudflare/Email/EmailRouting.d.ts +42 -0
- package/lib/Cloudflare/Email/EmailRouting.d.ts.map +1 -0
- package/lib/Cloudflare/Email/EmailRouting.js +89 -0
- package/lib/Cloudflare/Email/EmailRouting.js.map +1 -0
- package/lib/Cloudflare/Email/EmailRule.d.ts +80 -0
- package/lib/Cloudflare/Email/EmailRule.d.ts.map +1 -0
- package/lib/Cloudflare/Email/EmailRule.js +110 -0
- package/lib/Cloudflare/Email/EmailRule.js.map +1 -0
- package/lib/Cloudflare/Email/SendEmail.d.ts +74 -0
- package/lib/Cloudflare/Email/SendEmail.d.ts.map +1 -0
- package/lib/Cloudflare/Email/SendEmail.js +19 -0
- package/lib/Cloudflare/Email/SendEmail.js.map +1 -0
- package/lib/Cloudflare/Email/SendEmailBinding.d.ts +64 -0
- package/lib/Cloudflare/Email/SendEmailBinding.d.ts.map +1 -0
- package/lib/Cloudflare/Email/SendEmailBinding.js +54 -0
- package/lib/Cloudflare/Email/SendEmailBinding.js.map +1 -0
- package/lib/Cloudflare/Email/index.d.ts +6 -0
- package/lib/Cloudflare/Email/index.d.ts.map +1 -0
- package/lib/Cloudflare/Email/index.js +6 -0
- package/lib/Cloudflare/Email/index.js.map +1 -0
- package/lib/Cloudflare/Hyperdrive/Hyperdrive.d.ts +1 -1
- package/lib/Cloudflare/Images/ImagesBinding.js +1 -1
- package/lib/Cloudflare/Images/ImagesBinding.js.map +1 -1
- package/lib/Cloudflare/KV/KVNamespaceBinding.js +1 -1
- package/lib/Cloudflare/KV/KVNamespaceBinding.js.map +1 -1
- package/lib/Cloudflare/Local/Sidecar.d.ts +1 -1
- package/lib/Cloudflare/Local/SidecarHandlers.d.ts +1 -1
- package/lib/Cloudflare/Local/SidecarHandlers.js +9 -1
- package/lib/Cloudflare/Local/SidecarHandlers.js.map +1 -1
- package/lib/Cloudflare/Local/SidecarServer.js +1 -1
- package/lib/Cloudflare/Local/SidecarServer.js.map +1 -1
- package/lib/Cloudflare/Providers.d.ts.map +1 -1
- package/lib/Cloudflare/Providers.js +9 -1
- package/lib/Cloudflare/Providers.js.map +1 -1
- package/lib/Cloudflare/Queue/QueueBinding.js +1 -1
- package/lib/Cloudflare/Queue/QueueBinding.js.map +1 -1
- package/lib/Cloudflare/R2/R2Bucket.d.ts.map +1 -1
- package/lib/Cloudflare/R2/R2Bucket.js +16 -0
- package/lib/Cloudflare/R2/R2Bucket.js.map +1 -1
- package/lib/Cloudflare/R2/R2BucketBinding.js +1 -1
- package/lib/Cloudflare/R2/R2BucketBinding.js.map +1 -1
- package/lib/Cloudflare/SecretsStore/SecretBinding.js +1 -1
- package/lib/Cloudflare/SecretsStore/SecretBinding.js.map +1 -1
- package/lib/Cloudflare/StateStore/Api.d.ts +7 -2
- package/lib/Cloudflare/StateStore/Api.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/Api.js +23 -1
- package/lib/Cloudflare/StateStore/Api.js.map +1 -1
- package/lib/Cloudflare/StateStore/State.d.ts +2 -2
- package/lib/Cloudflare/StateStore/Store.d.ts +16 -1
- package/lib/Cloudflare/StateStore/Store.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/Store.js +22 -5
- package/lib/Cloudflare/StateStore/Store.js.map +1 -1
- package/lib/Cloudflare/Workers/Assets.d.ts +2 -2
- package/lib/Cloudflare/Workers/Assets.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Assets.js +5 -4
- package/lib/Cloudflare/Workers/Assets.js.map +1 -1
- package/lib/Cloudflare/Workers/CronEventSource.d.ts +35 -0
- package/lib/Cloudflare/Workers/CronEventSource.d.ts.map +1 -0
- package/lib/Cloudflare/Workers/CronEventSource.js +55 -0
- package/lib/Cloudflare/Workers/CronEventSource.js.map +1 -0
- package/lib/Cloudflare/Workers/InferEnv.d.ts +37 -2
- package/lib/Cloudflare/Workers/InferEnv.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js +2 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/Rpc.d.ts +76 -3
- package/lib/Cloudflare/Workers/Rpc.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Rpc.js +197 -13
- package/lib/Cloudflare/Workers/Rpc.js.map +1 -1
- package/lib/Cloudflare/Workers/Worker.d.ts +24 -4
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +187 -45
- package/lib/Cloudflare/Workers/Worker.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.js +19 -11
- package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerName.d.ts +1 -1
- package/lib/Cloudflare/Workers/Workflow.d.ts +50 -47
- package/lib/Cloudflare/Workers/Workflow.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Workflow.js +43 -37
- package/lib/Cloudflare/Workers/Workflow.js.map +1 -1
- package/lib/Cloudflare/Workers/index.d.ts +1 -0
- package/lib/Cloudflare/Workers/index.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/index.js +1 -0
- package/lib/Cloudflare/Workers/index.js.map +1 -1
- package/lib/Cloudflare/index.d.ts +2 -0
- package/lib/Cloudflare/index.d.ts.map +1 -1
- package/lib/Cloudflare/index.js +2 -0
- package/lib/Cloudflare/index.js.map +1 -1
- package/lib/Construct.d.ts +3 -3
- package/lib/Construct.d.ts.map +1 -1
- package/lib/Construct.js.map +1 -1
- package/lib/Deploy.d.ts +5 -2
- package/lib/Deploy.d.ts.map +1 -1
- package/lib/Deploy.js +2 -2
- package/lib/Deploy.js.map +1 -1
- package/lib/Destroy.d.ts +5 -2
- package/lib/Destroy.d.ts.map +1 -1
- package/lib/Destroy.js +3 -2
- package/lib/Destroy.js.map +1 -1
- package/lib/Drizzle/Providers.d.ts +1 -1
- package/lib/Drizzle/Schema.d.ts +1 -1
- package/lib/GitHub/Providers.d.ts +1 -1
- package/lib/Http.d.ts +1 -1
- package/lib/Http.d.ts.map +1 -1
- package/lib/Http.js +1 -1
- package/lib/Http.js.map +1 -1
- package/lib/Namespace.d.ts.map +1 -1
- package/lib/Namespace.js +3 -4
- package/lib/Namespace.js.map +1 -1
- package/lib/Neon/Branch.d.ts +2 -2
- package/lib/Neon/Branch.d.ts.map +1 -1
- package/lib/Neon/Branch.js +59 -27
- package/lib/Neon/Branch.js.map +1 -1
- package/lib/Neon/Credentials.d.ts +2 -2
- package/lib/Neon/Credentials.d.ts.map +1 -1
- package/lib/Neon/Credentials.js +2 -2
- package/lib/Neon/Credentials.js.map +1 -1
- package/lib/Neon/NeonEnvironment.d.ts +1 -1
- package/lib/Neon/Project.d.ts +25 -1
- package/lib/Neon/Project.d.ts.map +1 -1
- package/lib/Neon/Project.js +121 -42
- package/lib/Neon/Project.js.map +1 -1
- package/lib/Neon/Providers.d.ts +1 -1
- package/lib/Neon/SqlFile.d.ts +2 -2
- package/lib/Output.d.ts +47 -8
- package/lib/Output.d.ts.map +1 -1
- package/lib/Output.js +106 -7
- package/lib/Output.js.map +1 -1
- package/lib/PhysicalName.d.ts +1 -1
- package/lib/Plan.d.ts +36 -1
- package/lib/Plan.d.ts.map +1 -1
- package/lib/Plan.js +284 -37
- package/lib/Plan.js.map +1 -1
- package/lib/Platform.d.ts.map +1 -1
- package/lib/Platform.js +22 -9
- package/lib/Platform.js.map +1 -1
- package/lib/Provider.d.ts +1 -1
- package/lib/Provider.d.ts.map +1 -1
- package/lib/Provider.js +1 -1
- package/lib/Provider.js.map +1 -1
- package/lib/Random.d.ts +1 -1
- package/lib/Random.d.ts.map +1 -1
- package/lib/Random.js +1 -1
- package/lib/Random.js.map +1 -1
- package/lib/Ref.d.ts +4 -1
- package/lib/Ref.d.ts.map +1 -1
- package/lib/Ref.js +1 -1
- package/lib/Ref.js.map +1 -1
- package/lib/Resource.d.ts +8 -0
- package/lib/Resource.d.ts.map +1 -1
- package/lib/Resource.js +12 -25
- package/lib/Resource.js.map +1 -1
- package/lib/Runtime.d.ts +24 -0
- package/lib/Runtime.d.ts.map +1 -0
- package/lib/Runtime.js +31 -0
- package/lib/Runtime.js.map +1 -0
- package/lib/RuntimeContext.d.ts +3 -1
- package/lib/RuntimeContext.d.ts.map +1 -1
- package/lib/RuntimeContext.js.map +1 -1
- package/lib/Secret.d.ts +50 -0
- package/lib/Secret.d.ts.map +1 -0
- package/lib/Secret.js +23 -0
- package/lib/Secret.js.map +1 -0
- package/lib/Serverless/Function.d.ts +9 -1
- package/lib/Serverless/Function.d.ts.map +1 -1
- package/lib/Sidecar/RpcClient.d.ts +1 -1
- package/lib/Sidecar/RpcPaths.d.ts +1 -1
- package/lib/Sidecar/RpcServer.d.ts +1 -1
- package/lib/Sidecar/RpcServices.d.ts +1 -1
- package/lib/Stack.d.ts +20 -6
- package/lib/Stack.d.ts.map +1 -1
- package/lib/Stack.js +35 -23
- package/lib/Stack.js.map +1 -1
- package/lib/State/ActionState.d.ts +48 -0
- package/lib/State/ActionState.d.ts.map +1 -0
- package/lib/State/ActionState.js +1 -0
- package/lib/State/ActionState.js.map +1 -0
- package/lib/State/HttpStateApi.d.ts +15 -1
- package/lib/State/HttpStateApi.d.ts.map +1 -1
- package/lib/State/HttpStateApi.js +11 -0
- package/lib/State/HttpStateApi.js.map +1 -1
- package/lib/State/HttpStateStore.d.ts.map +1 -1
- package/lib/State/HttpStateStore.js +12 -1
- package/lib/State/HttpStateStore.js.map +1 -1
- package/lib/State/InMemoryState.d.ts +2 -2
- package/lib/State/InMemoryState.d.ts.map +1 -1
- package/lib/State/InMemoryState.js +12 -6
- package/lib/State/InMemoryState.js.map +1 -1
- package/lib/State/LocalState.d.ts +2 -2
- package/lib/State/LocalState.d.ts.map +1 -1
- package/lib/State/LocalState.js +11 -2
- package/lib/State/LocalState.js.map +1 -1
- package/lib/State/ResourceState.d.ts +5 -0
- package/lib/State/ResourceState.d.ts.map +1 -1
- package/lib/State/State.d.ts +31 -2
- package/lib/State/State.d.ts.map +1 -1
- package/lib/State/State.js +2 -0
- package/lib/State/State.js.map +1 -1
- package/lib/State/index.d.ts +1 -0
- package/lib/State/index.d.ts.map +1 -1
- package/lib/State/index.js +1 -0
- package/lib/State/index.js.map +1 -1
- package/lib/Test/Bun.d.ts.map +1 -1
- package/lib/Test/Bun.js +30 -7
- package/lib/Test/Bun.js.map +1 -1
- package/lib/Test/Core.d.ts +19 -4
- package/lib/Test/Core.d.ts.map +1 -1
- package/lib/Test/Core.js +33 -12
- package/lib/Test/Core.js.map +1 -1
- package/lib/Test/Vitest.d.ts.map +1 -1
- package/lib/Test/Vitest.js +24 -5
- package/lib/Test/Vitest.js.map +1 -1
- package/lib/Util/FileLogger.d.ts +1 -1
- package/lib/Util/LocalhostDns.d.ts +14 -10
- package/lib/Util/LocalhostDns.d.ts.map +1 -1
- package/lib/Util/LocalhostDns.js +27 -36
- package/lib/Util/LocalhostDns.js.map +1 -1
- package/lib/Util/effect.d.ts +7 -0
- package/lib/Util/effect.d.ts.map +1 -1
- package/lib/Util/effect.js +10 -4
- package/lib/Util/effect.js.map +1 -1
- package/lib/Util/exec.d.ts.map +1 -0
- package/lib/Util/exec.js.map +1 -0
- package/lib/Util/hash.d.ts +8 -0
- package/lib/Util/hash.d.ts.map +1 -0
- package/lib/Util/hash.js +11 -0
- package/lib/Util/hash.js.map +1 -0
- package/lib/Util/ignore.d.ts +40 -0
- package/lib/Util/ignore.d.ts.map +1 -0
- package/lib/Util/ignore.js +591 -0
- package/lib/Util/ignore.js.map +1 -0
- package/lib/Variable.d.ts +29 -0
- package/lib/Variable.d.ts.map +1 -0
- package/lib/Variable.js +9 -0
- package/lib/Variable.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +22 -29
- package/src/AWS/Credentials.ts +1 -2
- package/src/AWS/DynamoDB/Stream.ts +1 -4
- package/src/AWS/EC2/hosted.ts +14 -16
- package/src/AWS/ECS/Task.ts +14 -16
- package/src/AWS/Endpoint.ts +2 -5
- package/src/AWS/EventBridge/EventSource.ts +1 -4
- package/src/AWS/Kinesis/StreamEventSource.ts +1 -4
- package/src/AWS/Lambda/Function.ts +47 -23
- package/src/AWS/Providers.ts +22 -3
- package/src/AWS/Region.ts +2 -3
- package/src/AWS/S3/Bucket.ts +7 -2
- package/src/AWS/S3/BucketNotifications.ts +1 -4
- package/src/AWS/SNS/TopicEventSource.ts +1 -4
- package/src/AWS/SQS/Queue.ts +40 -6
- package/src/Action.ts +280 -0
- package/src/Apply.ts +359 -24
- package/src/Artifacts.ts +2 -4
- package/src/Auth/AuthProvider.ts +1 -1
- package/src/Auth/Env.ts +12 -20
- package/src/Binding.ts +5 -9
- package/src/Bundle/Docker.ts +1 -1
- package/src/Cli/Event.ts +4 -0
- package/src/Cli/NamespaceTree.ts +52 -5
- package/src/Cli/commands/_shared.ts +2 -2
- package/src/Cli/commands/deploy.ts +1 -1
- package/src/Cli/commands/logs.ts +4 -4
- package/src/Cli/commands/tail.ts +4 -4
- package/src/Cli/tui/components/Plan.tsx +65 -17
- package/src/Cli/tui/components/PlanProgress.tsx +142 -32
- package/src/Cloudflare/Access.ts +1 -1
- package/src/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.ts +82 -0
- package/src/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.ts +106 -0
- package/src/Cloudflare/AnalyticsEngine/index.ts +2 -0
- package/src/Cloudflare/Artifacts/ArtifactsBinding.ts +1 -1
- package/src/Cloudflare/Container/Container.ts +1 -1
- package/src/Cloudflare/Container/ContainerApplication.ts +4 -6
- package/src/Cloudflare/Container/ContainerBinding.ts +2 -2
- package/src/Cloudflare/D1/D1Connection.ts +95 -12
- package/src/Cloudflare/Email/EmailAddress.ts +155 -0
- package/src/Cloudflare/Email/EmailRouting.ts +138 -0
- package/src/Cloudflare/Email/EmailRule.ts +210 -0
- package/src/Cloudflare/Email/SendEmail.ts +95 -0
- package/src/Cloudflare/Email/SendEmailBinding.ts +124 -0
- package/src/Cloudflare/Email/index.ts +5 -0
- package/src/Cloudflare/Images/ImagesBinding.ts +1 -1
- package/src/Cloudflare/KV/KVNamespaceBinding.ts +1 -1
- package/src/Cloudflare/Local/SidecarHandlers.ts +9 -1
- package/src/Cloudflare/Local/SidecarServer.ts +1 -1
- package/src/Cloudflare/Providers.ts +14 -0
- package/src/Cloudflare/Queue/QueueBinding.ts +1 -1
- package/src/Cloudflare/R2/R2Bucket.ts +31 -0
- package/src/Cloudflare/R2/R2BucketBinding.ts +1 -1
- package/src/Cloudflare/SecretsStore/SecretBinding.ts +1 -1
- package/src/Cloudflare/StateStore/Api.ts +34 -1
- package/src/Cloudflare/StateStore/Store.ts +40 -10
- package/src/Cloudflare/Workers/Assets.ts +5 -6
- package/src/Cloudflare/Workers/CronEventSource.ts +89 -0
- package/src/Cloudflare/Workers/InferEnv.ts +94 -20
- package/src/Cloudflare/Workers/LocalWorkerProvider.ts +9 -1
- package/src/Cloudflare/Workers/Rpc.ts +227 -18
- package/src/Cloudflare/Workers/Worker.ts +294 -65
- package/src/Cloudflare/Workers/WorkerBundle.ts +19 -11
- package/src/Cloudflare/Workers/Workflow.ts +76 -72
- package/src/Cloudflare/Workers/index.ts +1 -0
- package/src/Cloudflare/index.ts +2 -0
- package/src/Construct.ts +3 -7
- package/src/Deploy.ts +5 -1
- package/src/Destroy.ts +6 -1
- package/src/Http.ts +1 -1
- package/src/Namespace.ts +4 -4
- package/src/Neon/Branch.ts +93 -59
- package/src/Neon/Credentials.ts +2 -2
- package/src/Neon/Project.ts +193 -64
- package/src/Output.ts +129 -18
- package/src/Plan.ts +375 -36
- package/src/Platform.ts +26 -11
- package/src/Provider.ts +8 -3
- package/src/Random.ts +1 -1
- package/src/Ref.ts +10 -5
- package/src/Resource.ts +24 -25
- package/src/Runtime.ts +38 -0
- package/src/RuntimeContext.ts +1 -0
- package/src/Secret.ts +87 -0
- package/src/Serverless/Function.ts +10 -1
- package/src/Stack.ts +62 -35
- package/src/State/ActionState.ts +51 -0
- package/src/State/HttpStateApi.ts +21 -0
- package/src/State/HttpStateStore.ts +27 -2
- package/src/State/InMemoryState.ts +31 -10
- package/src/State/LocalState.ts +28 -4
- package/src/State/ResourceState.ts +5 -0
- package/src/State/State.ts +38 -2
- package/src/State/index.ts +1 -0
- package/src/Test/Bun.ts +43 -7
- package/src/Test/Core.ts +33 -11
- package/src/Test/Vitest.ts +33 -4
- package/src/Util/LocalhostDns.ts +30 -36
- package/src/Util/effect.ts +29 -4
- package/src/Util/hash.ts +14 -0
- package/src/Util/ignore.ts +815 -0
- package/src/Variable.ts +44 -0
- package/src/index.ts +9 -0
- package/lib/Agent/Agent.d.ts +0 -9
- package/lib/Agent/Agent.d.ts.map +0 -1
- package/lib/Agent/Agent.js +0 -10
- package/lib/Agent/Agent.js.map +0 -1
- package/lib/Agent/Aspect.d.ts +0 -51
- package/lib/Agent/Aspect.d.ts.map +0 -1
- package/lib/Agent/Aspect.js +0 -45
- package/lib/Agent/Aspect.js.map +0 -1
- package/lib/Agent/AspectGraph.d.ts +0 -45
- package/lib/Agent/AspectGraph.d.ts.map +0 -1
- package/lib/Agent/AspectGraph.js +0 -39
- package/lib/Agent/AspectGraph.js.map +0 -1
- package/lib/Agent/ContextPlugin.d.ts +0 -8
- package/lib/Agent/ContextPlugin.d.ts.map +0 -1
- package/lib/Agent/ContextPlugin.js +0 -3
- package/lib/Agent/ContextPlugin.js.map +0 -1
- package/lib/Agent/Plugin.d.ts +0 -18
- package/lib/Agent/Plugin.d.ts.map +0 -1
- package/lib/Agent/Plugin.js +0 -8
- package/lib/Agent/Plugin.js.map +0 -1
- package/lib/Agent/chat/channel.d.ts +0 -9
- package/lib/Agent/chat/channel.d.ts.map +0 -1
- package/lib/Agent/chat/channel.js +0 -10
- package/lib/Agent/chat/channel.js.map +0 -1
- package/lib/Agent/chat/event.d.ts +0 -32
- package/lib/Agent/chat/event.d.ts.map +0 -1
- package/lib/Agent/chat/event.js +0 -32
- package/lib/Agent/chat/event.js.map +0 -1
- package/lib/Agent/chat/message.d.ts +0 -22
- package/lib/Agent/chat/message.d.ts.map +0 -1
- package/lib/Agent/chat/message.js +0 -31
- package/lib/Agent/chat/message.js.map +0 -1
- package/lib/Agent/chat/service.d.ts +0 -102
- package/lib/Agent/chat/service.d.ts.map +0 -1
- package/lib/Agent/chat/service.js +0 -79
- package/lib/Agent/chat/service.js.map +0 -1
- package/lib/Agent/chat/thread.d.ts +0 -13
- package/lib/Agent/chat/thread.d.ts.map +0 -1
- package/lib/Agent/chat/thread.js +0 -16
- package/lib/Agent/chat/thread.js.map +0 -1
- package/lib/Agent/coding/bash.d.ts +0 -36
- package/lib/Agent/coding/bash.d.ts.map +0 -1
- package/lib/Agent/coding/bash.js +0 -170
- package/lib/Agent/coding/bash.js.map +0 -1
- package/lib/Agent/coding/edit.d.ts +0 -31
- package/lib/Agent/coding/edit.d.ts.map +0 -1
- package/lib/Agent/coding/edit.js +0 -90
- package/lib/Agent/coding/edit.js.map +0 -1
- package/lib/Agent/coding/glob.d.ts +0 -23
- package/lib/Agent/coding/glob.d.ts.map +0 -1
- package/lib/Agent/coding/glob.js +0 -78
- package/lib/Agent/coding/glob.js.map +0 -1
- package/lib/Agent/coding/grep.d.ts +0 -26
- package/lib/Agent/coding/grep.d.ts.map +0 -1
- package/lib/Agent/coding/grep.js +0 -105
- package/lib/Agent/coding/grep.js.map +0 -1
- package/lib/Agent/coding/index.d.ts +0 -8
- package/lib/Agent/coding/index.d.ts.map +0 -1
- package/lib/Agent/coding/index.js +0 -8
- package/lib/Agent/coding/index.js.map +0 -1
- package/lib/Agent/coding/read.d.ts +0 -27
- package/lib/Agent/coding/read.d.ts.map +0 -1
- package/lib/Agent/coding/read.js +0 -89
- package/lib/Agent/coding/read.js.map +0 -1
- package/lib/Agent/coding/readlints.d.ts +0 -19
- package/lib/Agent/coding/readlints.d.ts.map +0 -1
- package/lib/Agent/coding/readlints.js +0 -53
- package/lib/Agent/coding/readlints.js.map +0 -1
- package/lib/Agent/coding/write.d.ts +0 -22
- package/lib/Agent/coding/write.d.ts.map +0 -1
- package/lib/Agent/coding/write.js +0 -53
- package/lib/Agent/coding/write.js.map +0 -1
- package/lib/Agent/fs/file.d.ts +0 -12
- package/lib/Agent/fs/file.d.ts.map +0 -1
- package/lib/Agent/fs/file.js +0 -8
- package/lib/Agent/fs/file.js.map +0 -1
- package/lib/Agent/fs/folder.d.ts +0 -5
- package/lib/Agent/fs/folder.d.ts.map +0 -1
- package/lib/Agent/fs/folder.js +0 -3
- package/lib/Agent/fs/folder.js.map +0 -1
- package/lib/Agent/index.d.ts +0 -9
- package/lib/Agent/index.d.ts.map +0 -1
- package/lib/Agent/index.js +0 -9
- package/lib/Agent/index.js.map +0 -1
- package/lib/Agent/llm/error.d.ts +0 -208
- package/lib/Agent/llm/error.d.ts.map +0 -1
- package/lib/Agent/llm/error.js +0 -209
- package/lib/Agent/llm/error.js.map +0 -1
- package/lib/Agent/llm/index.d.ts +0 -5
- package/lib/Agent/llm/index.d.ts.map +0 -1
- package/lib/Agent/llm/index.js +0 -5
- package/lib/Agent/llm/index.js.map +0 -1
- package/lib/Agent/llm/llm.d.ts +0 -32
- package/lib/Agent/llm/llm.d.ts.map +0 -1
- package/lib/Agent/llm/llm.js +0 -74
- package/lib/Agent/llm/llm.js.map +0 -1
- package/lib/Agent/llm/stream-collectors.d.ts +0 -46
- package/lib/Agent/llm/stream-collectors.d.ts.map +0 -1
- package/lib/Agent/llm/stream-collectors.js +0 -33
- package/lib/Agent/llm/stream-collectors.js.map +0 -1
- package/lib/Agent/llm/stream-text-part.d.ts +0 -5
- package/lib/Agent/llm/stream-text-part.d.ts.map +0 -1
- package/lib/Agent/llm/stream-text-part.js +0 -4
- package/lib/Agent/llm/stream-text-part.js.map +0 -1
- package/lib/Agent/lsp/client.d.ts +0 -122
- package/lib/Agent/lsp/client.d.ts.map +0 -1
- package/lib/Agent/lsp/client.js +0 -180
- package/lib/Agent/lsp/client.js.map +0 -1
- package/lib/Agent/lsp/diagnostics.d.ts +0 -16
- package/lib/Agent/lsp/diagnostics.d.ts.map +0 -1
- package/lib/Agent/lsp/diagnostics.js +0 -48
- package/lib/Agent/lsp/diagnostics.js.map +0 -1
- package/lib/Agent/lsp/jsonrpc.d.ts +0 -90
- package/lib/Agent/lsp/jsonrpc.d.ts.map +0 -1
- package/lib/Agent/lsp/jsonrpc.js +0 -178
- package/lib/Agent/lsp/jsonrpc.js.map +0 -1
- package/lib/Agent/lsp/manager.d.ts +0 -38
- package/lib/Agent/lsp/manager.d.ts.map +0 -1
- package/lib/Agent/lsp/manager.js +0 -98
- package/lib/Agent/lsp/manager.js.map +0 -1
- package/lib/Agent/lsp/servers.d.ts +0 -28
- package/lib/Agent/lsp/servers.d.ts.map +0 -1
- package/lib/Agent/lsp/servers.js +0 -21
- package/lib/Agent/lsp/servers.js.map +0 -1
- package/lib/Agent/process/driver.d.ts +0 -10
- package/lib/Agent/process/driver.d.ts.map +0 -1
- package/lib/Agent/process/driver.js +0 -153
- package/lib/Agent/process/driver.js.map +0 -1
- package/lib/Agent/process/issue-service.d.ts +0 -44
- package/lib/Agent/process/issue-service.d.ts.map +0 -1
- package/lib/Agent/process/issue-service.js +0 -28
- package/lib/Agent/process/issue-service.js.map +0 -1
- package/lib/Agent/process/issue-tools.d.ts +0 -28
- package/lib/Agent/process/issue-tools.d.ts.map +0 -1
- package/lib/Agent/process/issue-tools.js +0 -28
- package/lib/Agent/process/issue-tools.js.map +0 -1
- package/lib/Agent/process/issue.d.ts +0 -16
- package/lib/Agent/process/issue.d.ts.map +0 -1
- package/lib/Agent/process/issue.js +0 -17
- package/lib/Agent/process/issue.js.map +0 -1
- package/lib/Agent/process/organization.d.ts +0 -4
- package/lib/Agent/process/organization.d.ts.map +0 -1
- package/lib/Agent/process/organization.js +0 -3
- package/lib/Agent/process/organization.js.map +0 -1
- package/lib/Agent/process/process.d.ts +0 -5
- package/lib/Agent/process/process.d.ts.map +0 -1
- package/lib/Agent/process/process.js +0 -3
- package/lib/Agent/process/process.js.map +0 -1
- package/lib/Agent/process/reply.d.ts +0 -16
- package/lib/Agent/process/reply.d.ts.map +0 -1
- package/lib/Agent/process/reply.js +0 -18
- package/lib/Agent/process/reply.js.map +0 -1
- package/lib/Agent/process/task.d.ts +0 -25
- package/lib/Agent/process/task.d.ts.map +0 -1
- package/lib/Agent/process/task.js +0 -26
- package/lib/Agent/process/task.js.map +0 -1
- package/lib/Agent/tool/index.d.ts +0 -4
- package/lib/Agent/tool/index.d.ts.map +0 -1
- package/lib/Agent/tool/index.js +0 -4
- package/lib/Agent/tool/index.js.map +0 -1
- package/lib/Agent/tool/parameter.d.ts +0 -12
- package/lib/Agent/tool/parameter.d.ts.map +0 -1
- package/lib/Agent/tool/parameter.js +0 -6
- package/lib/Agent/tool/parameter.js.map +0 -1
- package/lib/Agent/tool/result.d.ts +0 -17
- package/lib/Agent/tool/result.d.ts.map +0 -1
- package/lib/Agent/tool/result.js +0 -6
- package/lib/Agent/tool/result.js.map +0 -1
- package/lib/Agent/tool/tool.d.ts +0 -32
- package/lib/Agent/tool/tool.d.ts.map +0 -1
- package/lib/Agent/tool/tool.js +0 -16
- package/lib/Agent/tool/tool.js.map +0 -1
- package/lib/Agent/util/command-validator.d.ts +0 -12
- package/lib/Agent/util/command-validator.d.ts.map +0 -1
- package/lib/Agent/util/command-validator.js +0 -74
- package/lib/Agent/util/command-validator.js.map +0 -1
- package/lib/Agent/util/exec.d.ts.map +0 -1
- package/lib/Agent/util/exec.js.map +0 -1
- package/lib/Agent/util/parser.d.ts +0 -5
- package/lib/Agent/util/parser.d.ts.map +0 -1
- package/lib/Agent/util/parser.js +0 -41
- package/lib/Agent/util/parser.js.map +0 -1
- package/lib/Agent/util/replace.d.ts +0 -38
- package/lib/Agent/util/replace.d.ts.map +0 -1
- package/lib/Agent/util/replace.js +0 -458
- package/lib/Agent/util/replace.js.map +0 -1
- package/lib/Agent/util/ripgrep.d.ts +0 -109
- package/lib/Agent/util/ripgrep.d.ts.map +0 -1
- package/lib/Agent/util/ripgrep.js +0 -221
- package/lib/Agent/util/ripgrep.js.map +0 -1
- package/lib/Neon/api.d.ts +0 -258
- package/lib/Neon/api.d.ts.map +0 -1
- package/lib/Neon/api.js +0 -215
- package/lib/Neon/api.js.map +0 -1
- package/src/Agent/Agent.ts +0 -26
- package/src/Agent/Aspect.ts +0 -173
- package/src/Agent/AspectGraph.ts +0 -98
- package/src/Agent/ContextPlugin.ts +0 -18
- package/src/Agent/Plugin.ts +0 -29
- package/src/Agent/chat/channel.ts +0 -26
- package/src/Agent/chat/event.ts +0 -43
- package/src/Agent/chat/message.ts +0 -35
- package/src/Agent/chat/service.ts +0 -133
- package/src/Agent/chat/thread.ts +0 -17
- package/src/Agent/coding/bash.ts +0 -197
- package/src/Agent/coding/edit.ts +0 -152
- package/src/Agent/coding/glob.ts +0 -96
- package/src/Agent/coding/grep.ts +0 -143
- package/src/Agent/coding/index.ts +0 -7
- package/src/Agent/coding/read.ts +0 -119
- package/src/Agent/coding/readlints.ts +0 -78
- package/src/Agent/coding/write.ts +0 -79
- package/src/Agent/fs/file.ts +0 -22
- package/src/Agent/fs/folder.ts +0 -16
- package/src/Agent/index.ts +0 -9
- package/src/Agent/llm/error.ts +0 -330
- package/src/Agent/llm/index.ts +0 -4
- package/src/Agent/llm/llm.ts +0 -131
- package/src/Agent/llm/stream-collectors.ts +0 -58
- package/src/Agent/llm/stream-text-part.ts +0 -7
- package/src/Agent/lsp/client.ts +0 -293
- package/src/Agent/lsp/diagnostics.ts +0 -64
- package/src/Agent/lsp/jsonrpc.ts +0 -317
- package/src/Agent/lsp/manager.ts +0 -213
- package/src/Agent/lsp/servers.ts +0 -37
- package/src/Agent/process/driver.ts +0 -168
- package/src/Agent/process/issue-service.ts +0 -48
- package/src/Agent/process/issue-tools.ts +0 -33
- package/src/Agent/process/issue.ts +0 -22
- package/src/Agent/process/organization.ts +0 -16
- package/src/Agent/process/process.ts +0 -16
- package/src/Agent/process/reply.ts +0 -21
- package/src/Agent/process/task.ts +0 -34
- package/src/Agent/tool/index.ts +0 -3
- package/src/Agent/tool/parameter.ts +0 -35
- package/src/Agent/tool/result.ts +0 -51
- package/src/Agent/tool/tool.ts +0 -74
- package/src/Agent/util/command-validator.ts +0 -98
- package/src/Agent/util/parser.ts +0 -39
- package/src/Agent/util/replace.ts +0 -559
- package/src/Agent/util/ripgrep.ts +0 -256
- package/src/Neon/api.ts +0 -579
- /package/lib/{Agent/util → Util}/exec.d.ts +0 -0
- /package/lib/{Agent/util → Util}/exec.js +0 -0
- /package/src/{Agent/util → Util}/exec.ts +0 -0
package/bin/exec.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
1
|
import * as ConfigProvider from "effect/ConfigProvider";
|
|
3
2
|
import * as Effect from "effect/Effect";
|
|
4
3
|
import * as Layer from "effect/Layer";
|
|
@@ -12,6 +11,8 @@ import * as Redacted from "effect/Redacted";
|
|
|
12
11
|
import path from "pathe";
|
|
13
12
|
import * as Config from "effect/Config";
|
|
14
13
|
import os from "node:os";
|
|
14
|
+
import * as dns from "node:dns";
|
|
15
|
+
import * as undici from "undici";
|
|
15
16
|
import * as Console from "effect/Console";
|
|
16
17
|
import * as Logger from "effect/Logger";
|
|
17
18
|
import * as Option from "effect/Option";
|
|
@@ -23,9 +24,11 @@ import * as Deferred from "effect/Deferred";
|
|
|
23
24
|
import { pipe } from "effect/Function";
|
|
24
25
|
import { SingleShotGen } from "effect/Utils";
|
|
25
26
|
import { pipeArguments } from "effect/Pipeable";
|
|
27
|
+
import "effect/Scope";
|
|
26
28
|
import * as Duration from "effect/Duration";
|
|
27
29
|
import * as Exit from "effect/Exit";
|
|
28
30
|
import * as Metric from "effect/Metric";
|
|
31
|
+
import { createHash } from "node:crypto";
|
|
29
32
|
import * as Argument from "effect/unstable/cli/Argument";
|
|
30
33
|
import * as CliError from "effect/unstable/cli/CliError";
|
|
31
34
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -152,22 +155,16 @@ const isLocalhost = (hostname) => hostname === "localhost" || hostname === "[::1
|
|
|
152
155
|
const installLocalhostDns = () => {
|
|
153
156
|
if (installed) return;
|
|
154
157
|
installed = true;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}]);
|
|
166
|
-
return cb(null, "127.0.0.1", 4);
|
|
167
|
-
}
|
|
168
|
-
return dns.lookup(hostname, options, cb);
|
|
169
|
-
} } }));
|
|
170
|
-
} catch {}
|
|
158
|
+
undici.setGlobalDispatcher(new undici.Agent({ connect: { lookup: (hostname, options, cb) => {
|
|
159
|
+
if (isLocalhost(hostname)) {
|
|
160
|
+
if (options && options.all) return cb(null, [{
|
|
161
|
+
address: "127.0.0.1",
|
|
162
|
+
family: 4
|
|
163
|
+
}]);
|
|
164
|
+
return cb(null, "127.0.0.1", 4);
|
|
165
|
+
}
|
|
166
|
+
return dns.lookup(hostname, options, cb);
|
|
167
|
+
} } }));
|
|
171
168
|
};
|
|
172
169
|
|
|
173
170
|
//#endregion
|
|
@@ -358,18 +355,7 @@ var Cli = class extends EffectContext.Service()("CLI") {};
|
|
|
358
355
|
//#region lib/Ref.js
|
|
359
356
|
const RefMetadata = Symbol.for("alchemy/RefMetadata");
|
|
360
357
|
const isRef = (s) => s && s[RefMetadata] !== void 0;
|
|
361
|
-
const getRefMetadata = (ref
|
|
362
|
-
const ref = ({ stack, id, stage: stage$1 }) => {
|
|
363
|
-
const ref$1 = new Proxy({}, { get: (_, prop) => {
|
|
364
|
-
if (prop === RefMetadata) return {
|
|
365
|
-
stack,
|
|
366
|
-
stage: stage$1,
|
|
367
|
-
id
|
|
368
|
-
};
|
|
369
|
-
return of(ref$1)[prop];
|
|
370
|
-
} });
|
|
371
|
-
return ref$1;
|
|
372
|
-
};
|
|
358
|
+
const getRefMetadata = (ref) => ref[RefMetadata];
|
|
373
359
|
|
|
374
360
|
//#endregion
|
|
375
361
|
//#region lib/FQN.js
|
|
@@ -479,11 +465,22 @@ const loadConfigProvider = (envFile$1) => {
|
|
|
479
465
|
|
|
480
466
|
//#endregion
|
|
481
467
|
//#region lib/Util/effect.js
|
|
468
|
+
const effectClass = ((impl) => impl === void 0 ? (innerImpl) => effectClass(innerImpl) : Object.assign(class {
|
|
469
|
+
static asEffect() {
|
|
470
|
+
return impl;
|
|
471
|
+
}
|
|
472
|
+
static [Symbol.iterator]() {
|
|
473
|
+
return new SingleShotGen(this.asEffect());
|
|
474
|
+
}
|
|
475
|
+
static pipe(...fns) {
|
|
476
|
+
return pipeArguments(this, fns);
|
|
477
|
+
}
|
|
478
|
+
}, impl));
|
|
482
479
|
const taggedFunction = (tag$1, fn) => {
|
|
483
480
|
const overrides = {
|
|
484
|
-
asEffect: () => tag$1
|
|
481
|
+
asEffect: () => tag$1,
|
|
485
482
|
[Symbol.iterator]: () => tag$1[Symbol.iterator](),
|
|
486
|
-
pipe: (...fns) => pipeArguments(tag$1
|
|
483
|
+
pipe: (...fns) => pipeArguments(tag$1, fns),
|
|
487
484
|
toString: () => `${tag$1.toString()}.${fn.name}`
|
|
488
485
|
};
|
|
489
486
|
return new Proxy(fn, {
|
|
@@ -505,34 +502,38 @@ const fileLogger = Effect.fnUntraced(function* (...segments) {
|
|
|
505
502
|
|
|
506
503
|
//#endregion
|
|
507
504
|
//#region lib/Stack.js
|
|
508
|
-
const Stack = Object.assign(taggedFunction(EffectContext.Service()("Stack"), (stackName, options, eff) =>
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
505
|
+
const Stack = Object.assign(taggedFunction(EffectContext.Service()("Stack"), (stackName, options, eff) => {
|
|
506
|
+
if (!stackName) return (stackName$1) => Object.assign(stackRef(stackName$1).pipe(effectClass), {
|
|
507
|
+
stage: createStageProxy(stackName$1),
|
|
508
|
+
make: (options$1, eff$1) => Stack(stackName$1, options$1, eff$1)
|
|
509
|
+
});
|
|
510
|
+
return eff.pipe(make$1({
|
|
511
|
+
name: stackName,
|
|
512
|
+
...options
|
|
513
|
+
}), (eff$1) => Object.assign(eff$1, { stage: createStageProxy(stackName) }));
|
|
514
|
+
}));
|
|
515
|
+
const createStageProxy = (stackName) => new Proxy({}, { get: (_, stage$1) => stackRef(stackName, { stage: stage$1 }) });
|
|
516
516
|
const StackName = Stack.use((stack) => Effect.succeed(stack.name));
|
|
517
517
|
const make$1 = (options) => (effect) => Effect.scope.pipe(Effect.flatMap((scope) => {
|
|
518
518
|
if (options.state == null) return Effect.die(/* @__PURE__ */ new Error(`Stack "${options.name}" is missing a state store. Add a \`state\` layer to the stack options, e.g.:\n Alchemy.Stack("${options.name}", {\n providers: Cloudflare.providers(),\n state: Cloudflare.state(), // <-- required\n }, ...)\nSee https://v2.alchemy.run/concepts/state-store for available state stores.`));
|
|
519
519
|
if (options.providers == null) return Effect.die(/* @__PURE__ */ new Error(`Stack "${options.name}" is missing a providers layer. Add a \`providers\` layer to the stack options, e.g.:\n Alchemy.Stack("${options.name}", {\n providers: Cloudflare.providers(), // <-- required\n state: Cloudflare.state(),\n }, ...)`));
|
|
520
|
-
return options.providers.pipe(Layer.provideMerge(options.state), Layer.provideMerge(Layer.effect(Stack, Stage.
|
|
520
|
+
return options.providers.pipe(Layer.provideMerge(options.state), Layer.provideMerge(Layer.effect(Stack, Stage.pipe(Effect.map((stage$1) => options.stack ?? {
|
|
521
521
|
name: options.name,
|
|
522
522
|
stage: stage$1,
|
|
523
523
|
resources: {},
|
|
524
|
-
bindings: {}
|
|
524
|
+
bindings: {},
|
|
525
|
+
actions: {}
|
|
525
526
|
})))), Layer.buildWithScope(scope));
|
|
526
527
|
}), Effect.flatMap((context) => Effect.all([
|
|
527
528
|
effect,
|
|
528
|
-
Stack
|
|
529
|
+
Stack,
|
|
529
530
|
Effect.context()
|
|
530
531
|
]).pipe(Effect.map(([output, stack, services$1]) => ({
|
|
531
532
|
...stack,
|
|
532
533
|
output,
|
|
533
534
|
services: EffectContext.merge(services$1, context)
|
|
534
535
|
})), Effect.provideContext(context))));
|
|
535
|
-
const CurrentStack = Effect.serviceOption(Stack).
|
|
536
|
+
const CurrentStack = Effect.serviceOption(Stack).pipe(Effect.map(Option.getOrUndefined));
|
|
536
537
|
const platform = Layer.mergeAll(PlatformServices, FetchHttpClient.layer, Logger.layer([fileLogger("out")], { mergeWithExisting: true }), Layer.provide(ProfileLive, PlatformServices), Layer.provide(CredentialsStoreLive, PlatformServices));
|
|
537
538
|
|
|
538
539
|
//#endregion
|
|
@@ -553,6 +554,7 @@ const CurrentRuntimeContext = Effect.serviceOption(RuntimeContext).pipe(Effect.m
|
|
|
553
554
|
|
|
554
555
|
//#endregion
|
|
555
556
|
//#region lib/State/State.js
|
|
557
|
+
const isActionState = (s) => !!s && s.kind === "action";
|
|
556
558
|
var State = class extends EffectContext.Service()("alchemy/State") {};
|
|
557
559
|
|
|
558
560
|
//#endregion
|
|
@@ -578,13 +580,13 @@ var BaseExpr = class {
|
|
|
578
580
|
return this;
|
|
579
581
|
}
|
|
580
582
|
[Symbol.iterator]() {
|
|
581
|
-
return new SingleShotGen(this);
|
|
583
|
+
return new SingleShotGen(this.asEffect());
|
|
582
584
|
}
|
|
583
585
|
asEffect() {
|
|
584
586
|
return this.bind(this.toString());
|
|
585
587
|
}
|
|
586
588
|
bind(id) {
|
|
587
|
-
return RuntimeContext.
|
|
589
|
+
return RuntimeContext.pipe(Effect.flatMap((ctx) => Effect.map(ctx.set(id, this), (key) => ctx.get(key))));
|
|
588
590
|
}
|
|
589
591
|
pipe(...fns) {
|
|
590
592
|
return pipe(this, ...fns);
|
|
@@ -667,6 +669,28 @@ var EffectExpr = class extends BaseExpr {
|
|
|
667
669
|
return `${this.expr[inspect]()}.mapEffect(${this.f.toString()})`;
|
|
668
670
|
}
|
|
669
671
|
};
|
|
672
|
+
const isNamedExpr = (node) => node?.kind === "NamedExpr";
|
|
673
|
+
/**
|
|
674
|
+
* Wraps another `Expr` and overrides its `toString()` / inspect output.
|
|
675
|
+
*
|
|
676
|
+
* `BaseExpr` derives the binding id from `this.toString()`, so
|
|
677
|
+
* wrapping an expression in `NamedExpr` makes that derived id stable and
|
|
678
|
+
* caller-controlled (e.g. an env var name like `"API_KEY"`).
|
|
679
|
+
*/
|
|
680
|
+
var NamedExpr = class extends BaseExpr {
|
|
681
|
+
expr;
|
|
682
|
+
bindingName;
|
|
683
|
+
kind = "NamedExpr";
|
|
684
|
+
constructor(expr, bindingName) {
|
|
685
|
+
super();
|
|
686
|
+
this.expr = expr;
|
|
687
|
+
this.bindingName = bindingName;
|
|
688
|
+
return proxy(this);
|
|
689
|
+
}
|
|
690
|
+
[inspect]() {
|
|
691
|
+
return this.bindingName;
|
|
692
|
+
}
|
|
693
|
+
};
|
|
670
694
|
const isAllExpr = (node) => node?.kind === "AllExpr";
|
|
671
695
|
var AllExpr = class extends BaseExpr {
|
|
672
696
|
outs;
|
|
@@ -697,6 +721,39 @@ var RefExpr = class extends BaseExpr {
|
|
|
697
721
|
return `ref(${this.resourceId}, { stack: ${this.stack}, stage: ${this.stage} })`;
|
|
698
722
|
}
|
|
699
723
|
};
|
|
724
|
+
const isStackRefExpr = (node) => node?.kind === "StackRefExpr";
|
|
725
|
+
/**
|
|
726
|
+
* A reference to the persisted output of a Stack at `(stack, stage)`.
|
|
727
|
+
*
|
|
728
|
+
* Resolved at evaluation time by reading `state.getOutput({ stack,
|
|
729
|
+
* stage })`. Distinct from {@link RefExpr}, which references a
|
|
730
|
+
* single resource's attributes within a stack/stage. `stage` may be
|
|
731
|
+
* `undefined`, in which case it falls back to the current stage.
|
|
732
|
+
*/
|
|
733
|
+
var StackRefExpr = class extends BaseExpr {
|
|
734
|
+
stack;
|
|
735
|
+
stage;
|
|
736
|
+
kind = "StackRefExpr";
|
|
737
|
+
constructor(stack, stage$1) {
|
|
738
|
+
super();
|
|
739
|
+
this.stack = stack;
|
|
740
|
+
this.stage = stage$1;
|
|
741
|
+
return proxy(this);
|
|
742
|
+
}
|
|
743
|
+
[inspect]() {
|
|
744
|
+
return `stackRef(${this.stack}${this.stage ? `, { stage: ${this.stage} }` : ""})`;
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
/**
|
|
748
|
+
* Build an `Output<A>` referencing the persisted output of another
|
|
749
|
+
* Stack. The returned Effect resolves to a lazy `Output<A>` whose
|
|
750
|
+
* value is read from the state store at plan/apply time.
|
|
751
|
+
*
|
|
752
|
+
* Returns `Effect<Output<A>>` (not `Output<A>` directly) so that
|
|
753
|
+
* `yield* Output.stackRef(...)` reads ergonomically inside an Effect
|
|
754
|
+
* generator and lines up with `Resource.ref` and `Stack.stage.<name>`.
|
|
755
|
+
*/
|
|
756
|
+
const stackRef = (stack, options = {}) => Effect.succeed(new StackRefExpr(stack, options.stage));
|
|
700
757
|
function proxy(self) {
|
|
701
758
|
const target = Object.assign(() => {}, self);
|
|
702
759
|
if (inspect in self) Object.defineProperty(target, inspect, {
|
|
@@ -705,7 +762,9 @@ function proxy(self) {
|
|
|
705
762
|
});
|
|
706
763
|
const proxy$1 = new Proxy(target, {
|
|
707
764
|
has: (_, prop) => prop === ExprSymbol || prop === inspect ? true : prop in self,
|
|
708
|
-
get: (target$1, prop) => prop === Symbol.toPrimitive ? (hint) =>
|
|
765
|
+
get: (target$1, prop) => prop === Symbol.toPrimitive ? (hint) => {
|
|
766
|
+
throw new Error(`Cannot coerce Output<${self[inspect]()}> to a ${hint === "number" ? "number" : "string"} via JS coercion. Use Output.interpolate\`...\` or Output.map(output, fn) to compose Outputs — the value isn't known until deploy time.`);
|
|
767
|
+
} : prop === ExprSymbol ? self : prop === inspect ? target$1[inspect] : isResourceExpr(self) && self.stables && prop in self.stables ? self.stables[prop] : prop === "apply" ? self[prop] : prop in self ? typeof self[prop] === "function" && !("kind" in self) ? new PropExpr(proxy$1, prop) : self[prop] : new PropExpr(proxy$1, prop),
|
|
709
768
|
apply: (_, thisArg, args) => {
|
|
710
769
|
if (isPropExpr(self)) {
|
|
711
770
|
if (self.identifier === "apply") return new ApplyExpr(self.expr, args[0]);
|
|
@@ -740,6 +799,7 @@ const evaluate = (expr, upstream$1) => Effect.gen(function* () {
|
|
|
740
799
|
else if (isEffectExpr(expr)) return yield* expr.f(yield* evaluate(expr.expr, upstream$1));
|
|
741
800
|
else if (isAllExpr(expr)) return yield* Effect.all(expr.outs.map((out) => evaluate(out, upstream$1)));
|
|
742
801
|
else if (isPropExpr(expr)) return (yield* evaluate(expr.expr, upstream$1))?.[expr.identifier];
|
|
802
|
+
else if (isNamedExpr(expr)) return yield* evaluate(expr.expr, upstream$1);
|
|
743
803
|
else if (isRefExpr(expr)) {
|
|
744
804
|
const state = yield* State;
|
|
745
805
|
const stack = expr.stack ?? (yield* Stack).name;
|
|
@@ -755,7 +815,22 @@ const evaluate = (expr, upstream$1) => Effect.gen(function* () {
|
|
|
755
815
|
stage: stage$1,
|
|
756
816
|
resourceId: expr.resourceId
|
|
757
817
|
}));
|
|
758
|
-
return resource.attr;
|
|
818
|
+
return resource.attr ?? resource.output;
|
|
819
|
+
} else if (isStackRefExpr(expr)) {
|
|
820
|
+
const state = yield* State;
|
|
821
|
+
const stack = expr.stack;
|
|
822
|
+
const stage$1 = expr.stage ?? (yield* Stage);
|
|
823
|
+
const output = yield* state.getOutput({
|
|
824
|
+
stack,
|
|
825
|
+
stage: stage$1
|
|
826
|
+
});
|
|
827
|
+
if (output == null) return yield* Effect.fail(new InvalidReferenceError({
|
|
828
|
+
message: `Reference to stack '${stack}' at stage '${stage$1}' not found. Have you deployed stage '${stage$1}' of '${stack}'?`,
|
|
829
|
+
stack,
|
|
830
|
+
stage: stage$1,
|
|
831
|
+
resourceId: stack
|
|
832
|
+
}));
|
|
833
|
+
return output;
|
|
759
834
|
}
|
|
760
835
|
}
|
|
761
836
|
if (Array.isArray(expr)) return yield* Effect.all(expr.map((item) => evaluate(item, upstream$1)));
|
|
@@ -776,7 +851,7 @@ const upstream = (expr) => {
|
|
|
776
851
|
else if (isResourceExpr(expr)) return { [expr.src.FQN]: expr.src };
|
|
777
852
|
else if (isPropExpr(expr)) return upstream(expr.expr);
|
|
778
853
|
else if (isAllExpr(expr)) return Object.assign({}, ...expr.outs.map((out) => upstream(out)));
|
|
779
|
-
else if (isEffectExpr(expr) || isApplyExpr(expr)) return upstream(expr.expr);
|
|
854
|
+
else if (isEffectExpr(expr) || isApplyExpr(expr) || isNamedExpr(expr)) return upstream(expr.expr);
|
|
780
855
|
else if (Array.isArray(expr)) return expr.map(upstream).reduce(toObject, {});
|
|
781
856
|
else if (typeof expr === "object" && expr !== null) return Object.values(expr).map((v) => upstream(v)).reduce(toObject, {});
|
|
782
857
|
return {};
|
|
@@ -922,6 +997,19 @@ const recordOutcome = (baseAttrs, status, duration) => {
|
|
|
922
997
|
return Effect.all([Metric.update(Metric.withAttributes(resourceCounter, attrs), 1), Metric.update(Metric.withAttributes(resourceDuration, attrs), duration)], { discard: true });
|
|
923
998
|
};
|
|
924
999
|
|
|
1000
|
+
//#endregion
|
|
1001
|
+
//#region lib/Action.js
|
|
1002
|
+
const isAction = (value) => typeof value === "object" && value !== null && value?.Kind === "action";
|
|
1003
|
+
|
|
1004
|
+
//#endregion
|
|
1005
|
+
//#region lib/Util/hash.js
|
|
1006
|
+
/**
|
|
1007
|
+
* Stable hash of a resolved Task input. Wrapped in `Effect.sync` so the
|
|
1008
|
+
* call participates in the Effect runtime (tracing/interruption) per the
|
|
1009
|
+
* Effect-platform conventions.
|
|
1010
|
+
*/
|
|
1011
|
+
const hashInput = (input) => Effect.sync(() => createHash("sha256").update(JSON.stringify(input ?? null)).digest("hex"));
|
|
1012
|
+
|
|
925
1013
|
//#endregion
|
|
926
1014
|
//#region lib/Util/scc.js
|
|
927
1015
|
/**
|
|
@@ -1000,6 +1088,7 @@ const findCycleMembers = (edges) => {
|
|
|
1000
1088
|
const make = (stack, options = {}) => Effect.gen(function* () {
|
|
1001
1089
|
const state = yield* State;
|
|
1002
1090
|
const resources = Object.values(stack.resources);
|
|
1091
|
+
const actions = Object.values(stack.actions ?? {});
|
|
1003
1092
|
const stackName = stack.name;
|
|
1004
1093
|
const stage$1 = stack.stage;
|
|
1005
1094
|
const shouldAdopt = Effect.gen(function* () {
|
|
@@ -1022,15 +1111,17 @@ const make = (stack, options = {}) => Effect.gen(function* () {
|
|
|
1022
1111
|
})), { concurrency: "unbounded" });
|
|
1023
1112
|
const resolvedResources = {};
|
|
1024
1113
|
const resolveResource = (resourceExpr) => Effect.gen(function* () {
|
|
1114
|
+
if (isAction(resourceExpr.src)) return resourceExpr;
|
|
1025
1115
|
return yield* resolvedResources[resourceExpr.src.FQN] ??= yield* Effect.cached(Effect.gen(function* () {
|
|
1026
1116
|
const resource = resourceExpr.src;
|
|
1027
1117
|
const provider = yield* findProviderByType(resource.Type);
|
|
1028
1118
|
const props = yield* resolveInput(resource.Props);
|
|
1029
|
-
const
|
|
1119
|
+
const persisted = yield* state.get({
|
|
1030
1120
|
stack: stackName,
|
|
1031
1121
|
stage: stage$1,
|
|
1032
1122
|
fqn: resource.FQN
|
|
1033
1123
|
});
|
|
1124
|
+
const oldState = isActionState(persisted) ? void 0 : persisted;
|
|
1034
1125
|
if (!oldState || oldState.status === "creating") return resourceExpr;
|
|
1035
1126
|
const oldProps = oldState.status === "updating" ? oldState.old.props : oldState.props;
|
|
1036
1127
|
const oldBindings = oldState.bindings ?? [];
|
|
@@ -1074,23 +1165,76 @@ const make = (stack, options = {}) => Effect.gen(function* () {
|
|
|
1074
1165
|
return hasOutputs(upstream$1) ? expr : yield* expr.f(upstream$1);
|
|
1075
1166
|
} else if (isAllExpr(expr)) return yield* Effect.all(expr.outs.map(resolveOutput), { concurrency: "unbounded" });
|
|
1076
1167
|
else if (isLiteralExpr(expr)) return expr.value;
|
|
1077
|
-
|
|
1168
|
+
else if (isRefExpr(expr)) {
|
|
1169
|
+
const refStack = expr.stack ?? stackName;
|
|
1170
|
+
const refStage = expr.stage ?? stage$1;
|
|
1171
|
+
const refState = yield* state.get({
|
|
1172
|
+
stack: refStack,
|
|
1173
|
+
stage: refStage,
|
|
1174
|
+
fqn: expr.resourceId
|
|
1175
|
+
}).pipe(Effect.orDie);
|
|
1176
|
+
if (!refState) return yield* Effect.die(new InvalidReferenceError({
|
|
1177
|
+
message: `Reference to '${expr.resourceId}' in stack '${refStack}' and stage '${refStage}' not found. Have you deployed '${refStage}' of '${refStack}'?`,
|
|
1178
|
+
stack: refStack,
|
|
1179
|
+
stage: refStage,
|
|
1180
|
+
resourceId: expr.resourceId
|
|
1181
|
+
}));
|
|
1182
|
+
return refState.attr ?? refState.output;
|
|
1183
|
+
} else if (isStackRefExpr(expr)) {
|
|
1184
|
+
const refStack = expr.stack;
|
|
1185
|
+
const refStage = expr.stage ?? stage$1;
|
|
1186
|
+
const output = yield* state.getOutput({
|
|
1187
|
+
stack: refStack,
|
|
1188
|
+
stage: refStage
|
|
1189
|
+
}).pipe(Effect.orDie);
|
|
1190
|
+
if (output == null) return yield* Effect.die(new InvalidReferenceError({
|
|
1191
|
+
message: `Reference to stack '${refStack}' at stage '${refStage}' not found. Have you deployed stage '${refStage}' of '${refStack}'?`,
|
|
1192
|
+
stack: refStack,
|
|
1193
|
+
stage: refStage,
|
|
1194
|
+
resourceId: refStack
|
|
1195
|
+
}));
|
|
1196
|
+
return output;
|
|
1197
|
+
} else if (isNamedExpr(expr)) return yield* resolveOutput(expr.expr);
|
|
1198
|
+
return yield* Effect.die(/* @__PURE__ */ new Error("Not implemented yet" + expr.kind));
|
|
1078
1199
|
});
|
|
1079
1200
|
const oldDownstreamDependencies = Object.fromEntries(oldResources.filter((resource) => !!resource).map((resource) => [resource.fqn, resource.downstream]));
|
|
1080
1201
|
const newResourceFqns = new Set(resources.map((r) => r.FQN));
|
|
1081
|
-
const
|
|
1202
|
+
const newActionFqns = new Set(actions.map((t) => t.FQN));
|
|
1203
|
+
const newNodeFqns = new Set([...newResourceFqns, ...newActionFqns]);
|
|
1204
|
+
const newUpstreamDependencies = Object.fromEntries([...resources.map((resource) => [resource.FQN, Object.values(upstreamAny(resource.Props)).map((r) => r.FQN)]), ...actions.map((action) => [action.FQN, Object.values(upstreamAny(action.Input)).map((r) => r.FQN)])]);
|
|
1082
1205
|
const bindingUpstreamDependencies = Object.fromEntries(resources.map((resource) => [resource.FQN, Object.values(upstreamAny(stack.bindings[resource.FQN] ?? [])).map((r) => r.FQN)]));
|
|
1083
|
-
const rawUpstreamDependencies = Object.fromEntries(resources.map((resource) => {
|
|
1206
|
+
const rawUpstreamDependencies = Object.fromEntries([...resources.map((resource) => {
|
|
1084
1207
|
const fqn = resource.FQN;
|
|
1085
1208
|
const propDeps = newUpstreamDependencies[fqn] ?? [];
|
|
1086
1209
|
const bindDeps = bindingUpstreamDependencies[fqn] ?? [];
|
|
1087
1210
|
return [fqn, [...new Set([...propDeps, ...bindDeps])]];
|
|
1088
|
-
}))
|
|
1089
|
-
|
|
1211
|
+
}), ...actions.map((action) => {
|
|
1212
|
+
const fqn = action.FQN;
|
|
1213
|
+
return [fqn, newUpstreamDependencies[fqn] ?? []];
|
|
1214
|
+
})]);
|
|
1215
|
+
const allUpstreamDependencies = Object.fromEntries([...resources.map((resource) => {
|
|
1090
1216
|
const fqn = resource.FQN;
|
|
1091
|
-
return [fqn, (rawUpstreamDependencies[fqn] ?? []).filter((dep) =>
|
|
1092
|
-
}))
|
|
1093
|
-
|
|
1217
|
+
return [fqn, (rawUpstreamDependencies[fqn] ?? []).filter((dep) => newNodeFqns.has(dep))];
|
|
1218
|
+
}), ...actions.map((action) => {
|
|
1219
|
+
const fqn = action.FQN;
|
|
1220
|
+
return [fqn, (newUpstreamDependencies[fqn] ?? []).filter((dep) => newNodeFqns.has(dep))];
|
|
1221
|
+
})]);
|
|
1222
|
+
const combinedCycleMembers = findCycleMembers(allUpstreamDependencies);
|
|
1223
|
+
const computeDownstream = (upFqn) => {
|
|
1224
|
+
const downstream = [];
|
|
1225
|
+
for (const [downFqn, upstreams] of Object.entries(rawUpstreamDependencies)) {
|
|
1226
|
+
if (downFqn === upFqn) continue;
|
|
1227
|
+
if (!upstreams.includes(upFqn)) continue;
|
|
1228
|
+
if ((newUpstreamDependencies[downFqn] ?? []).includes(upFqn)) {
|
|
1229
|
+
downstream.push(downFqn);
|
|
1230
|
+
continue;
|
|
1231
|
+
}
|
|
1232
|
+
if (combinedCycleMembers.has(upFqn) && combinedCycleMembers.has(downFqn)) continue;
|
|
1233
|
+
downstream.push(downFqn);
|
|
1234
|
+
}
|
|
1235
|
+
return downstream;
|
|
1236
|
+
};
|
|
1237
|
+
const newDownstreamDependencies = Object.fromEntries([...resources.map((resource) => [resource.FQN, computeDownstream(resource.FQN)]), ...actions.map((action) => [action.FQN, computeDownstream(action.FQN)])]);
|
|
1094
1238
|
const resourceGraph = Object.fromEntries((yield* Effect.all(resources.map(Effect.fn("plan.diff.resource")(function* (resource) {
|
|
1095
1239
|
const provider = yield* findProviderByType(resource.Type);
|
|
1096
1240
|
const id = resource.LogicalId;
|
|
@@ -1098,11 +1242,12 @@ const make = (stack, options = {}) => Effect.gen(function* () {
|
|
|
1098
1242
|
const news = yield* resolveInput(resource.Props);
|
|
1099
1243
|
const downstream = newDownstreamDependencies[fqn] ?? [];
|
|
1100
1244
|
const newBindings = yield* resolveInput(stack.bindings[fqn] ?? []);
|
|
1101
|
-
|
|
1245
|
+
const persisted = yield* state.get({
|
|
1102
1246
|
stack: stackName,
|
|
1103
1247
|
stage: stage$1,
|
|
1104
1248
|
fqn
|
|
1105
1249
|
});
|
|
1250
|
+
let oldState = isActionState(persisted) ? void 0 : persisted;
|
|
1106
1251
|
let forceUpdateAfterAdoption = false;
|
|
1107
1252
|
if (oldState === void 0 && provider.read && isResolved(news)) {
|
|
1108
1253
|
const adoptInstanceId = yield* generateInstanceId();
|
|
@@ -1273,7 +1418,43 @@ const make = (stack, options = {}) => Effect.gen(function* () {
|
|
|
1273
1418
|
state: oldState
|
|
1274
1419
|
});
|
|
1275
1420
|
})), { concurrency: "unbounded" })).map((update) => [update.resource.FQN, update]));
|
|
1276
|
-
const
|
|
1421
|
+
const actionGraph = Object.fromEntries(yield* Effect.all(actions.map(Effect.fn("plan.diff.action")(function* (action) {
|
|
1422
|
+
const fqn = action.FQN;
|
|
1423
|
+
const downstream = newDownstreamDependencies[fqn] ?? [];
|
|
1424
|
+
const inputHash = yield* hashInput(yield* resolveInput(action.Input));
|
|
1425
|
+
const oldState = yield* state.get({
|
|
1426
|
+
stack: stackName,
|
|
1427
|
+
stage: stage$1,
|
|
1428
|
+
fqn
|
|
1429
|
+
});
|
|
1430
|
+
if (oldState && !isActionState(oldState)) return [fqn, {
|
|
1431
|
+
kind: "action",
|
|
1432
|
+
action: "run",
|
|
1433
|
+
def: action,
|
|
1434
|
+
input: action.Input,
|
|
1435
|
+
state: void 0,
|
|
1436
|
+
downstream,
|
|
1437
|
+
forced: false
|
|
1438
|
+
}];
|
|
1439
|
+
const prior = oldState;
|
|
1440
|
+
if (prior?.status === "ran" && prior.inputHash === inputHash && !options.force) return [fqn, {
|
|
1441
|
+
kind: "action",
|
|
1442
|
+
action: "noop",
|
|
1443
|
+
def: action,
|
|
1444
|
+
state: prior,
|
|
1445
|
+
downstream
|
|
1446
|
+
}];
|
|
1447
|
+
return [fqn, {
|
|
1448
|
+
kind: "action",
|
|
1449
|
+
action: "run",
|
|
1450
|
+
def: action,
|
|
1451
|
+
input: action.Input,
|
|
1452
|
+
state: prior,
|
|
1453
|
+
downstream,
|
|
1454
|
+
forced: !!options.force
|
|
1455
|
+
}];
|
|
1456
|
+
})), { concurrency: "unbounded" }));
|
|
1457
|
+
const cycleMembers = combinedCycleMembers;
|
|
1277
1458
|
{
|
|
1278
1459
|
const createReplaceNodes = new Set(Object.entries(resourceGraph).filter(([_, node]) => node.action === "create" || node.action === "replace").map(([fqn]) => fqn));
|
|
1279
1460
|
if (createReplaceNodes.size > 0) {
|
|
@@ -1301,16 +1482,47 @@ const make = (stack, options = {}) => Effect.gen(function* () {
|
|
|
1301
1482
|
}
|
|
1302
1483
|
}
|
|
1303
1484
|
}
|
|
1485
|
+
const actionDeletions = Object.fromEntries((yield* Effect.all((yield* state.list({
|
|
1486
|
+
stack: stackName,
|
|
1487
|
+
stage: stage$1
|
|
1488
|
+
})).map(Effect.fn("plan.diff.actionDeletion")(function* (fqn) {
|
|
1489
|
+
if (newActionFqns.has(fqn) || newResourceFqns.has(fqn)) return;
|
|
1490
|
+
const persisted = yield* state.get({
|
|
1491
|
+
stack: stackName,
|
|
1492
|
+
stage: stage$1,
|
|
1493
|
+
fqn
|
|
1494
|
+
});
|
|
1495
|
+
if (!isActionState(persisted)) return;
|
|
1496
|
+
const { logicalId } = parseFqn(fqn);
|
|
1497
|
+
return [fqn, {
|
|
1498
|
+
kind: "action",
|
|
1499
|
+
action: "delete",
|
|
1500
|
+
state: persisted,
|
|
1501
|
+
downstream: persisted.downstream ?? [],
|
|
1502
|
+
def: {
|
|
1503
|
+
Kind: "action",
|
|
1504
|
+
Namespace: persisted.namespace,
|
|
1505
|
+
FQN: fqn,
|
|
1506
|
+
LogicalId: logicalId,
|
|
1507
|
+
Type: persisted.actionType,
|
|
1508
|
+
Input: persisted.input,
|
|
1509
|
+
Run: () => void 0,
|
|
1510
|
+
Output: void 0
|
|
1511
|
+
}
|
|
1512
|
+
}];
|
|
1513
|
+
})), { concurrency: "unbounded" })).filter((v) => !!v));
|
|
1304
1514
|
const deletions = Object.fromEntries((yield* Effect.all((yield* state.list({
|
|
1305
1515
|
stack: stackName,
|
|
1306
1516
|
stage: stage$1
|
|
1307
1517
|
})).map(Effect.fn("plan.diff.deletion")(function* (fqn) {
|
|
1308
|
-
if (newResourceFqns.has(fqn)) return;
|
|
1309
|
-
const
|
|
1518
|
+
if (newResourceFqns.has(fqn) || newActionFqns.has(fqn)) return;
|
|
1519
|
+
const persisted = yield* state.get({
|
|
1310
1520
|
stack: stackName,
|
|
1311
1521
|
stage: stage$1,
|
|
1312
1522
|
fqn
|
|
1313
1523
|
});
|
|
1524
|
+
if (isActionState(persisted)) return;
|
|
1525
|
+
const oldState = persisted;
|
|
1314
1526
|
let attr = oldState?.attr;
|
|
1315
1527
|
if (oldState) {
|
|
1316
1528
|
const { logicalId } = parseFqn(fqn);
|
|
@@ -1363,7 +1575,9 @@ const make = (stack, options = {}) => Effect.gen(function* () {
|
|
|
1363
1575
|
}
|
|
1364
1576
|
return {
|
|
1365
1577
|
resources: resourceGraph,
|
|
1578
|
+
actions: actionGraph,
|
|
1366
1579
|
deletions,
|
|
1580
|
+
actionDeletions,
|
|
1367
1581
|
output: stack.output,
|
|
1368
1582
|
cycleMembers
|
|
1369
1583
|
};
|
|
@@ -1417,20 +1631,32 @@ const apply = (plan) => Effect.gen(function* () {
|
|
|
1417
1631
|
yield* session.done();
|
|
1418
1632
|
if (!plan.output) return;
|
|
1419
1633
|
const outputs = Object.fromEntries(Object.entries(tracker).map(([fqn, t]) => [fqn, t.output]));
|
|
1420
|
-
|
|
1634
|
+
const resolved = yield* evaluate(plan.output, outputs);
|
|
1635
|
+
yield* state.setOutput({
|
|
1636
|
+
stack: stackName,
|
|
1637
|
+
stage: stage$1,
|
|
1638
|
+
value: resolved
|
|
1639
|
+
});
|
|
1640
|
+
return resolved;
|
|
1421
1641
|
}).pipe(ensureArtifactStore, Effect.withSpan("apply", { attributes: {
|
|
1422
1642
|
"alchemy.resources.count": Object.keys(plan.resources).length,
|
|
1423
1643
|
"alchemy.deletions.count": Object.keys(plan.deletions).length
|
|
1424
1644
|
} }));
|
|
1425
1645
|
const executePlan = Effect.fnUntraced(function* (plan, tracker, terminalStatuses, session, state, stackName, stage$1) {
|
|
1426
|
-
const
|
|
1646
|
+
const allNodes = {
|
|
1647
|
+
...plan.resources,
|
|
1648
|
+
...plan.actions
|
|
1649
|
+
};
|
|
1650
|
+
const ready = Object.fromEntries(yield* Effect.all(Object.keys(allNodes).map((fqn) => Effect.map(Deferred.make(), (d) => [fqn, d]))));
|
|
1651
|
+
const readyStable = Object.fromEntries(yield* Effect.all(Object.keys(allNodes).map((fqn) => Effect.map(Deferred.make(), (d) => [fqn, d]))));
|
|
1427
1652
|
const getOutputs = () => Object.fromEntries(Object.entries(tracker).map(([fqn, t]) => [fqn, t.output]));
|
|
1428
1653
|
const waitForDeps = (fqns) => Effect.all(fqns.filter((fqn) => fqn in ready).map((fqn) => Deferred.await(ready[fqn])), { concurrency: "unbounded" });
|
|
1654
|
+
const waitForStableDeps = (fqns) => Effect.all(fqns.filter((fqn) => fqn in readyStable).map((fqn) => Deferred.await(readyStable[fqn])), { concurrency: "unbounded" });
|
|
1429
1655
|
const failures = [];
|
|
1430
|
-
yield* Effect.all(Object.entries(
|
|
1656
|
+
yield* Effect.all(Object.entries(allNodes).map(([fqn, node]) => node.kind === "action" ? executeActionNode(fqn, node, tracker, ready, readyStable, terminalStatuses, session, state, stackName, stage$1, getOutputs, waitForStableDeps, failures) : executeNode(fqn, node, tracker, ready, readyStable, terminalStatuses, session, state, stackName, stage$1, getOutputs, waitForDeps, failures, plan.cycleMembers.has(fqn))), { concurrency: "unbounded" });
|
|
1431
1657
|
if (failures.length > 0) yield* Effect.failCause(failures.map((f) => f.cause).reduce(Cause.combine));
|
|
1432
1658
|
});
|
|
1433
|
-
const executeNode = (fqn, node, tracker, ready, terminalStatuses, session, state, stackName, stage$1, getOutputs, waitForDeps, failures, inCycle) => Effect.gen(function* () {
|
|
1659
|
+
const executeNode = (fqn, node, tracker, ready, readyStable, terminalStatuses, session, state, stackName, stage$1, getOutputs, waitForDeps, failures, inCycle) => Effect.gen(function* () {
|
|
1434
1660
|
const logicalId = node.resource.LogicalId;
|
|
1435
1661
|
const namespace = node.resource.Namespace;
|
|
1436
1662
|
const commit = (value) => state.set({
|
|
@@ -1464,11 +1690,13 @@ const executeNode = (fqn, node, tracker, ready, terminalStatuses, session, state
|
|
|
1464
1690
|
});
|
|
1465
1691
|
});
|
|
1466
1692
|
const signalReady = Deferred.succeed(ready[fqn], void 0);
|
|
1693
|
+
const signalReadyStable = Deferred.succeed(readyStable[fqn], void 0);
|
|
1467
1694
|
const storeAndSignal = (t) => Effect.gen(function* () {
|
|
1468
1695
|
tracker[fqn] = t;
|
|
1469
1696
|
yield* signalReady;
|
|
1470
1697
|
});
|
|
1471
1698
|
if (node.action === "noop") {
|
|
1699
|
+
yield* signalReadyStable;
|
|
1472
1700
|
yield* storeAndSignal({
|
|
1473
1701
|
output: node.state.attr,
|
|
1474
1702
|
props: node.state.props,
|
|
@@ -1604,6 +1832,7 @@ const executeNode = (fqn, node, tracker, ready, terminalStatuses, session, state
|
|
|
1604
1832
|
instanceId
|
|
1605
1833
|
};
|
|
1606
1834
|
yield* signalReady;
|
|
1835
|
+
yield* signalReadyStable;
|
|
1607
1836
|
yield* markTerminal("created");
|
|
1608
1837
|
return;
|
|
1609
1838
|
}
|
|
@@ -1672,6 +1901,7 @@ const executeNode = (fqn, node, tracker, ready, terminalStatuses, session, state
|
|
|
1672
1901
|
instanceId
|
|
1673
1902
|
};
|
|
1674
1903
|
yield* signalReady;
|
|
1904
|
+
yield* signalReadyStable;
|
|
1675
1905
|
yield* markTerminal("updated");
|
|
1676
1906
|
return;
|
|
1677
1907
|
}
|
|
@@ -1684,6 +1914,7 @@ const executeNode = (fqn, node, tracker, ready, terminalStatuses, session, state
|
|
|
1684
1914
|
instanceId
|
|
1685
1915
|
};
|
|
1686
1916
|
yield* signalReady;
|
|
1917
|
+
yield* signalReadyStable;
|
|
1687
1918
|
yield* markTerminal("created");
|
|
1688
1919
|
return;
|
|
1689
1920
|
}
|
|
@@ -1778,6 +2009,7 @@ const executeNode = (fqn, node, tracker, ready, terminalStatuses, session, state
|
|
|
1778
2009
|
instanceId
|
|
1779
2010
|
};
|
|
1780
2011
|
yield* signalReady;
|
|
2012
|
+
yield* signalReadyStable;
|
|
1781
2013
|
yield* markTerminal("created");
|
|
1782
2014
|
return;
|
|
1783
2015
|
}
|
|
@@ -1791,6 +2023,7 @@ const executeNode = (fqn, node, tracker, ready, terminalStatuses, session, state
|
|
|
1791
2023
|
cause
|
|
1792
2024
|
});
|
|
1793
2025
|
yield* Deferred.failCause(ready[fqn], cause);
|
|
2026
|
+
yield* Deferred.failCause(readyStable[fqn], cause);
|
|
1794
2027
|
yield* session.emit({
|
|
1795
2028
|
kind: "status-change",
|
|
1796
2029
|
id: node.resource.LogicalId,
|
|
@@ -1803,6 +2036,104 @@ const executeNode = (fqn, node, tracker, ready, terminalStatuses, session, state
|
|
|
1803
2036
|
"alchemy.resource.logical_id": node.resource.LogicalId,
|
|
1804
2037
|
"alchemy.resource.action": node.action
|
|
1805
2038
|
} }));
|
|
2039
|
+
const executeActionNode = (fqn, node, tracker, ready, readyStable, terminalStatuses, session, state, stackName, stage$1, getOutputs, waitForDeps, failures) => Effect.gen(function* () {
|
|
2040
|
+
const task = node.def;
|
|
2041
|
+
const logicalId = task.LogicalId;
|
|
2042
|
+
const namespace = task.Namespace;
|
|
2043
|
+
const commit = (value) => state.set({
|
|
2044
|
+
stack: stackName,
|
|
2045
|
+
stage: stage$1,
|
|
2046
|
+
fqn,
|
|
2047
|
+
value: {
|
|
2048
|
+
...value,
|
|
2049
|
+
namespace
|
|
2050
|
+
}
|
|
2051
|
+
});
|
|
2052
|
+
const report = (status) => session.emit({
|
|
2053
|
+
kind: "status-change",
|
|
2054
|
+
id: logicalId,
|
|
2055
|
+
type: task.Type,
|
|
2056
|
+
status
|
|
2057
|
+
});
|
|
2058
|
+
const signalReady = Deferred.succeed(ready[fqn], void 0);
|
|
2059
|
+
const signalReadyStable = Deferred.succeed(readyStable[fqn], void 0);
|
|
2060
|
+
if (node.action === "noop") {
|
|
2061
|
+
tracker[fqn] = {
|
|
2062
|
+
output: node.state.output,
|
|
2063
|
+
props: { __input: node.state.input },
|
|
2064
|
+
bindings: [],
|
|
2065
|
+
instanceId: fqn
|
|
2066
|
+
};
|
|
2067
|
+
yield* signalReady;
|
|
2068
|
+
yield* signalReadyStable;
|
|
2069
|
+
terminalStatuses.set(fqn, {
|
|
2070
|
+
id: logicalId,
|
|
2071
|
+
type: task.Type,
|
|
2072
|
+
status: "skipped"
|
|
2073
|
+
});
|
|
2074
|
+
return;
|
|
2075
|
+
}
|
|
2076
|
+
yield* waitForDeps(Object.keys(resolveUpstream(node.input)).filter((f) => f in readyStable));
|
|
2077
|
+
const outputs = getOutputs();
|
|
2078
|
+
const resolvedInput = yield* evaluate(node.input, outputs);
|
|
2079
|
+
const inputHashValue = yield* hashInput(resolvedInput);
|
|
2080
|
+
yield* commit({
|
|
2081
|
+
kind: "action",
|
|
2082
|
+
status: "running",
|
|
2083
|
+
fqn,
|
|
2084
|
+
logicalId,
|
|
2085
|
+
actionType: task.Type,
|
|
2086
|
+
inputHash: inputHashValue,
|
|
2087
|
+
input: resolvedInput,
|
|
2088
|
+
downstream: node.downstream
|
|
2089
|
+
});
|
|
2090
|
+
yield* report("running");
|
|
2091
|
+
const result = yield* task.Run(resolvedInput);
|
|
2092
|
+
yield* commit({
|
|
2093
|
+
kind: "action",
|
|
2094
|
+
status: "ran",
|
|
2095
|
+
fqn,
|
|
2096
|
+
logicalId,
|
|
2097
|
+
actionType: task.Type,
|
|
2098
|
+
inputHash: inputHashValue,
|
|
2099
|
+
input: resolvedInput,
|
|
2100
|
+
output: result,
|
|
2101
|
+
downstream: node.downstream
|
|
2102
|
+
});
|
|
2103
|
+
tracker[fqn] = {
|
|
2104
|
+
output: result,
|
|
2105
|
+
props: { __input: resolvedInput },
|
|
2106
|
+
bindings: [],
|
|
2107
|
+
instanceId: fqn
|
|
2108
|
+
};
|
|
2109
|
+
yield* signalReady;
|
|
2110
|
+
yield* signalReadyStable;
|
|
2111
|
+
terminalStatuses.set(fqn, {
|
|
2112
|
+
id: logicalId,
|
|
2113
|
+
type: task.Type,
|
|
2114
|
+
status: "ran"
|
|
2115
|
+
});
|
|
2116
|
+
}).pipe(Effect.catchCause((cause) => Effect.gen(function* () {
|
|
2117
|
+
failures.push({
|
|
2118
|
+
fqn,
|
|
2119
|
+
logicalId: node.def.LogicalId,
|
|
2120
|
+
type: node.def.Type,
|
|
2121
|
+
cause
|
|
2122
|
+
});
|
|
2123
|
+
yield* Deferred.failCause(ready[fqn], cause);
|
|
2124
|
+
yield* Deferred.failCause(readyStable[fqn], cause);
|
|
2125
|
+
yield* session.emit({
|
|
2126
|
+
kind: "status-change",
|
|
2127
|
+
id: node.def.LogicalId,
|
|
2128
|
+
type: node.def.Type,
|
|
2129
|
+
status: "fail"
|
|
2130
|
+
});
|
|
2131
|
+
})), Effect.withSpan("apply.action", { attributes: {
|
|
2132
|
+
"alchemy.action.fqn": fqn,
|
|
2133
|
+
"alchemy.action.type": node.def.Type,
|
|
2134
|
+
"alchemy.action.logical_id": node.def.LogicalId,
|
|
2135
|
+
"alchemy.action.verb": node.action
|
|
2136
|
+
} }));
|
|
1806
2137
|
const converge = Effect.fnUntraced(function* (plan, tracker, terminalStatuses, session, state, stackName, stage$1) {
|
|
1807
2138
|
for (;;) {
|
|
1808
2139
|
let anyUpdated = false;
|
|
@@ -1869,6 +2200,61 @@ const converge = Effect.fnUntraced(function* (plan, tracker, terminalStatuses, s
|
|
|
1869
2200
|
status: "updated"
|
|
1870
2201
|
});
|
|
1871
2202
|
}
|
|
2203
|
+
for (const [fqn, node] of Object.entries(plan.actions)) {
|
|
2204
|
+
if (node.action !== "run") continue;
|
|
2205
|
+
if (!tracker[fqn]) continue;
|
|
2206
|
+
const outputs = Object.fromEntries(Object.entries(tracker).map(([k, t]) => [k, t.output]));
|
|
2207
|
+
const newInput = yield* evaluate(node.input, outputs);
|
|
2208
|
+
const newHash = yield* hashInput(newInput);
|
|
2209
|
+
const oldInput = tracker[fqn].props?.__input;
|
|
2210
|
+
if (newHash === (yield* hashInput(oldInput))) continue;
|
|
2211
|
+
anyUpdated = true;
|
|
2212
|
+
yield* state.set({
|
|
2213
|
+
stack: stackName,
|
|
2214
|
+
stage: stage$1,
|
|
2215
|
+
fqn,
|
|
2216
|
+
value: {
|
|
2217
|
+
kind: "action",
|
|
2218
|
+
status: "running",
|
|
2219
|
+
fqn,
|
|
2220
|
+
logicalId: node.def.LogicalId,
|
|
2221
|
+
namespace: node.def.Namespace,
|
|
2222
|
+
actionType: node.def.Type,
|
|
2223
|
+
inputHash: newHash,
|
|
2224
|
+
input: newInput,
|
|
2225
|
+
downstream: node.downstream
|
|
2226
|
+
}
|
|
2227
|
+
});
|
|
2228
|
+
const result = yield* node.def.Run(newInput);
|
|
2229
|
+
yield* state.set({
|
|
2230
|
+
stack: stackName,
|
|
2231
|
+
stage: stage$1,
|
|
2232
|
+
fqn,
|
|
2233
|
+
value: {
|
|
2234
|
+
kind: "action",
|
|
2235
|
+
status: "ran",
|
|
2236
|
+
fqn,
|
|
2237
|
+
logicalId: node.def.LogicalId,
|
|
2238
|
+
namespace: node.def.Namespace,
|
|
2239
|
+
actionType: node.def.Type,
|
|
2240
|
+
inputHash: newHash,
|
|
2241
|
+
input: newInput,
|
|
2242
|
+
output: result,
|
|
2243
|
+
downstream: node.downstream
|
|
2244
|
+
}
|
|
2245
|
+
});
|
|
2246
|
+
tracker[fqn] = {
|
|
2247
|
+
output: result,
|
|
2248
|
+
props: { __input: newInput },
|
|
2249
|
+
bindings: [],
|
|
2250
|
+
instanceId: fqn
|
|
2251
|
+
};
|
|
2252
|
+
terminalStatuses.set(fqn, {
|
|
2253
|
+
id: node.def.LogicalId,
|
|
2254
|
+
type: node.def.Type,
|
|
2255
|
+
status: "ran"
|
|
2256
|
+
});
|
|
2257
|
+
}
|
|
1872
2258
|
if (!anyUpdated) break;
|
|
1873
2259
|
}
|
|
1874
2260
|
});
|
|
@@ -1876,6 +2262,25 @@ const collectGarbage = Effect.fnUntraced(function* (plan, session) {
|
|
|
1876
2262
|
const state = yield* State;
|
|
1877
2263
|
const stackName = (yield* Stack).name;
|
|
1878
2264
|
const stage$1 = yield* Stage;
|
|
2265
|
+
yield* Effect.all(Object.entries(plan.actionDeletions ?? {}).map(([fqn, node]) => node === void 0 ? Effect.void : Effect.gen(function* () {
|
|
2266
|
+
yield* session.emit({
|
|
2267
|
+
kind: "status-change",
|
|
2268
|
+
id: node.def.LogicalId,
|
|
2269
|
+
type: node.def.Type,
|
|
2270
|
+
status: "deleting"
|
|
2271
|
+
});
|
|
2272
|
+
yield* state.delete({
|
|
2273
|
+
stack: stackName,
|
|
2274
|
+
stage: stage$1,
|
|
2275
|
+
fqn
|
|
2276
|
+
});
|
|
2277
|
+
yield* session.emit({
|
|
2278
|
+
kind: "status-change",
|
|
2279
|
+
id: node.def.LogicalId,
|
|
2280
|
+
type: node.def.Type,
|
|
2281
|
+
status: "deleted"
|
|
2282
|
+
});
|
|
2283
|
+
})), { concurrency: "unbounded" });
|
|
1879
2284
|
const deleteGraph = Effect.fnUntraced(function* (deletionGraph) {
|
|
1880
2285
|
const deletions = {};
|
|
1881
2286
|
const deleteResource = (node, ancestors = /* @__PURE__ */ new Set()) => Effect.gen(function* () {
|
|
@@ -2030,10 +2435,10 @@ var __rewriteRelativeImportExtension = void 0 && (void 0).__rewriteRelativeImpor
|
|
|
2030
2435
|
return path$1;
|
|
2031
2436
|
};
|
|
2032
2437
|
const USER = Config.string("USER").pipe(Config.orElse(() => Config.string("USERNAME")), Config.withDefault("unknown"));
|
|
2033
|
-
const STAGE = Config.string("stage").pipe(Config.option, (a) => a
|
|
2438
|
+
const STAGE = Config.string("stage").pipe(Config.option, (a) => a, Effect.map(Option.getOrUndefined));
|
|
2034
2439
|
const stage = Flag.string("stage").pipe(Flag.withSchema(S.String.check(S.isPattern(/^[a-z0-9]+([-_a-z0-9]+)*$/gi))), Flag.withDescription("Stage to deploy to, defaults to dev_${USER}"), Flag.optional, Flag.map(Option.getOrUndefined), Flag.mapEffect(Effect.fn(function* (stage$1) {
|
|
2035
2440
|
if (stage$1) return stage$1;
|
|
2036
|
-
return yield* STAGE.pipe(Effect.catch(() => Effect.fail(new CliError.MissingOption({ option: "stage" }))), Effect.flatMap((s) => s === void 0 ? USER.
|
|
2441
|
+
return yield* STAGE.pipe(Effect.catch(() => Effect.fail(new CliError.MissingOption({ option: "stage" }))), Effect.flatMap((s) => s === void 0 ? USER.pipe(Effect.map((user) => `dev_${user}`), Effect.catch(() => Effect.succeed("unknown"))) : Effect.succeed(s)));
|
|
2037
2442
|
})));
|
|
2038
2443
|
const envFile = Flag.file("env-file").pipe(Flag.optional, Flag.withDescription("File to load environment variables from, defaults to .env"));
|
|
2039
2444
|
const dryRun = Flag.boolean("dry-run").pipe(Flag.withDescription("Dry run the deployment, do not actually deploy"), Flag.withDefault(false));
|
|
@@ -2096,7 +2501,7 @@ const stackSpanAttrs = (args) => ({
|
|
|
2096
2501
|
const adopt = Flag.boolean("adopt").pipe(Flag.withDescription("Adopt pre-existing cloud resources that conflict with this stack instead of failing. Useful for re-importing infrastructure into a fresh state store."), Flag.withDefault(false));
|
|
2097
2502
|
const execStack = Effect.fn(function* ({ main, stage: stage$1, envFile: envFile$1, profile: profile$1, dryRun: dryRun$1 = false, force: force$1 = false, yes: yes$1 = false, destroy = false, dev = false, adopt: adopt$1 = false }) {
|
|
2098
2503
|
const stackEffect = yield* importStack(main);
|
|
2099
|
-
const services$1 = Layer.mergeAll(Layer.effect(AlchemyContext, AlchemyContext.
|
|
2504
|
+
const services$1 = Layer.mergeAll(Layer.effect(AlchemyContext, AlchemyContext.pipe(Effect.map((ctx) => ({
|
|
2100
2505
|
...ctx,
|
|
2101
2506
|
dev,
|
|
2102
2507
|
adopt: adopt$1
|
|
@@ -2250,12 +2655,13 @@ const LoggingCli = Layer.succeed(Cli, Cli.of({
|
|
|
2250
2655
|
|
|
2251
2656
|
//#endregion
|
|
2252
2657
|
//#region lib/Cli/NamespaceTree.js
|
|
2253
|
-
function buildNamespaceTree(items) {
|
|
2658
|
+
function buildNamespaceTree(items, actions = []) {
|
|
2254
2659
|
const root = {
|
|
2255
2660
|
id: "",
|
|
2256
2661
|
path: [],
|
|
2257
2662
|
children: /* @__PURE__ */ new Map(),
|
|
2258
|
-
resources: []
|
|
2663
|
+
resources: [],
|
|
2664
|
+
actions: []
|
|
2259
2665
|
};
|
|
2260
2666
|
const getNode = (path$1) => {
|
|
2261
2667
|
let current = root;
|
|
@@ -2267,7 +2673,8 @@ function buildNamespaceTree(items) {
|
|
|
2267
2673
|
id: segment,
|
|
2268
2674
|
path: path$1.slice(0, i + 1),
|
|
2269
2675
|
children: /* @__PURE__ */ new Map(),
|
|
2270
|
-
resources: []
|
|
2676
|
+
resources: [],
|
|
2677
|
+
actions: []
|
|
2271
2678
|
};
|
|
2272
2679
|
current.children.set(segment, child);
|
|
2273
2680
|
}
|
|
@@ -2276,11 +2683,13 @@ function buildNamespaceTree(items) {
|
|
|
2276
2683
|
return current;
|
|
2277
2684
|
};
|
|
2278
2685
|
for (const item of items) getNode(toPath(item.resource.Namespace)).resources.push(item);
|
|
2686
|
+
for (const action of actions) getNode(toPath(action.def.Namespace)).actions.push(action);
|
|
2279
2687
|
return root;
|
|
2280
2688
|
}
|
|
2281
2689
|
function deriveNamespaceAction(node) {
|
|
2282
2690
|
const actions = /* @__PURE__ */ new Set();
|
|
2283
2691
|
for (const resource of node.resources) actions.add(deriveResourceChildrenAction(resource, node));
|
|
2692
|
+
for (const action of node.actions) actions.add(action.action === "run" ? "create" : action.action === "delete" ? "delete" : "noop");
|
|
2284
2693
|
for (const child of node.children.values()) {
|
|
2285
2694
|
const childAction = deriveNamespaceAction(child);
|
|
2286
2695
|
if (childAction === "mixed") return "mixed";
|
|
@@ -2333,8 +2742,17 @@ const flattenNamespace = (node, depth, result) => {
|
|
|
2333
2742
|
});
|
|
2334
2743
|
if (childNamespace) flattenNamespace(childNamespace, depth + 1, result);
|
|
2335
2744
|
}
|
|
2745
|
+
const sortedActions = [...node.actions].sort((a, b) => a.def.LogicalId.localeCompare(b.def.LogicalId));
|
|
2746
|
+
for (const action of sortedActions) result.push({
|
|
2747
|
+
type: "action",
|
|
2748
|
+
depth,
|
|
2749
|
+
id: action.def.LogicalId,
|
|
2750
|
+
path: [...node.path, action.def.LogicalId],
|
|
2751
|
+
action: action.action,
|
|
2752
|
+
actionType: action.def.Type
|
|
2753
|
+
});
|
|
2336
2754
|
};
|
|
2337
|
-
const isEmpty = (node) => node.resources.length === 0 && Array.from(node.children.values()).every(isEmpty);
|
|
2755
|
+
const isEmpty = (node) => node.resources.length === 0 && node.actions.length === 0 && Array.from(node.children.values()).every(isEmpty);
|
|
2338
2756
|
const deriveResourceChildrenAction = (resource, node) => {
|
|
2339
2757
|
const actions = new Set([resource.action]);
|
|
2340
2758
|
for (const binding of resource.bindings) actions.add(binding.action);
|
|
@@ -2355,10 +2773,11 @@ const deriveAction = (actions) => {
|
|
|
2355
2773
|
//#region lib/Cli/tui/components/Plan.js
|
|
2356
2774
|
function Plan({ plan }) {
|
|
2357
2775
|
const items = useMemo(() => [...Object.values(plan.resources), ...Object.values(plan.deletions)], [plan]);
|
|
2776
|
+
const taskItems = useMemo(() => [...Object.values(plan.actions ?? {}), ...Object.values(plan.actionDeletions ?? {})].filter((t) => t !== void 0), [plan]);
|
|
2358
2777
|
const flatItems = useMemo(() => {
|
|
2359
|
-
return flattenTree(buildNamespaceTree(items));
|
|
2360
|
-
}, [items]);
|
|
2361
|
-
if (items.length === 0) return jsx(Text, {
|
|
2778
|
+
return flattenTree(buildNamespaceTree(items, taskItems));
|
|
2779
|
+
}, [items, taskItems]);
|
|
2780
|
+
if (items.length === 0 && taskItems.length === 0) return jsx(Text, {
|
|
2362
2781
|
color: "gray",
|
|
2363
2782
|
children: "No changes planned"
|
|
2364
2783
|
});
|
|
@@ -2369,12 +2788,18 @@ function Plan({ plan }) {
|
|
|
2369
2788
|
noop: 0,
|
|
2370
2789
|
replace: 0
|
|
2371
2790
|
});
|
|
2791
|
+
const taskCounts = taskItems.reduce((acc, item) => (acc[item.action]++, acc), {
|
|
2792
|
+
run: 0,
|
|
2793
|
+
noop: 0,
|
|
2794
|
+
delete: 0
|
|
2795
|
+
});
|
|
2372
2796
|
const actions = [
|
|
2373
2797
|
"create",
|
|
2374
2798
|
"update",
|
|
2375
2799
|
"delete",
|
|
2376
2800
|
"replace"
|
|
2377
2801
|
].filter((action) => counts[action] > 0);
|
|
2802
|
+
const taskHeaderEntries = [taskCounts.run > 0 ? `${taskCounts.run} to run` : void 0, taskCounts.delete > 0 ? `${taskCounts.delete} to drop` : void 0].filter((s) => !!s);
|
|
2378
2803
|
return jsxs(Box, {
|
|
2379
2804
|
flexDirection: "column",
|
|
2380
2805
|
children: [jsxs(Box, {
|
|
@@ -2385,20 +2810,20 @@ function Plan({ plan }) {
|
|
|
2385
2810
|
children: "Plan"
|
|
2386
2811
|
}),
|
|
2387
2812
|
jsx(Text, { children: ": " }),
|
|
2388
|
-
actions.
|
|
2813
|
+
[...actions.map((action) => {
|
|
2389
2814
|
const count = counts[action];
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
const box = jsx(Box, { children: jsxs(Text, {
|
|
2393
|
-
color,
|
|
2815
|
+
return jsx(Box, { children: jsxs(Text, {
|
|
2816
|
+
color: actionColor(action),
|
|
2394
2817
|
children: [
|
|
2395
2818
|
count,
|
|
2396
2819
|
" to ",
|
|
2397
2820
|
action
|
|
2398
2821
|
]
|
|
2399
2822
|
}) }, action);
|
|
2400
|
-
|
|
2401
|
-
|
|
2823
|
+
}), ...taskHeaderEntries.map((label, i) => jsx(Box, { children: jsx(Text, {
|
|
2824
|
+
color: "cyan",
|
|
2825
|
+
children: label
|
|
2826
|
+
}) }, `task-${i}`))].flatMap((box, i, arr) => i === arr.length - 1 ? [box] : [box, jsx(Text, { children: " | " }, `sep-${i}`)])
|
|
2402
2827
|
]
|
|
2403
2828
|
}), jsx(Box, {
|
|
2404
2829
|
flexDirection: "column",
|
|
@@ -2442,6 +2867,41 @@ function Plan({ plan }) {
|
|
|
2442
2867
|
})
|
|
2443
2868
|
]
|
|
2444
2869
|
}, key);
|
|
2870
|
+
if (item.type === "action") return jsxs(Box, {
|
|
2871
|
+
flexDirection: "row",
|
|
2872
|
+
children: [
|
|
2873
|
+
jsx(Text, { children: indent }),
|
|
2874
|
+
jsx(Box, {
|
|
2875
|
+
width: 2,
|
|
2876
|
+
children: jsxs(Text, {
|
|
2877
|
+
color,
|
|
2878
|
+
children: [icon, " "]
|
|
2879
|
+
})
|
|
2880
|
+
}),
|
|
2881
|
+
jsx(Box, { children: jsx(Text, {
|
|
2882
|
+
bold: true,
|
|
2883
|
+
children: item.id
|
|
2884
|
+
}) }),
|
|
2885
|
+
jsx(Box, {
|
|
2886
|
+
marginLeft: 1,
|
|
2887
|
+
children: jsxs(Text, {
|
|
2888
|
+
color: "blackBright",
|
|
2889
|
+
children: [
|
|
2890
|
+
"(",
|
|
2891
|
+
item.actionType,
|
|
2892
|
+
")"
|
|
2893
|
+
]
|
|
2894
|
+
})
|
|
2895
|
+
}),
|
|
2896
|
+
jsx(Box, {
|
|
2897
|
+
marginLeft: 1,
|
|
2898
|
+
children: jsx(Text, {
|
|
2899
|
+
color: "cyan",
|
|
2900
|
+
children: "[action]"
|
|
2901
|
+
})
|
|
2902
|
+
})
|
|
2903
|
+
]
|
|
2904
|
+
}, key);
|
|
2445
2905
|
return jsxs(Box, {
|
|
2446
2906
|
flexDirection: "row",
|
|
2447
2907
|
children: [
|
|
@@ -2491,7 +2951,8 @@ const getActionColor = (action) => ({
|
|
|
2491
2951
|
update: "yellow",
|
|
2492
2952
|
delete: "red",
|
|
2493
2953
|
replace: "magenta",
|
|
2494
|
-
mixed: "cyan"
|
|
2954
|
+
mixed: "cyan",
|
|
2955
|
+
run: "cyan"
|
|
2495
2956
|
})[action] ?? "gray";
|
|
2496
2957
|
const getActionIcon = (action) => ({
|
|
2497
2958
|
create: "+",
|
|
@@ -2499,7 +2960,8 @@ const getActionIcon = (action) => ({
|
|
|
2499
2960
|
delete: "-",
|
|
2500
2961
|
noop: "•",
|
|
2501
2962
|
replace: "!",
|
|
2502
|
-
mixed: "*"
|
|
2963
|
+
mixed: "*",
|
|
2964
|
+
run: "λ"
|
|
2503
2965
|
})[action] ?? "?";
|
|
2504
2966
|
const actionColor = (action) => getActionColor(action);
|
|
2505
2967
|
|
|
@@ -2542,29 +3004,40 @@ function ApprovePlan(props) {
|
|
|
2542
3004
|
//#region lib/Cli/tui/components/PlanProgress.js
|
|
2543
3005
|
const getTaskKey = (item) => item.path.join("/");
|
|
2544
3006
|
const buildProgressRows = (plan) => {
|
|
2545
|
-
return flattenTree(buildNamespaceTree([...Object.values(plan.resources), ...Object.values(plan.deletions).filter((item) => item !== void 0)])).filter((
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
type
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
3007
|
+
return flattenTree(buildNamespaceTree([...Object.values(plan.resources), ...Object.values(plan.deletions).filter((item) => item !== void 0)], [...Object.values(plan.actions ?? {}), ...Object.values(plan.actionDeletions ?? {})].filter((t) => t !== void 0))).filter((item) => item.type !== "binding").map((item) => {
|
|
3008
|
+
if (item.type === "namespace") return {
|
|
3009
|
+
key: getTaskKey(item),
|
|
3010
|
+
type: "namespace",
|
|
3011
|
+
id: item.id,
|
|
3012
|
+
depth: item.depth,
|
|
3013
|
+
action: item.action
|
|
3014
|
+
};
|
|
3015
|
+
if (item.type === "action") return {
|
|
3016
|
+
key: getTaskKey(item),
|
|
3017
|
+
type: "task",
|
|
3018
|
+
id: item.id,
|
|
3019
|
+
depth: item.depth,
|
|
3020
|
+
actionType: item.actionType ?? "unknown",
|
|
3021
|
+
action: item.action
|
|
3022
|
+
};
|
|
3023
|
+
return {
|
|
3024
|
+
key: getTaskKey(item),
|
|
3025
|
+
type: "resource",
|
|
3026
|
+
id: item.id,
|
|
3027
|
+
depth: item.depth,
|
|
3028
|
+
resourceType: item.resourceType ?? "unknown",
|
|
3029
|
+
action: item.action,
|
|
3030
|
+
persistedApplyStatus: item.action === "noop" ? (() => {
|
|
3031
|
+
const crud = findCrudByLogicalId(plan, item.id);
|
|
3032
|
+
return crud?.action === "noop" ? crud.state.status : void 0;
|
|
3033
|
+
})() : void 0
|
|
3034
|
+
};
|
|
2562
3035
|
});
|
|
2563
3036
|
};
|
|
2564
3037
|
const buildLogicalIdIndex = (rows) => {
|
|
2565
3038
|
const index = /* @__PURE__ */ new Map();
|
|
2566
3039
|
for (const row of rows) {
|
|
2567
|
-
if (row.type !== "resource") continue;
|
|
3040
|
+
if (row.type !== "resource" && row.type !== "task") continue;
|
|
2568
3041
|
const keys = index.get(row.id);
|
|
2569
3042
|
if (keys) keys.push(row.key);
|
|
2570
3043
|
else index.set(row.id, [row.key]);
|
|
@@ -2587,7 +3060,13 @@ function toPlanTask(rowOrId, planItem) {
|
|
|
2587
3060
|
updatedAt: Date.now()
|
|
2588
3061
|
};
|
|
2589
3062
|
}
|
|
2590
|
-
const buildInitialTasks = (rows) => new Map(rows.flatMap((row) => row.type === "resource" ? [[row.key, toPlanTask(row)]] : [
|
|
3063
|
+
const buildInitialTasks = (rows) => new Map(rows.flatMap((row) => row.type === "resource" ? [[row.key, toPlanTask(row)]] : row.type === "task" ? [[row.key, {
|
|
3064
|
+
key: row.key,
|
|
3065
|
+
id: row.id,
|
|
3066
|
+
type: row.actionType,
|
|
3067
|
+
status: row.action === "noop" ? "skipped" : "pending",
|
|
3068
|
+
updatedAt: Date.now()
|
|
3069
|
+
}]] : []));
|
|
2591
3070
|
function PlanProgress(props) {
|
|
2592
3071
|
const { source, plan } = props;
|
|
2593
3072
|
const spinner = useGlobalSpinner();
|
|
@@ -2654,6 +3133,56 @@ function PlanProgress(props) {
|
|
|
2654
3133
|
})
|
|
2655
3134
|
]
|
|
2656
3135
|
}, row.key);
|
|
3136
|
+
if (row.type === "task") {
|
|
3137
|
+
const t = tasks.get(row.key);
|
|
3138
|
+
const status = t?.status ?? (row.action === "noop" ? "ran" : "pending");
|
|
3139
|
+
const color$1 = statusColor(status);
|
|
3140
|
+
const icon$1 = taskIcon(row.action, status, spinner);
|
|
3141
|
+
const label = row.action === "delete" ? status === "deleted" ? "deleted" : "drop" : status === "ran" ? row.action === "noop" ? "skip" : "ran" : status === "running" ? "running" : status === "fail" ? "fail" : row.action === "noop" ? "skip" : "run";
|
|
3142
|
+
return jsxs(Box, {
|
|
3143
|
+
flexDirection: "column",
|
|
3144
|
+
children: [jsxs(Box, {
|
|
3145
|
+
flexDirection: "row",
|
|
3146
|
+
children: [
|
|
3147
|
+
jsx(Text, { children: indent }),
|
|
3148
|
+
jsx(Box, {
|
|
3149
|
+
width: 2,
|
|
3150
|
+
children: jsxs(Text, {
|
|
3151
|
+
color: color$1,
|
|
3152
|
+
children: [icon$1, " "]
|
|
3153
|
+
})
|
|
3154
|
+
}),
|
|
3155
|
+
jsx(Text, {
|
|
3156
|
+
bold: true,
|
|
3157
|
+
children: row.id
|
|
3158
|
+
}),
|
|
3159
|
+
jsxs(Text, {
|
|
3160
|
+
dimColor: true,
|
|
3161
|
+
children: [
|
|
3162
|
+
" (",
|
|
3163
|
+
row.actionType,
|
|
3164
|
+
")"
|
|
3165
|
+
]
|
|
3166
|
+
}),
|
|
3167
|
+
jsxs(Text, {
|
|
3168
|
+
color: color$1,
|
|
3169
|
+
children: [" ", label]
|
|
3170
|
+
}),
|
|
3171
|
+
jsxs(Text, {
|
|
3172
|
+
color: "cyan",
|
|
3173
|
+
dimColor: true,
|
|
3174
|
+
children: [" ", "[action]"]
|
|
3175
|
+
})
|
|
3176
|
+
]
|
|
3177
|
+
}), t?.message ? jsx(Box, {
|
|
3178
|
+
paddingLeft: row.depth * 2 + 2,
|
|
3179
|
+
children: jsxs(Text, {
|
|
3180
|
+
dimColor: true,
|
|
3181
|
+
children: ["• ", t.message]
|
|
3182
|
+
})
|
|
3183
|
+
}) : null]
|
|
3184
|
+
}, row.key);
|
|
3185
|
+
}
|
|
2657
3186
|
const task = tasks.get(row.key) ?? toPlanTask(row);
|
|
2658
3187
|
const displayStatus = getDisplayStatus(row, task.status);
|
|
2659
3188
|
const color = statusColor(displayStatus);
|
|
@@ -2713,17 +3242,30 @@ function statusColor(status) {
|
|
|
2713
3242
|
case "updated": return "yellow";
|
|
2714
3243
|
case "deleting":
|
|
2715
3244
|
case "deleted": return "red";
|
|
3245
|
+
case "running":
|
|
3246
|
+
case "ran": return "cyan";
|
|
3247
|
+
case "skipped": return "gray";
|
|
2716
3248
|
case "fail": return "redBright";
|
|
2717
3249
|
default: return;
|
|
2718
3250
|
}
|
|
2719
3251
|
}
|
|
3252
|
+
function taskIcon(action, status, spinnerChar) {
|
|
3253
|
+
if (status === "running") return spinnerChar;
|
|
3254
|
+
if (status === "fail") return "✗";
|
|
3255
|
+
if (status === "skipped") return "•";
|
|
3256
|
+
if (status === "ran") return action === "noop" ? "•" : "✓";
|
|
3257
|
+
if (status === "deleted") return "✓";
|
|
3258
|
+
if (action === "delete") return "-";
|
|
3259
|
+
if (action === "noop") return "•";
|
|
3260
|
+
return "λ";
|
|
3261
|
+
}
|
|
2720
3262
|
function statusIcon(status, spinnerChar) {
|
|
2721
3263
|
if (isInProgress(status)) return spinnerChar;
|
|
2722
3264
|
if (status === "fail") return "✗";
|
|
2723
3265
|
return "✓";
|
|
2724
3266
|
}
|
|
2725
3267
|
function isInProgress(status) {
|
|
2726
|
-
return status === "pending" || status === "creating" || status === "updating" || status === "deleting";
|
|
3268
|
+
return status === "pending" || status === "creating" || status === "updating" || status === "deleting" || status === "running";
|
|
2727
3269
|
}
|
|
2728
3270
|
const spinnerFrames = [
|
|
2729
3271
|
"⠋",
|