alchemy 2.0.0-beta.34 → 2.0.0-beta.36
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/cli.js +8 -7
- package/bin/exec.js +253 -52
- package/bin/exec.js.map +1 -1
- package/lib/AWS/AuthProvider.d.ts +7 -6
- package/lib/AWS/AuthProvider.d.ts.map +1 -1
- package/lib/AWS/AuthProvider.js +143 -134
- package/lib/AWS/AuthProvider.js.map +1 -1
- package/lib/AWS/Bootstrap.d.ts +2 -2
- package/lib/AWS/Bootstrap.d.ts.map +1 -1
- package/lib/AWS/EC2/hosted.d.ts +1 -1
- package/lib/AWS/Environment.d.ts +25 -3
- package/lib/AWS/Environment.d.ts.map +1 -1
- package/lib/AWS/Environment.js +47 -3
- package/lib/AWS/Environment.js.map +1 -1
- package/lib/AWS/IAM/OpenIDConnectProvider.d.ts +14 -6
- package/lib/AWS/IAM/OpenIDConnectProvider.d.ts.map +1 -1
- package/lib/AWS/IAM/OpenIDConnectProvider.js +6 -3
- package/lib/AWS/IAM/OpenIDConnectProvider.js.map +1 -1
- package/lib/AWS/IAM/Policy.d.ts +1 -1
- package/lib/AWS/IAM/Policy.d.ts.map +1 -1
- package/lib/AWS/IAM/Policy.js.map +1 -1
- package/lib/AWS/Lambda/BucketEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/BucketEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/EventBridgeEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/EventBridgeEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/QueueEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/QueueEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/StreamEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/StreamEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/TableEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/TableEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/TopicEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/TopicEventSource.d.ts.map +1 -1
- package/lib/AWS/Providers.d.ts +1 -1
- package/lib/AWS/Providers.d.ts.map +1 -1
- package/lib/AWS/Providers.js +2 -1
- package/lib/AWS/Providers.js.map +1 -1
- package/lib/Auth/Credentials.d.ts +21 -6
- package/lib/Auth/Credentials.d.ts.map +1 -1
- package/lib/Auth/Credentials.js +30 -31
- package/lib/Auth/Credentials.js.map +1 -1
- package/lib/Auth/Profile.d.ts +31 -34
- package/lib/Auth/Profile.d.ts.map +1 -1
- package/lib/Auth/Profile.js +46 -31
- package/lib/Auth/Profile.js.map +1 -1
- package/lib/Axiom/AuthProvider.d.ts +2 -1
- package/lib/Axiom/AuthProvider.d.ts.map +1 -1
- package/lib/Axiom/AuthProvider.js +149 -143
- package/lib/Axiom/AuthProvider.js.map +1 -1
- package/lib/Axiom/Credentials.d.ts +2 -1
- package/lib/Axiom/Credentials.d.ts.map +1 -1
- package/lib/Axiom/Credentials.js +4 -4
- package/lib/Axiom/Credentials.js.map +1 -1
- package/lib/Axiom/Providers.d.ts +1 -1
- package/lib/Axiom/Providers.d.ts.map +1 -1
- package/lib/Axiom/Providers.js +3 -1
- package/lib/Axiom/Providers.js.map +1 -1
- package/lib/Cli/LoggingCli.d.ts.map +1 -1
- package/lib/Cli/LoggingCli.js +105 -7
- package/lib/Cli/LoggingCli.js.map +1 -1
- package/lib/Cli/checkVersion.d.ts +13 -0
- package/lib/Cli/checkVersion.d.ts.map +1 -0
- package/lib/Cli/checkVersion.js +47 -0
- package/lib/Cli/checkVersion.js.map +1 -0
- package/lib/Cli/commands/_shared.d.ts +2 -2
- package/lib/Cli/commands/_shared.d.ts.map +1 -1
- package/lib/Cli/commands/_shared.js +3 -3
- package/lib/Cli/commands/_shared.js.map +1 -1
- package/lib/Cli/commands/aws.d.ts +6 -0
- package/lib/Cli/commands/aws.d.ts.map +1 -0
- package/lib/Cli/commands/aws.js +63 -0
- package/lib/Cli/commands/aws.js.map +1 -0
- package/lib/Cli/commands/cloudflare.d.ts +17 -0
- package/lib/Cli/commands/cloudflare.d.ts.map +1 -0
- package/lib/Cli/commands/cloudflare.js +111 -0
- package/lib/Cli/commands/cloudflare.js.map +1 -0
- package/lib/Cli/commands/deploy.d.ts +6 -5
- package/lib/Cli/commands/deploy.d.ts.map +1 -1
- package/lib/Cli/commands/deploy.js +10 -10
- package/lib/Cli/commands/deploy.js.map +1 -1
- package/lib/Cli/commands/dev.d.ts.map +1 -1
- package/lib/Cli/commands/dev.js +16 -16
- package/lib/Cli/commands/dev.js.map +1 -1
- package/lib/Cli/commands/login.d.ts +2 -1
- package/lib/Cli/commands/login.d.ts.map +1 -1
- package/lib/Cli/commands/login.js +9 -8
- package/lib/Cli/commands/login.js.map +1 -1
- package/lib/Cli/commands/logs.d.ts +1 -1
- package/lib/Cli/commands/logs.d.ts.map +1 -1
- package/lib/Cli/commands/logs.js +7 -7
- package/lib/Cli/commands/logs.js.map +1 -1
- package/lib/Cli/commands/profile.d.ts +3 -1
- package/lib/Cli/commands/profile.d.ts.map +1 -1
- package/lib/Cli/commands/profile.js +14 -11
- package/lib/Cli/commands/profile.js.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/state.js +8 -8
- package/lib/Cli/commands/state.js.map +1 -1
- package/lib/Cli/commands/tail.d.ts +1 -1
- package/lib/Cli/commands/tail.d.ts.map +1 -1
- package/lib/Cli/commands/tail.js +7 -7
- package/lib/Cli/commands/tail.js.map +1 -1
- package/lib/Cli/exec.d.ts.map +1 -1
- package/lib/Cli/exec.js +5 -3
- package/lib/Cli/exec.js.map +1 -1
- package/lib/Cli/main.d.ts.map +1 -1
- package/lib/Cli/main.js +19 -5
- package/lib/Cli/main.js.map +1 -1
- package/lib/Cli/selectCli.d.ts +12 -0
- package/lib/Cli/selectCli.d.ts.map +1 -0
- package/lib/Cli/selectCli.js +32 -0
- package/lib/Cli/selectCli.js.map +1 -0
- package/lib/Cloudflare/Auth/AuthProvider.d.ts +2 -1
- package/lib/Cloudflare/Auth/AuthProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Auth/AuthProvider.js +235 -214
- package/lib/Cloudflare/Auth/AuthProvider.js.map +1 -1
- package/lib/Cloudflare/CloudflareEnvironment.d.ts +2 -1
- package/lib/Cloudflare/CloudflareEnvironment.d.ts.map +1 -1
- package/lib/Cloudflare/CloudflareEnvironment.js +3 -2
- package/lib/Cloudflare/CloudflareEnvironment.js.map +1 -1
- package/lib/Cloudflare/Credentials.d.ts +2 -1
- package/lib/Cloudflare/Credentials.d.ts.map +1 -1
- package/lib/Cloudflare/Credentials.js +4 -4
- package/lib/Cloudflare/Credentials.js.map +1 -1
- package/lib/Cloudflare/D1/D1Clone.d.ts +2 -1
- package/lib/Cloudflare/D1/D1Clone.d.ts.map +1 -1
- package/lib/Cloudflare/D1/D1Database.d.ts +2 -1
- package/lib/Cloudflare/D1/D1Database.d.ts.map +1 -1
- package/lib/Cloudflare/D1/D1Import.d.ts +3 -1
- package/lib/Cloudflare/D1/D1Import.d.ts.map +1 -1
- package/lib/Cloudflare/Images/Images.d.ts +103 -0
- package/lib/Cloudflare/Images/Images.d.ts.map +1 -0
- package/lib/Cloudflare/Images/Images.js +82 -0
- package/lib/Cloudflare/Images/Images.js.map +1 -0
- package/lib/Cloudflare/Images/ImagesBinding.d.ts +73 -0
- package/lib/Cloudflare/Images/ImagesBinding.d.ts.map +1 -0
- package/lib/Cloudflare/Images/ImagesBinding.js +83 -0
- package/lib/Cloudflare/Images/ImagesBinding.js.map +1 -0
- package/lib/Cloudflare/Images/index.d.ts +3 -0
- package/lib/Cloudflare/Images/index.d.ts.map +1 -0
- package/lib/Cloudflare/Images/index.js +3 -0
- package/lib/Cloudflare/Images/index.js.map +1 -0
- package/lib/Cloudflare/Local/Sidecar.d.ts +11 -4
- package/lib/Cloudflare/Local/Sidecar.d.ts.map +1 -1
- package/lib/Cloudflare/Local/Sidecar.js +8 -6
- package/lib/Cloudflare/Local/Sidecar.js.map +1 -1
- package/lib/Cloudflare/Local/SidecarHandlers.d.ts.map +1 -1
- package/lib/Cloudflare/Local/SidecarHandlers.js +1 -5
- package/lib/Cloudflare/Local/SidecarHandlers.js.map +1 -1
- package/lib/Cloudflare/Local/SidecarServer.js +5 -2
- package/lib/Cloudflare/Local/SidecarServer.js.map +1 -1
- package/lib/Cloudflare/Logs.d.ts +5 -0
- package/lib/Cloudflare/Logs.d.ts.map +1 -1
- package/lib/Cloudflare/Logs.js +70 -1
- package/lib/Cloudflare/Logs.js.map +1 -1
- package/lib/Cloudflare/Providers.d.ts +1 -1
- package/lib/Cloudflare/Providers.d.ts.map +1 -1
- package/lib/Cloudflare/Providers.js +6 -1
- package/lib/Cloudflare/Providers.js.map +1 -1
- package/lib/Cloudflare/Queue/Queue.d.ts +1 -1
- package/lib/Cloudflare/Queue/Queue.js +1 -1
- package/lib/Cloudflare/Queue/QueueConsumer.d.ts +6 -2
- package/lib/Cloudflare/Queue/QueueConsumer.d.ts.map +1 -1
- package/lib/Cloudflare/Queue/QueueConsumer.js +194 -53
- package/lib/Cloudflare/Queue/QueueConsumer.js.map +1 -1
- package/lib/Cloudflare/Queue/QueueEventSource.d.ts +106 -0
- package/lib/Cloudflare/Queue/QueueEventSource.d.ts.map +1 -0
- package/lib/Cloudflare/Queue/QueueEventSource.js +145 -0
- package/lib/Cloudflare/Queue/QueueEventSource.js.map +1 -0
- package/lib/Cloudflare/Queue/index.d.ts +1 -0
- package/lib/Cloudflare/Queue/index.d.ts.map +1 -1
- package/lib/Cloudflare/Queue/index.js +1 -0
- package/lib/Cloudflare/Queue/index.js.map +1 -1
- package/lib/Cloudflare/R2/R2Bucket.d.ts +229 -0
- package/lib/Cloudflare/R2/R2Bucket.d.ts.map +1 -1
- package/lib/Cloudflare/R2/R2Bucket.js +309 -2
- package/lib/Cloudflare/R2/R2Bucket.js.map +1 -1
- package/lib/Cloudflare/StateStore/State.d.ts +4 -3
- package/lib/Cloudflare/StateStore/State.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/State.js +16 -8
- package/lib/Cloudflare/StateStore/State.js.map +1 -1
- package/lib/Cloudflare/VpcService/VpcServiceRef.d.ts +1 -1
- package/lib/Cloudflare/VpcService/VpcServiceRef.d.ts.map +1 -1
- package/lib/Cloudflare/Website/StaticSite.d.ts.map +1 -1
- package/lib/Cloudflare/Website/StaticSite.js +10 -1
- package/lib/Cloudflare/Website/StaticSite.js.map +1 -1
- package/lib/Cloudflare/Workers/Assets.d.ts +1 -1
- package/lib/Cloudflare/Workers/Assets.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/InferEnv.d.ts +1 -1
- 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 +11 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/Worker.d.ts +14 -12
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +96 -165
- package/lib/Cloudflare/Workers/Worker.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts +2 -0
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.js +21 -7
- package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
- package/lib/Cloudflare/Zone.d.ts +14 -0
- package/lib/Cloudflare/Zone.d.ts.map +1 -0
- package/lib/Cloudflare/Zone.js +44 -0
- package/lib/Cloudflare/Zone.js.map +1 -0
- package/lib/Cloudflare/index.d.ts +1 -0
- package/lib/Cloudflare/index.d.ts.map +1 -1
- package/lib/Cloudflare/index.js +1 -0
- package/lib/Cloudflare/index.js.map +1 -1
- package/lib/Drizzle/Schema.d.ts.map +1 -1
- package/lib/Drizzle/Schema.js +20 -5
- package/lib/Drizzle/Schema.js.map +1 -1
- package/lib/GitHub/AuthProvider.d.ts +3 -1
- package/lib/GitHub/AuthProvider.d.ts.map +1 -1
- package/lib/GitHub/AuthProvider.js +114 -108
- package/lib/GitHub/AuthProvider.js.map +1 -1
- package/lib/GitHub/Credentials.d.ts +2 -1
- package/lib/GitHub/Credentials.d.ts.map +1 -1
- package/lib/GitHub/Credentials.js +4 -4
- package/lib/GitHub/Credentials.js.map +1 -1
- package/lib/GitHub/Providers.d.ts +1 -1
- package/lib/GitHub/Providers.d.ts.map +1 -1
- package/lib/GitHub/Providers.js +3 -1
- package/lib/GitHub/Providers.js.map +1 -1
- package/lib/GitHub/Secrets.d.ts.map +1 -1
- package/lib/GitHub/Secrets.js +14 -1
- package/lib/GitHub/Secrets.js.map +1 -1
- package/lib/GitHub/Variables.d.ts +40 -0
- package/lib/GitHub/Variables.d.ts.map +1 -0
- package/lib/GitHub/Variables.js +28 -0
- package/lib/GitHub/Variables.js.map +1 -0
- package/lib/GitHub/index.d.ts +1 -0
- package/lib/GitHub/index.d.ts.map +1 -1
- package/lib/GitHub/index.js +1 -0
- package/lib/GitHub/index.js.map +1 -1
- package/lib/Neon/AuthProvider.d.ts +3 -1
- package/lib/Neon/AuthProvider.d.ts.map +1 -1
- package/lib/Neon/AuthProvider.js +87 -80
- package/lib/Neon/AuthProvider.js.map +1 -1
- package/lib/Neon/Credentials.d.ts +2 -1
- package/lib/Neon/Credentials.d.ts.map +1 -1
- package/lib/Neon/Credentials.js +4 -4
- package/lib/Neon/Credentials.js.map +1 -1
- package/lib/Neon/NeonEnvironment.d.ts +2 -1
- package/lib/Neon/NeonEnvironment.d.ts.map +1 -1
- package/lib/Neon/NeonEnvironment.js +3 -2
- package/lib/Neon/NeonEnvironment.js.map +1 -1
- package/lib/Neon/Project.d.ts +16 -0
- package/lib/Neon/Project.d.ts.map +1 -1
- package/lib/Neon/Project.js +25 -0
- package/lib/Neon/Project.js.map +1 -1
- package/lib/Neon/Providers.d.ts +1 -1
- package/lib/Neon/Providers.d.ts.map +1 -1
- package/lib/Neon/Providers.js +3 -1
- package/lib/Neon/Providers.js.map +1 -1
- package/lib/Neon/api.d.ts +1 -0
- package/lib/Neon/api.d.ts.map +1 -1
- package/lib/Neon/api.js +1 -0
- package/lib/Neon/api.js.map +1 -1
- package/lib/Sidecar/RpcClient.d.ts.map +1 -1
- package/lib/Sidecar/RpcClient.js +8 -5
- package/lib/Sidecar/RpcClient.js.map +1 -1
- package/lib/Sidecar/RpcPaths.d.ts +5 -0
- package/lib/Sidecar/RpcPaths.d.ts.map +1 -1
- package/lib/Sidecar/RpcPaths.js +10 -1
- package/lib/Sidecar/RpcPaths.js.map +1 -1
- package/lib/Sidecar/RpcServer.d.ts +24 -4
- package/lib/Sidecar/RpcServer.d.ts.map +1 -1
- package/lib/Sidecar/RpcServer.js +70 -15
- package/lib/Sidecar/RpcServer.js.map +1 -1
- package/lib/Sidecar/RpcServerBun.d.ts +4 -0
- package/lib/Sidecar/RpcServerBun.d.ts.map +1 -0
- package/lib/Sidecar/RpcServerBun.js +28 -0
- package/lib/Sidecar/RpcServerBun.js.map +1 -0
- package/lib/Sidecar/RpcServerNode.d.ts +4 -0
- package/lib/Sidecar/RpcServerNode.d.ts.map +1 -0
- package/lib/Sidecar/RpcServerNode.js +39 -0
- package/lib/Sidecar/RpcServerNode.js.map +1 -0
- package/lib/Sidecar/RpcServices.d.ts +6 -0
- package/lib/Sidecar/RpcServices.d.ts.map +1 -0
- package/lib/Sidecar/RpcServices.js +29 -0
- package/lib/Sidecar/RpcServices.js.map +1 -0
- package/lib/Stack.d.ts +5 -3
- package/lib/Stack.d.ts.map +1 -1
- package/lib/Stack.js +3 -1
- package/lib/Stack.js.map +1 -1
- package/lib/Test/Core.d.ts.map +1 -1
- package/lib/Test/Core.js +5 -4
- package/lib/Test/Core.js.map +1 -1
- package/lib/Test/Vitest.d.ts.map +1 -1
- package/lib/Test/Vitest.js +2 -0
- package/lib/Test/Vitest.js.map +1 -1
- package/lib/Util/LocalhostDns.d.ts +19 -0
- package/lib/Util/LocalhostDns.d.ts.map +1 -0
- package/lib/Util/LocalhostDns.js +55 -0
- package/lib/Util/LocalhostDns.js.map +1 -0
- package/lib/Util/PlatformServices.d.ts.map +1 -1
- package/lib/Util/PlatformServices.js +3 -1
- package/lib/Util/PlatformServices.js.map +1 -1
- package/lib/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +16 -12
- package/src/AWS/AuthProvider.ts +269 -259
- package/src/AWS/Environment.ts +57 -3
- package/src/AWS/IAM/OpenIDConnectProvider.ts +19 -8
- package/src/AWS/IAM/Policy.ts +1 -1
- package/src/AWS/Providers.ts +2 -0
- package/src/Auth/Credentials.ts +82 -46
- package/src/Auth/Profile.ts +123 -69
- package/src/Axiom/AuthProvider.ts +263 -255
- package/src/Axiom/Credentials.ts +3 -4
- package/src/Axiom/Providers.ts +4 -0
- package/src/Cli/LoggingCli.ts +127 -11
- package/src/Cli/checkVersion.ts +57 -0
- package/src/Cli/commands/_shared.ts +4 -4
- package/src/Cli/commands/aws.ts +127 -0
- package/src/Cli/commands/cloudflare.ts +222 -0
- package/src/Cli/commands/deploy.ts +11 -10
- package/src/Cli/commands/dev.ts +28 -33
- package/src/Cli/commands/login.ts +9 -12
- package/src/Cli/commands/logs.ts +8 -8
- package/src/Cli/commands/profile.ts +14 -16
- package/src/Cli/commands/state.ts +8 -8
- package/src/Cli/commands/tail.ts +8 -8
- package/src/Cli/exec.ts +7 -3
- package/src/Cli/main.ts +23 -5
- package/src/Cli/selectCli.ts +33 -0
- package/src/Cloudflare/Auth/AuthProvider.ts +445 -430
- package/src/Cloudflare/CloudflareEnvironment.ts +3 -2
- package/src/Cloudflare/Credentials.ts +3 -4
- package/src/Cloudflare/Images/Images.ts +121 -0
- package/src/Cloudflare/Images/ImagesBinding.ts +192 -0
- package/src/Cloudflare/Images/index.ts +2 -0
- package/src/Cloudflare/Local/Sidecar.ts +13 -10
- package/src/Cloudflare/Local/SidecarHandlers.ts +8 -13
- package/src/Cloudflare/Local/SidecarServer.ts +6 -1
- package/src/Cloudflare/Logs.ts +115 -1
- package/src/Cloudflare/Providers.ts +9 -0
- package/src/Cloudflare/Queue/Queue.ts +1 -1
- package/src/Cloudflare/Queue/QueueConsumer.ts +262 -60
- package/src/Cloudflare/Queue/QueueEventSource.ts +234 -0
- package/src/Cloudflare/Queue/index.ts +1 -0
- package/src/Cloudflare/R2/R2Bucket.ts +570 -2
- package/src/Cloudflare/StateStore/State.ts +25 -16
- package/src/Cloudflare/Website/StaticSite.ts +11 -1
- package/src/Cloudflare/Workers/InferEnv.ts +7 -3
- package/src/Cloudflare/Workers/LocalWorkerProvider.ts +9 -1
- package/src/Cloudflare/Workers/Worker.ts +130 -231
- package/src/Cloudflare/Workers/WorkerBundle.ts +38 -12
- package/src/Cloudflare/Zone.ts +88 -0
- package/src/Cloudflare/index.ts +1 -0
- package/src/Drizzle/Schema.ts +21 -5
- package/src/GitHub/AuthProvider.ts +221 -217
- package/src/GitHub/Credentials.ts +3 -4
- package/src/GitHub/Providers.ts +4 -0
- package/src/GitHub/Secrets.ts +25 -1
- package/src/GitHub/Variables.ts +54 -0
- package/src/GitHub/index.ts +1 -0
- package/src/Neon/AuthProvider.ts +160 -154
- package/src/Neon/Credentials.ts +3 -4
- package/src/Neon/NeonEnvironment.ts +3 -2
- package/src/Neon/Project.ts +42 -0
- package/src/Neon/Providers.ts +4 -0
- package/src/Neon/api.ts +2 -0
- package/src/Sidecar/RpcClient.ts +8 -7
- package/src/Sidecar/RpcPaths.ts +11 -1
- package/src/Sidecar/RpcServer.ts +97 -24
- package/src/Sidecar/RpcServerBun.ts +41 -0
- package/src/Sidecar/RpcServerNode.ts +51 -0
- package/src/Sidecar/RpcServices.ts +48 -0
- package/src/Stack.ts +8 -0
- package/src/Test/Core.ts +10 -4
- package/src/Test/Vitest.ts +3 -0
- package/src/Util/LocalhostDns.ts +58 -0
- package/src/Util/PlatformServices.ts +3 -1
- package/lib/Cli/commands/bootstrap.d.ts +0 -20
- package/lib/Cli/commands/bootstrap.d.ts.map +0 -1
- package/lib/Cli/commands/bootstrap.js +0 -107
- package/lib/Cli/commands/bootstrap.js.map +0 -1
- package/lib/Sidecar/RpcTransport.d.ts +0 -22
- package/lib/Sidecar/RpcTransport.d.ts.map +0 -1
- package/lib/Sidecar/RpcTransport.js +0 -81
- package/lib/Sidecar/RpcTransport.js.map +0 -1
- package/lib/Test/TestCli.d.ts +0 -19
- package/lib/Test/TestCli.d.ts.map +0 -1
- package/lib/Test/TestCli.js +0 -175
- package/lib/Test/TestCli.js.map +0 -1
- package/src/Cli/commands/bootstrap.ts +0 -216
- package/src/Sidecar/RpcTransport.ts +0 -85
- package/src/Test/TestCli.ts +0 -221
package/bin/cli.js
CHANGED
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
//
|
|
22
22
|
// foreground-child forwards stdio + signals and exits with the child's code,
|
|
23
23
|
// so the launcher is transparent to the invoking shell / npm script.
|
|
24
|
+
import { foregroundChild } from "foreground-child";
|
|
24
25
|
import { fileURLToPath } from "node:url";
|
|
25
26
|
import path from "pathe";
|
|
26
|
-
import { foregroundChild } from "foreground-child";
|
|
27
27
|
|
|
28
28
|
const execpath = (process.env.npm_execpath ?? "").toLowerCase();
|
|
29
29
|
const userAgent = (process.env.npm_config_user_agent ?? "").toLowerCase();
|
|
@@ -38,17 +38,17 @@ const binDir = path.dirname(fileURLToPath(import.meta.url));
|
|
|
38
38
|
const jsEntry = path.join(binDir, "alchemy.js");
|
|
39
39
|
const tsEntry = path.join(binDir, "alchemy.ts");
|
|
40
40
|
|
|
41
|
-
// Treat any install-tree path as published
|
|
42
|
-
const
|
|
41
|
+
// Treat any install-tree path as published.
|
|
42
|
+
const isDev = !(
|
|
43
43
|
binDir.includes("/node_modules/") || binDir.includes("\\node_modules\\")
|
|
44
44
|
);
|
|
45
45
|
|
|
46
|
-
//
|
|
47
|
-
const runtime =
|
|
46
|
+
// We no longer force bun in dev when node is the invoker because this prevents us from testing in node.
|
|
47
|
+
const runtime = invokedByBun ? "bun" : "node";
|
|
48
48
|
|
|
49
49
|
const args = [];
|
|
50
50
|
|
|
51
|
-
if (runtime === "bun" &&
|
|
51
|
+
if (runtime === "bun" && isDev) {
|
|
52
52
|
// Pin bun's tsconfig to alchemy's, not whatever happens to be in the
|
|
53
53
|
// invoking workspace's cwd. Bun's default is `$cwd/tsconfig.json`, which
|
|
54
54
|
// means invoking `alchemy` from e.g. `examples/cloudflare-solidstart`
|
|
@@ -58,7 +58,8 @@ if (runtime === "bun" && useTs) {
|
|
|
58
58
|
args.push(`--tsconfig-override=${path.join(binDir, "..", "tsconfig.json")}`);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
// .ts only runs under bun.
|
|
62
|
+
args.push(runtime === "bun" ? tsEntry : jsEntry, ...process.argv.slice(2));
|
|
62
63
|
|
|
63
64
|
process.on("uncaughtException", (error) => {
|
|
64
65
|
if (
|
package/bin/exec.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
import * as ConfigProvider from "effect/ConfigProvider";
|
|
2
3
|
import * as Effect from "effect/Effect";
|
|
3
4
|
import * as Layer from "effect/Layer";
|
|
@@ -7,6 +8,10 @@ import * as EffectContext from "effect/Context";
|
|
|
7
8
|
import * as FileSystem from "effect/FileSystem";
|
|
8
9
|
import * as Path$1 from "effect/Path";
|
|
9
10
|
import { Path } from "effect/Path";
|
|
11
|
+
import * as Redacted from "effect/Redacted";
|
|
12
|
+
import path from "pathe";
|
|
13
|
+
import * as Config from "effect/Config";
|
|
14
|
+
import os from "node:os";
|
|
10
15
|
import * as Console from "effect/Console";
|
|
11
16
|
import * as Logger from "effect/Logger";
|
|
12
17
|
import * as Option from "effect/Option";
|
|
@@ -16,12 +21,8 @@ import * as Data from "effect/Data";
|
|
|
16
21
|
import * as Cause from "effect/Cause";
|
|
17
22
|
import * as Deferred from "effect/Deferred";
|
|
18
23
|
import { pipe } from "effect/Function";
|
|
19
|
-
import * as Redacted from "effect/Redacted";
|
|
20
24
|
import { SingleShotGen } from "effect/Utils";
|
|
21
25
|
import { pipeArguments } from "effect/Pipeable";
|
|
22
|
-
import path from "pathe";
|
|
23
|
-
import * as Config from "effect/Config";
|
|
24
|
-
import os from "node:os";
|
|
25
26
|
import * as Duration from "effect/Duration";
|
|
26
27
|
import * as Exit from "effect/Exit";
|
|
27
28
|
import * as Metric from "effect/Metric";
|
|
@@ -45,6 +46,130 @@ const AlchemyContextLive = Layer.effect(AlchemyContext, Effect.gen(function* ()
|
|
|
45
46
|
};
|
|
46
47
|
}));
|
|
47
48
|
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region lib/Auth/Profile.js
|
|
51
|
+
const rootDir = path.join(os.homedir(), ".alchemy");
|
|
52
|
+
const configFilePath = path.join(rootDir, "profiles.json");
|
|
53
|
+
/**
|
|
54
|
+
* Config key consulted by the various `fromAuthProvider` /
|
|
55
|
+
* `fromEnvironment` layers to pick which named profile in
|
|
56
|
+
* `~/.alchemy/profiles.json` to use. Defaults to `"default"`.
|
|
57
|
+
*/
|
|
58
|
+
const ALCHEMY_PROFILE = Config.string("ALCHEMY_PROFILE").pipe(Config.withDefault("default"));
|
|
59
|
+
const CONFIG_VERSION = 0;
|
|
60
|
+
const emptyConfig = () => ({
|
|
61
|
+
version: CONFIG_VERSION,
|
|
62
|
+
profiles: {}
|
|
63
|
+
});
|
|
64
|
+
var Profile = class extends EffectContext.Service()("Alchemy::Profile") {};
|
|
65
|
+
/**
|
|
66
|
+
* Layer that builds the {@link Profile} service. Captures the
|
|
67
|
+
* {@link FileSystem.FileSystem} dependency at layer-build time, so any
|
|
68
|
+
* Effect that yields {@link Profile} ends up with `R = Profile` (no
|
|
69
|
+
* `FileSystem` leak). Provide this once at the top of your runtime
|
|
70
|
+
* (alongside `PlatformServices` / `NodeContext`).
|
|
71
|
+
*/
|
|
72
|
+
const ProfileLive = Layer.effect(Profile, Effect.gen(function* () {
|
|
73
|
+
const fs = yield* FileSystem.FileSystem;
|
|
74
|
+
const readConfig = fs.readFileString(configFilePath).pipe(Effect.flatMap((data) => Effect.try({
|
|
75
|
+
try: () => {
|
|
76
|
+
const parsed = JSON.parse(data);
|
|
77
|
+
if (parsed?.version !== CONFIG_VERSION) return emptyConfig();
|
|
78
|
+
return parsed;
|
|
79
|
+
},
|
|
80
|
+
catch: emptyConfig
|
|
81
|
+
})), Effect.orElseSucceed(emptyConfig));
|
|
82
|
+
const writeConfig = (config) => fs.makeDirectory(path.dirname(configFilePath), { recursive: true }).pipe(Effect.flatMap(() => fs.writeFileString(configFilePath, JSON.stringify(config, null, 2))));
|
|
83
|
+
const getProfile = (name) => readConfig.pipe(Effect.map((config) => config.profiles[name]));
|
|
84
|
+
const setProfile = (name, profile$1) => readConfig.pipe(Effect.tap((config) => Effect.sync(() => config.profiles[name] = profile$1)), Effect.flatMap(writeConfig));
|
|
85
|
+
const deleteProfile = (name) => readConfig.pipe(Effect.flatMap((config) => {
|
|
86
|
+
if (!(name in config.profiles)) return Effect.succeed(false);
|
|
87
|
+
delete config.profiles[name];
|
|
88
|
+
return writeConfig(config).pipe(Effect.as(true));
|
|
89
|
+
}));
|
|
90
|
+
const loadOrConfigure = (auth, profileName, ctx) => Effect.flatMap(getProfile(profileName), (existing) => existing?.[auth.name] ? Effect.succeed(existing[auth.name]) : Effect.tap(auth.configure(profileName, ctx), (config) => setProfile(profileName, {
|
|
91
|
+
...existing,
|
|
92
|
+
[auth.name]: config
|
|
93
|
+
})));
|
|
94
|
+
return {
|
|
95
|
+
readConfig,
|
|
96
|
+
writeConfig,
|
|
97
|
+
getProfile,
|
|
98
|
+
setProfile,
|
|
99
|
+
deleteProfile,
|
|
100
|
+
loadOrConfigure
|
|
101
|
+
};
|
|
102
|
+
}));
|
|
103
|
+
/**
|
|
104
|
+
* Returns a `ConfigProvider` that overrides `ALCHEMY_PROFILE` with the
|
|
105
|
+
* given `profile` (when explicitly passed via the CLI `--profile` flag),
|
|
106
|
+
* falling through to `base` for everything else.
|
|
107
|
+
*
|
|
108
|
+
* Use this to let the CLI's `--profile <name>` win over `$ALCHEMY_PROFILE`
|
|
109
|
+
* without disturbing other config lookups.
|
|
110
|
+
*/
|
|
111
|
+
const withProfileOverride = (base, profile$1) => {
|
|
112
|
+
if (profile$1 === void 0) return base;
|
|
113
|
+
const overrides = { ALCHEMY_PROFILE: profile$1 };
|
|
114
|
+
const overrideProvider = ConfigProvider.make((path$1) => Effect.succeed(path$1.length === 1 && typeof path$1[0] === "string" && path$1[0] in overrides ? ConfigProvider.makeValue(overrides[path$1[0]]) : void 0));
|
|
115
|
+
return ConfigProvider.orElse(base)(overrideProvider);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region lib/Auth/Credentials.js
|
|
120
|
+
const credentialsDirPath = path.join(rootDir, "credentials");
|
|
121
|
+
const profileCredentialsDirPath = (profile$1) => path.join(credentialsDirPath, profile$1);
|
|
122
|
+
const credentialsFilePath = (profile$1, provider) => path.join(profileCredentialsDirPath(profile$1), `${provider}.json`);
|
|
123
|
+
var CredentialsStore = class extends EffectContext.Service()("Alchemy::CredentialsStore") {};
|
|
124
|
+
const CredentialsStoreLive = Layer.effect(CredentialsStore, Effect.gen(function* () {
|
|
125
|
+
const fs = yield* FileSystem.FileSystem;
|
|
126
|
+
const read = (profile$1, provider) => fs.readFileString(credentialsFilePath(profile$1, provider)).pipe(Effect.catch(() => Effect.succeed(void 0)), Effect.map((data) => {
|
|
127
|
+
if (data === void 0) return void 0;
|
|
128
|
+
try {
|
|
129
|
+
return JSON.parse(data);
|
|
130
|
+
} catch {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
}));
|
|
134
|
+
const write = (profile$1, provider, credentials) => {
|
|
135
|
+
const filePath = credentialsFilePath(profile$1, provider);
|
|
136
|
+
return fs.makeDirectory(path.dirname(filePath), { recursive: true }).pipe(Effect.flatMap(() => fs.writeFileString(filePath, JSON.stringify(credentials, null, 2))));
|
|
137
|
+
};
|
|
138
|
+
const remove_ = (profile$1, provider) => fs.remove(credentialsFilePath(profile$1, provider)).pipe(Effect.catch(() => Effect.void));
|
|
139
|
+
const deleteProfile = (profile$1) => fs.remove(profileCredentialsDirPath(profile$1), { recursive: true }).pipe(Effect.catch(() => Effect.void));
|
|
140
|
+
return {
|
|
141
|
+
read,
|
|
142
|
+
write,
|
|
143
|
+
delete: remove_,
|
|
144
|
+
deleteProfile
|
|
145
|
+
};
|
|
146
|
+
}));
|
|
147
|
+
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region lib/Util/LocalhostDns.js
|
|
150
|
+
let installed = false;
|
|
151
|
+
const isLocalhost = (hostname) => hostname === "localhost" || hostname === "[::1]" || hostname.endsWith(".localhost");
|
|
152
|
+
const installLocalhostDns = () => {
|
|
153
|
+
if (installed) return;
|
|
154
|
+
installed = true;
|
|
155
|
+
if (typeof globalThis.Bun !== "undefined") return;
|
|
156
|
+
try {
|
|
157
|
+
const require = createRequire(import.meta.url);
|
|
158
|
+
const undici = require("undici");
|
|
159
|
+
const dns = require("node:dns");
|
|
160
|
+
undici.setGlobalDispatcher(new undici.Agent({ connect: { lookup: (hostname, options, cb) => {
|
|
161
|
+
if (isLocalhost(hostname)) {
|
|
162
|
+
if (options && options.all) return cb(null, [{
|
|
163
|
+
address: "127.0.0.1",
|
|
164
|
+
family: 4
|
|
165
|
+
}]);
|
|
166
|
+
return cb(null, "127.0.0.1", 4);
|
|
167
|
+
}
|
|
168
|
+
return dns.lookup(hostname, options, cb);
|
|
169
|
+
} } }));
|
|
170
|
+
} catch {}
|
|
171
|
+
};
|
|
172
|
+
|
|
48
173
|
//#endregion
|
|
49
174
|
//#region lib/Util/PlatformServices.js
|
|
50
175
|
const isBun = typeof Bun !== "undefined";
|
|
@@ -58,6 +183,7 @@ const PlatformServices = Effect.promise(async () => {
|
|
|
58
183
|
}
|
|
59
184
|
}).pipe(Layer.unwrap);
|
|
60
185
|
const runMain = (effect, options) => {
|
|
186
|
+
installLocalhostDns();
|
|
61
187
|
if (isBun) import("@effect/platform-bun/BunRuntime").then((BunRuntime) => BunRuntime.runMain(effect, options));
|
|
62
188
|
else import("@effect/platform-node/NodeRuntime").then((NodeRuntime) => NodeRuntime.runMain(effect, options));
|
|
63
189
|
};
|
|
@@ -333,44 +459,6 @@ const GenericService = () => (Kind) => {
|
|
|
333
459
|
return Object.assign(Object.setPrototypeOf(make$2, service), service);
|
|
334
460
|
};
|
|
335
461
|
|
|
336
|
-
//#endregion
|
|
337
|
-
//#region lib/Auth/Profile.js
|
|
338
|
-
const rootDir = path.join(os.homedir(), ".alchemy");
|
|
339
|
-
const configFilePath = path.join(rootDir, "profiles.json");
|
|
340
|
-
/**
|
|
341
|
-
* Config key consulted by the various `fromAuthProvider` /
|
|
342
|
-
* `fromEnvironment` layers to pick which named profile in
|
|
343
|
-
* `~/.alchemy/profiles.json` to use. Defaults to `"default"`.
|
|
344
|
-
*/
|
|
345
|
-
const ALCHEMY_PROFILE = Config.string("ALCHEMY_PROFILE").pipe(Config.withDefault("default"));
|
|
346
|
-
const CONFIG_VERSION = 0;
|
|
347
|
-
const emptyConfig = () => ({
|
|
348
|
-
version: CONFIG_VERSION,
|
|
349
|
-
profiles: {}
|
|
350
|
-
});
|
|
351
|
-
const readConfig = FileSystem.FileSystem.asEffect().pipe(Effect.flatMap((fs) => fs.readFileString(configFilePath)), Effect.flatMap((data) => Effect.try({
|
|
352
|
-
try: () => {
|
|
353
|
-
const parsed = JSON.parse(data);
|
|
354
|
-
if (parsed?.version !== CONFIG_VERSION) return emptyConfig();
|
|
355
|
-
return parsed;
|
|
356
|
-
},
|
|
357
|
-
catch: emptyConfig
|
|
358
|
-
})), Effect.orElseSucceed(emptyConfig));
|
|
359
|
-
/**
|
|
360
|
-
* Returns a `ConfigProvider` that overrides `ALCHEMY_PROFILE` with the
|
|
361
|
-
* given `profile` (when explicitly passed via the CLI `--profile` flag),
|
|
362
|
-
* falling through to `base` for everything else.
|
|
363
|
-
*
|
|
364
|
-
* Use this to let the CLI's `--profile <name>` win over `$ALCHEMY_PROFILE`
|
|
365
|
-
* without disturbing other config lookups.
|
|
366
|
-
*/
|
|
367
|
-
const withProfileOverride = (base, profile$1) => {
|
|
368
|
-
if (profile$1 === void 0) return base;
|
|
369
|
-
const overrides = { ALCHEMY_PROFILE: profile$1 };
|
|
370
|
-
const overrideProvider = ConfigProvider.make((path$1) => Effect.succeed(path$1.length === 1 && typeof path$1[0] === "string" && path$1[0] in overrides ? ConfigProvider.makeValue(overrides[path$1[0]]) : void 0));
|
|
371
|
-
return ConfigProvider.orElse(base)(overrideProvider);
|
|
372
|
-
};
|
|
373
|
-
|
|
374
462
|
//#endregion
|
|
375
463
|
//#region lib/Auth/AuthProvider.js
|
|
376
464
|
var AuthProviders = class extends EffectContext.Service()("AuthProviders") {};
|
|
@@ -391,16 +479,16 @@ const loadConfigProvider = (envFile$1) => {
|
|
|
391
479
|
|
|
392
480
|
//#endregion
|
|
393
481
|
//#region lib/Util/effect.js
|
|
394
|
-
const taggedFunction = (tag, fn) => {
|
|
482
|
+
const taggedFunction = (tag$1, fn) => {
|
|
395
483
|
const overrides = {
|
|
396
|
-
asEffect: () => tag.asEffect(),
|
|
397
|
-
[Symbol.iterator]: () => tag[Symbol.iterator](),
|
|
398
|
-
pipe: (...fns) => pipeArguments(tag.asEffect(), fns),
|
|
399
|
-
toString: () => `${tag.toString()}.${fn.name}`
|
|
484
|
+
asEffect: () => tag$1.asEffect(),
|
|
485
|
+
[Symbol.iterator]: () => tag$1[Symbol.iterator](),
|
|
486
|
+
pipe: (...fns) => pipeArguments(tag$1.asEffect(), fns),
|
|
487
|
+
toString: () => `${tag$1.toString()}.${fn.name}`
|
|
400
488
|
};
|
|
401
489
|
return new Proxy(fn, {
|
|
402
|
-
get: (target, prop, receiver) => Reflect.has(overrides, prop) ? Reflect.get(overrides, prop, receiver) : Reflect.has(target, prop) ? Reflect.get(target, prop, receiver) : Reflect.get(tag, prop, tag),
|
|
403
|
-
has: (target, prop) => Reflect.has(overrides, prop) || Reflect.has(target, prop) || Reflect.has(tag, prop)
|
|
490
|
+
get: (target, prop, receiver) => Reflect.has(overrides, prop) ? Reflect.get(overrides, prop, receiver) : Reflect.has(target, prop) ? Reflect.get(target, prop, receiver) : Reflect.get(tag$1, prop, tag$1),
|
|
491
|
+
has: (target, prop) => Reflect.has(overrides, prop) || Reflect.has(target, prop) || Reflect.has(tag$1, prop)
|
|
404
492
|
});
|
|
405
493
|
};
|
|
406
494
|
|
|
@@ -445,7 +533,7 @@ const make$1 = (options) => (effect) => Effect.scope.pipe(Effect.flatMap((scope)
|
|
|
445
533
|
services: EffectContext.merge(services$1, context)
|
|
446
534
|
})), Effect.provideContext(context))));
|
|
447
535
|
const CurrentStack = Effect.serviceOption(Stack).asEffect().pipe(Effect.map(Option.getOrUndefined));
|
|
448
|
-
const platform = Layer.mergeAll(PlatformServices, FetchHttpClient.layer, Logger.layer([fileLogger("out")], { mergeWithExisting: true }));
|
|
536
|
+
const platform = Layer.mergeAll(PlatformServices, FetchHttpClient.layer, Logger.layer([fileLogger("out")], { mergeWithExisting: true }), Layer.provide(ProfileLive, PlatformServices), Layer.provide(CredentialsStoreLive, PlatformServices));
|
|
449
537
|
|
|
450
538
|
//#endregion
|
|
451
539
|
//#region lib/Resource.js
|
|
@@ -920,7 +1008,7 @@ const make = (stack, options = {}) => Effect.gen(function* () {
|
|
|
920
1008
|
const ctx = yield* Effect.serviceOption(AlchemyContext);
|
|
921
1009
|
return Option.match(ctx, {
|
|
922
1010
|
onNone: () => false,
|
|
923
|
-
onSome: (c) => c.adopt
|
|
1011
|
+
onSome: (c$1) => c$1.adopt
|
|
924
1012
|
});
|
|
925
1013
|
});
|
|
926
1014
|
const resourceFqns = yield* state.list({
|
|
@@ -2067,6 +2155,99 @@ const planCommand = Command.make("plan", {
|
|
|
2067
2155
|
dryRun: true
|
|
2068
2156
|
})));
|
|
2069
2157
|
|
|
2158
|
+
//#endregion
|
|
2159
|
+
//#region lib/Cli/LoggingCli.js
|
|
2160
|
+
const ESC = "\x1B[";
|
|
2161
|
+
const RESET = `${ESC}0m`;
|
|
2162
|
+
const useColor = process.stdout.hasColors?.() ?? !!process.stdout.isTTY;
|
|
2163
|
+
const c = (code, s) => useColor ? `${ESC}${code}m${s}${RESET}` : s;
|
|
2164
|
+
const dim = (s) => c("2", s);
|
|
2165
|
+
const bold = (s) => c("1", s);
|
|
2166
|
+
const red = (s) => c("31", s);
|
|
2167
|
+
const green = (s) => c("32", s);
|
|
2168
|
+
const yellow = (s) => c("33", s);
|
|
2169
|
+
const blue = (s) => c("34", s);
|
|
2170
|
+
const magenta = (s) => c("35", s);
|
|
2171
|
+
const cyan = (s) => c("36", s);
|
|
2172
|
+
const actionColor$1 = {
|
|
2173
|
+
create: green,
|
|
2174
|
+
update: yellow,
|
|
2175
|
+
replace: magenta,
|
|
2176
|
+
delete: red,
|
|
2177
|
+
noop: dim
|
|
2178
|
+
};
|
|
2179
|
+
const statusColor$1 = (status) => {
|
|
2180
|
+
switch (status) {
|
|
2181
|
+
case "created":
|
|
2182
|
+
case "updated":
|
|
2183
|
+
case "replaced": return green;
|
|
2184
|
+
case "deleted": return dim;
|
|
2185
|
+
case "fail": return red;
|
|
2186
|
+
case "attaching":
|
|
2187
|
+
case "post-attach": return cyan;
|
|
2188
|
+
default: return yellow;
|
|
2189
|
+
}
|
|
2190
|
+
};
|
|
2191
|
+
const tag = (id) => bold(`[${id}]`);
|
|
2192
|
+
const isTerminal = (status) => status === "created" || status === "updated" || status === "deleted" || status === "replaced" || status === "fail";
|
|
2193
|
+
const formatPlanLines = (plan) => {
|
|
2194
|
+
const items = [...Object.values(plan.resources), ...Object.values(plan.deletions)];
|
|
2195
|
+
if (items.length === 0) return [bold("Plan:") + " no changes"];
|
|
2196
|
+
const counts = items.reduce((acc, item) => (acc[item.action] = (acc[item.action] ?? 0) + 1, acc), {});
|
|
2197
|
+
const summary = [
|
|
2198
|
+
"create",
|
|
2199
|
+
"update",
|
|
2200
|
+
"replace",
|
|
2201
|
+
"delete",
|
|
2202
|
+
"noop"
|
|
2203
|
+
].filter((a) => counts[a]).map((a) => actionColor$1[a](`${counts[a]} to ${a}`)).join(dim(", "));
|
|
2204
|
+
const sorted = [...items].sort((a, b) => a.resource.LogicalId.localeCompare(b.resource.LogicalId));
|
|
2205
|
+
const lines = [`${bold("Plan:")} ${summary}`];
|
|
2206
|
+
for (const item of sorted) {
|
|
2207
|
+
const action = actionColor$1[item.action](item.action);
|
|
2208
|
+
lines.push(`${tag(item.resource.LogicalId)} ${action}`);
|
|
2209
|
+
for (const binding of item.bindings) {
|
|
2210
|
+
if (binding.action === "noop") continue;
|
|
2211
|
+
const bindingAction = actionColor$1[binding.action](binding.action);
|
|
2212
|
+
lines.push(`${tag(`${item.resource.LogicalId}/${binding.sid}`)} ${bindingAction}`);
|
|
2213
|
+
}
|
|
2214
|
+
}
|
|
2215
|
+
return lines;
|
|
2216
|
+
};
|
|
2217
|
+
const LoggingCli = Layer.succeed(Cli, Cli.of({
|
|
2218
|
+
approvePlan: (plan) => Effect.gen(function* () {
|
|
2219
|
+
for (const line of formatPlanLines(plan)) yield* Console.log(line);
|
|
2220
|
+
yield* Console.log(`\n${yellow("Non-interactive terminal detected.")} Pass ${bold("--yes")} to approve, or set ${bold("ALCHEMY_TUI=1")} for the interactive UI.`);
|
|
2221
|
+
return false;
|
|
2222
|
+
}),
|
|
2223
|
+
displayPlan: (plan) => Effect.gen(function* () {
|
|
2224
|
+
for (const line of formatPlanLines(plan)) yield* Console.log(line);
|
|
2225
|
+
}),
|
|
2226
|
+
startApplySession: (plan) => Effect.gen(function* () {
|
|
2227
|
+
for (const line of formatPlanLines(plan)) yield* Console.log(line);
|
|
2228
|
+
yield* Console.log("");
|
|
2229
|
+
const counts = {
|
|
2230
|
+
ok: 0,
|
|
2231
|
+
fail: 0
|
|
2232
|
+
};
|
|
2233
|
+
return {
|
|
2234
|
+
emit: (event) => Effect.sync(() => {
|
|
2235
|
+
if (event.kind === "annotate") {
|
|
2236
|
+
console.log(`${tag(event.id)} ${blue(event.message)}`);
|
|
2237
|
+
return;
|
|
2238
|
+
}
|
|
2239
|
+
const id = event.bindingId ? `${event.id}/${event.bindingId}` : event.id;
|
|
2240
|
+
const status = statusColor$1(event.status)(event.status);
|
|
2241
|
+
const msg = event.message ? ` ${dim("—")} ${event.message}` : "";
|
|
2242
|
+
console.log(`${tag(id)} ${status}${msg}`);
|
|
2243
|
+
if (isTerminal(event.status)) if (event.status === "fail") counts.fail++;
|
|
2244
|
+
else counts.ok++;
|
|
2245
|
+
}),
|
|
2246
|
+
done: () => Console.log(`\n${bold("Done:")} ${green(`${counts.ok} succeeded`)}${counts.fail ? dim(", ") + red(`${counts.fail} failed`) : ""}`)
|
|
2247
|
+
};
|
|
2248
|
+
})
|
|
2249
|
+
}));
|
|
2250
|
+
|
|
2070
2251
|
//#endregion
|
|
2071
2252
|
//#region lib/Cli/NamespaceTree.js
|
|
2072
2253
|
function buildNamespaceTree(items) {
|
|
@@ -2611,9 +2792,29 @@ const startApplySession = Effect.fn(function* (plan) {
|
|
|
2611
2792
|
};
|
|
2612
2793
|
});
|
|
2613
2794
|
|
|
2795
|
+
//#endregion
|
|
2796
|
+
//#region lib/Cli/selectCli.js
|
|
2797
|
+
/**
|
|
2798
|
+
* Returns true when the current process looks like it's being driven by a
|
|
2799
|
+
* coding agent, CI runner, or anything else that won't render an interactive
|
|
2800
|
+
* TUI well. The Ink renderer repaints the screen on every event, which floods
|
|
2801
|
+
* agent transcripts with redundant frames; LoggingCli emits one line per
|
|
2802
|
+
* status change instead.
|
|
2803
|
+
*/
|
|
2804
|
+
const isNonInteractive = () => {
|
|
2805
|
+
const env = process.env;
|
|
2806
|
+
if (env.ALCHEMY_PLAIN === "1" || env.ALCHEMY_NO_TUI === "1") return true;
|
|
2807
|
+
if (env.ALCHEMY_TUI === "1") return false;
|
|
2808
|
+
if (!process.stdout.isTTY) return true;
|
|
2809
|
+
if (env.CI) return true;
|
|
2810
|
+
if (env.CLAUDECODE || env.CLAUDE_CODE_ENTRYPOINT || env.CURSOR_AGENT || env.AIDER_MODEL || env.CODEX_CLI) return true;
|
|
2811
|
+
return false;
|
|
2812
|
+
};
|
|
2813
|
+
const selectCli = () => isNonInteractive() ? LoggingCli : inkCLI();
|
|
2814
|
+
|
|
2614
2815
|
//#endregion
|
|
2615
2816
|
//#region lib/Cli/exec.js
|
|
2616
|
-
const services = Layer.mergeAll(Layer.provideMerge(AlchemyContextLive, PlatformServices), FetchHttpClient.layer, ConfigProvider.layer(ConfigProvider.fromEnv()),
|
|
2817
|
+
const services = Layer.mergeAll(Layer.provideMerge(AlchemyContextLive, PlatformServices), Layer.provide(ProfileLive, PlatformServices), Layer.provide(CredentialsStoreLive, PlatformServices), FetchHttpClient.layer, ConfigProvider.layer(ConfigProvider.fromEnv()), selectCli());
|
|
2617
2818
|
const exec = () => execStack(S.decodeSync(ExecStackOptions)(JSON.parse(process.env.ALCHEMY_EXEC_OPTIONS))).pipe(Effect.provide(services), Effect.scoped);
|
|
2618
2819
|
|
|
2619
2820
|
//#endregion
|