alchemy 2.0.0-beta.37 → 2.0.0-beta.39
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 +488 -69
- 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 +7 -11
- 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 +222 -3
- 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/AnalyticsEngineDatasetBinding.js +1 -1
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js.map +1 -1
- 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/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/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 +6 -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/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 +1 -1
- package/lib/Cloudflare/StateStore/State.d.ts +2 -2
- 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/HttpServer.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/HttpServer.js +25 -3
- package/lib/Cloudflare/Workers/HttpServer.js.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/Worker.d.ts +4 -3
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +67 -32
- 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 +4 -6
- package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerName.d.ts +1 -1
- package/lib/Cloudflare/Workers/Workflow.js +2 -2
- package/lib/Cloudflare/Workers/Workflow.js.map +1 -1
- 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/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 +1 -1
- package/lib/Destroy.d.ts +1 -1
- package/lib/Destroy.d.ts.map +1 -1
- package/lib/Destroy.js +1 -0
- 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 +3 -4
- package/lib/Output.d.ts.map +1 -1
- package/lib/Output.js +7 -4
- 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 +197 -31
- package/lib/Plan.js.map +1 -1
- package/lib/Platform.js +6 -6
- 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/Resource.d.ts.map +1 -1
- package/lib/Resource.js +2 -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/Secret.js +1 -1
- package/lib/Secret.js.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 +7 -2
- package/lib/Stack.d.ts.map +1 -1
- package/lib/Stack.js +4 -4
- 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/HttpStateStore.d.ts.map +1 -1
- package/lib/State/HttpStateStore.js +1 -1
- package/lib/State/HttpStateStore.js.map +1 -1
- package/lib/State/InMemoryState.d.ts.map +1 -1
- package/lib/State/InMemoryState.js.map +1 -1
- package/lib/State/LocalState.d.ts +2 -2
- package/lib/State/ResourceState.d.ts +5 -0
- package/lib/State/ResourceState.d.ts.map +1 -1
- package/lib/State/State.d.ts +10 -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/Core.d.ts +2 -2
- package/lib/Test/Core.d.ts.map +1 -1
- package/lib/Test/Core.js +4 -1
- package/lib/Test/Core.js.map +1 -1
- package/lib/Util/FileLogger.d.ts +1 -1
- package/lib/Util/effect.js +4 -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/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +22 -28
- 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 +31 -35
- 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 +351 -23
- 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/AnalyticsEngineDatasetBinding.ts +1 -1
- 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/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/SidecarServer.ts +1 -1
- package/src/Cloudflare/Providers.ts +9 -0
- package/src/Cloudflare/Queue/QueueBinding.ts +1 -1
- package/src/Cloudflare/R2/R2BucketBinding.ts +1 -1
- package/src/Cloudflare/SecretsStore/SecretBinding.ts +1 -1
- package/src/Cloudflare/Workers/Assets.ts +5 -6
- package/src/Cloudflare/Workers/HttpServer.ts +37 -5
- package/src/Cloudflare/Workers/InferEnv.ts +15 -11
- package/src/Cloudflare/Workers/Worker.ts +78 -36
- package/src/Cloudflare/Workers/WorkerBundle.ts +4 -6
- package/src/Cloudflare/Workers/Workflow.ts +2 -2
- package/src/Cloudflare/index.ts +1 -0
- package/src/Construct.ts +3 -7
- package/src/Destroy.ts +1 -0
- 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 +9 -7
- package/src/Plan.ts +303 -53
- package/src/Platform.ts +7 -7
- package/src/Provider.ts +8 -3
- package/src/Random.ts +1 -1
- package/src/Resource.ts +2 -25
- package/src/Runtime.ts +38 -0
- package/src/Secret.ts +1 -1
- package/src/Stack.ts +10 -6
- package/src/State/ActionState.ts +51 -0
- package/src/State/HttpStateStore.ts +6 -2
- package/src/State/InMemoryState.ts +3 -3
- package/src/State/ResourceState.ts +5 -0
- package/src/State/State.ts +17 -2
- package/src/State/index.ts +1 -0
- package/src/Test/Core.ts +4 -3
- package/src/Util/effect.ts +4 -4
- package/src/Util/hash.ts +14 -0
- package/src/Util/ignore.ts +815 -0
- package/src/index.ts +6 -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/src/Cli/NamespaceTree.ts
CHANGED
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
import { toPath } from "../FQN.ts";
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
BindingAction,
|
|
4
|
+
CRUD,
|
|
5
|
+
ActionApply,
|
|
6
|
+
ActionDelete,
|
|
7
|
+
} from "../Plan.ts";
|
|
3
8
|
|
|
4
9
|
export interface TreeBinding {
|
|
5
10
|
sid: string;
|
|
6
11
|
action: BindingAction;
|
|
7
12
|
}
|
|
8
13
|
|
|
14
|
+
export type ActionTreeItem = ActionApply | ActionDelete;
|
|
15
|
+
export type ActionVerb = ActionTreeItem["action"]; // "run" | "noop" | "delete"
|
|
16
|
+
|
|
9
17
|
/**
|
|
10
18
|
* A tree node representing a namespace.
|
|
11
|
-
* Resources live directly inside the namespace where they were
|
|
19
|
+
* Resources and tasks live directly inside the namespace where they were
|
|
20
|
+
* created.
|
|
12
21
|
*/
|
|
13
22
|
export interface TreeNode {
|
|
14
23
|
id: string;
|
|
15
24
|
path: string[];
|
|
16
25
|
children: Map<string, TreeNode>;
|
|
17
26
|
resources: CRUD[];
|
|
27
|
+
actions: ActionTreeItem[];
|
|
18
28
|
}
|
|
19
29
|
|
|
20
30
|
export type DerivedAction =
|
|
@@ -25,12 +35,16 @@ export type DerivedAction =
|
|
|
25
35
|
| "noop"
|
|
26
36
|
| "mixed";
|
|
27
37
|
|
|
28
|
-
export function buildNamespaceTree(
|
|
38
|
+
export function buildNamespaceTree(
|
|
39
|
+
items: CRUD[],
|
|
40
|
+
actions: ReadonlyArray<ActionTreeItem> = [],
|
|
41
|
+
): TreeNode {
|
|
29
42
|
const root: TreeNode = {
|
|
30
43
|
id: "",
|
|
31
44
|
path: [],
|
|
32
45
|
children: new Map(),
|
|
33
46
|
resources: [],
|
|
47
|
+
actions: [],
|
|
34
48
|
};
|
|
35
49
|
|
|
36
50
|
const getNode = (path: string[]) => {
|
|
@@ -44,6 +58,7 @@ export function buildNamespaceTree(items: CRUD[]): TreeNode {
|
|
|
44
58
|
path: path.slice(0, i + 1),
|
|
45
59
|
children: new Map(),
|
|
46
60
|
resources: [],
|
|
61
|
+
actions: [],
|
|
47
62
|
};
|
|
48
63
|
current.children.set(segment, child);
|
|
49
64
|
}
|
|
@@ -55,6 +70,9 @@ export function buildNamespaceTree(items: CRUD[]): TreeNode {
|
|
|
55
70
|
for (const item of items) {
|
|
56
71
|
getNode(toPath(item.resource.Namespace)).resources.push(item);
|
|
57
72
|
}
|
|
73
|
+
for (const action of actions) {
|
|
74
|
+
getNode(toPath(action.def.Namespace)).actions.push(action);
|
|
75
|
+
}
|
|
58
76
|
|
|
59
77
|
return root;
|
|
60
78
|
}
|
|
@@ -65,6 +83,17 @@ export function deriveNamespaceAction(node: TreeNode): DerivedAction {
|
|
|
65
83
|
for (const resource of node.resources) {
|
|
66
84
|
actions.add(deriveResourceChildrenAction(resource, node));
|
|
67
85
|
}
|
|
86
|
+
for (const action of node.actions) {
|
|
87
|
+
// Map task actions onto the resource action space for the rollup:
|
|
88
|
+
// run → create, delete → delete, noop → noop.
|
|
89
|
+
actions.add(
|
|
90
|
+
action.action === "run"
|
|
91
|
+
? "create"
|
|
92
|
+
: action.action === "delete"
|
|
93
|
+
? "delete"
|
|
94
|
+
: "noop",
|
|
95
|
+
);
|
|
96
|
+
}
|
|
68
97
|
for (const child of node.children.values()) {
|
|
69
98
|
const childAction = deriveNamespaceAction(child);
|
|
70
99
|
if (childAction === "mixed") {
|
|
@@ -77,15 +106,17 @@ export function deriveNamespaceAction(node: TreeNode): DerivedAction {
|
|
|
77
106
|
}
|
|
78
107
|
|
|
79
108
|
export interface FlattenedItem {
|
|
80
|
-
type: "namespace" | "resource" | "binding";
|
|
109
|
+
type: "namespace" | "resource" | "binding" | "action";
|
|
81
110
|
depth: number;
|
|
82
111
|
id: string;
|
|
83
112
|
path: string[];
|
|
84
|
-
action: CRUD["action"] | BindingAction | DerivedAction;
|
|
113
|
+
action: CRUD["action"] | BindingAction | DerivedAction | ActionVerb;
|
|
85
114
|
resourceType?: string;
|
|
86
115
|
bindingSid?: string;
|
|
87
116
|
bindingCount?: number;
|
|
88
117
|
hasChildren?: boolean;
|
|
118
|
+
/** For task items, the Task's Type (e.g. "Sync"). */
|
|
119
|
+
actionType?: string;
|
|
89
120
|
}
|
|
90
121
|
|
|
91
122
|
export function flattenTree(
|
|
@@ -154,10 +185,26 @@ const flattenNamespace = (
|
|
|
154
185
|
flattenNamespace(childNamespace, depth + 1, result);
|
|
155
186
|
}
|
|
156
187
|
}
|
|
188
|
+
|
|
189
|
+
// Actions are listed after resources at the same depth.
|
|
190
|
+
const sortedActions = [...node.actions].sort((a, b) =>
|
|
191
|
+
a.def.LogicalId.localeCompare(b.def.LogicalId),
|
|
192
|
+
);
|
|
193
|
+
for (const action of sortedActions) {
|
|
194
|
+
result.push({
|
|
195
|
+
type: "action",
|
|
196
|
+
depth,
|
|
197
|
+
id: action.def.LogicalId,
|
|
198
|
+
path: [...node.path, action.def.LogicalId],
|
|
199
|
+
action: action.action,
|
|
200
|
+
actionType: action.def.Type,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
157
203
|
};
|
|
158
204
|
|
|
159
205
|
const isEmpty = (node: TreeNode) =>
|
|
160
206
|
node.resources.length === 0 &&
|
|
207
|
+
node.actions.length === 0 &&
|
|
161
208
|
Array.from(node.children.values()).every(isEmpty);
|
|
162
209
|
|
|
163
210
|
const countVisibleChildren = (node: TreeNode) => {
|
|
@@ -21,7 +21,7 @@ export const USER = Config.string("USER").pipe(
|
|
|
21
21
|
|
|
22
22
|
export const STAGE = Config.string("stage").pipe(
|
|
23
23
|
Config.option,
|
|
24
|
-
(a) => a
|
|
24
|
+
(a) => a,
|
|
25
25
|
Effect.map(Option.getOrUndefined),
|
|
26
26
|
);
|
|
27
27
|
|
|
@@ -96,7 +96,7 @@ export const stage = Flag.string("stage").pipe(
|
|
|
96
96
|
),
|
|
97
97
|
Effect.flatMap((s) =>
|
|
98
98
|
s === undefined
|
|
99
|
-
? USER.
|
|
99
|
+
? USER.pipe(
|
|
100
100
|
Effect.map((user) => `dev_${user}`),
|
|
101
101
|
Effect.catch(() => Effect.succeed("unknown")),
|
|
102
102
|
)
|
package/src/Cli/commands/logs.ts
CHANGED
|
@@ -119,16 +119,16 @@ export const logsCommand = Command.make(
|
|
|
119
119
|
stage: stack.stage,
|
|
120
120
|
fqn,
|
|
121
121
|
});
|
|
122
|
-
if (!resourceState?.attr) continue;
|
|
122
|
+
if (!(resourceState as any)?.attr) continue;
|
|
123
123
|
|
|
124
124
|
const provider = yield* findProviderByType(resource.Type);
|
|
125
125
|
if (!provider.logs) continue;
|
|
126
126
|
|
|
127
127
|
const lines = yield* provider.logs({
|
|
128
128
|
id: resource.LogicalId,
|
|
129
|
-
instanceId: resourceState.instanceId,
|
|
130
|
-
props: resourceState
|
|
131
|
-
output: resourceState
|
|
129
|
+
instanceId: (resourceState as any).instanceId,
|
|
130
|
+
props: (resourceState as any).props,
|
|
131
|
+
output: (resourceState as any).attr,
|
|
132
132
|
options: { limit, since: sinceDate },
|
|
133
133
|
});
|
|
134
134
|
|
package/src/Cli/commands/tail.ts
CHANGED
|
@@ -95,7 +95,7 @@ export const tailCommand = Command.make(
|
|
|
95
95
|
stage: stack.stage,
|
|
96
96
|
fqn,
|
|
97
97
|
});
|
|
98
|
-
if (!resourceState?.attr) continue;
|
|
98
|
+
if (!(resourceState as any)?.attr) continue;
|
|
99
99
|
|
|
100
100
|
const provider = yield* findProviderByType(resource.Type);
|
|
101
101
|
if (!provider.tail) continue;
|
|
@@ -104,9 +104,9 @@ export const tailCommand = Command.make(
|
|
|
104
104
|
logicalId: resource.LogicalId,
|
|
105
105
|
stream: provider.tail({
|
|
106
106
|
id: resource.LogicalId,
|
|
107
|
-
instanceId: resourceState.instanceId,
|
|
108
|
-
props: resourceState
|
|
109
|
-
output: resourceState
|
|
107
|
+
instanceId: (resourceState as any).instanceId,
|
|
108
|
+
props: (resourceState as any).props,
|
|
109
|
+
output: (resourceState as any).attr,
|
|
110
110
|
}),
|
|
111
111
|
});
|
|
112
112
|
}
|
|
@@ -6,11 +6,14 @@ import type {
|
|
|
6
6
|
Plan as AlchemyPlan,
|
|
7
7
|
BindingAction,
|
|
8
8
|
CRUD,
|
|
9
|
+
ActionApply,
|
|
10
|
+
ActionDelete,
|
|
9
11
|
} from "../../../Plan.ts";
|
|
10
12
|
import {
|
|
11
13
|
buildNamespaceTree,
|
|
12
14
|
flattenTree,
|
|
13
15
|
type DerivedAction,
|
|
16
|
+
type ActionVerb,
|
|
14
17
|
} from "../../NamespaceTree.ts";
|
|
15
18
|
|
|
16
19
|
export interface PlanProps {
|
|
@@ -25,13 +28,21 @@ export function Plan({ plan }: PlanProps): JSX.Element {
|
|
|
25
28
|
] as CRUD[],
|
|
26
29
|
[plan],
|
|
27
30
|
);
|
|
31
|
+
const taskItems = useMemo(
|
|
32
|
+
() =>
|
|
33
|
+
[
|
|
34
|
+
...Object.values(plan.actions ?? {}),
|
|
35
|
+
...Object.values(plan.actionDeletions ?? {}),
|
|
36
|
+
].filter((t): t is ActionApply | ActionDelete => t !== undefined),
|
|
37
|
+
[plan],
|
|
38
|
+
);
|
|
28
39
|
|
|
29
40
|
const flatItems = useMemo(() => {
|
|
30
|
-
const tree = buildNamespaceTree(items);
|
|
41
|
+
const tree = buildNamespaceTree(items, taskItems);
|
|
31
42
|
return flattenTree(tree);
|
|
32
|
-
}, [items]);
|
|
43
|
+
}, [items, taskItems]);
|
|
33
44
|
|
|
34
|
-
if (items.length === 0) {
|
|
45
|
+
if (items.length === 0 && taskItems.length === 0) {
|
|
35
46
|
return <Text color="gray">No changes planned</Text>;
|
|
36
47
|
}
|
|
37
48
|
|
|
@@ -42,31 +53,46 @@ export function Plan({ plan }: PlanProps): JSX.Element {
|
|
|
42
53
|
noop: 0,
|
|
43
54
|
replace: 0,
|
|
44
55
|
});
|
|
56
|
+
const taskCounts = taskItems.reduce(
|
|
57
|
+
(acc, item) => (acc[item.action]++, acc),
|
|
58
|
+
{ run: 0, noop: 0, delete: 0 },
|
|
59
|
+
);
|
|
45
60
|
|
|
46
61
|
const actions = (["create", "update", "delete", "replace"] as const).filter(
|
|
47
62
|
(action) => counts[action] > 0,
|
|
48
63
|
);
|
|
64
|
+
const taskHeaderEntries = [
|
|
65
|
+
taskCounts.run > 0 ? `${taskCounts.run} to run` : undefined,
|
|
66
|
+
taskCounts.delete > 0 ? `${taskCounts.delete} to drop` : undefined,
|
|
67
|
+
].filter((s): s is string => !!s);
|
|
49
68
|
|
|
50
69
|
return (
|
|
51
70
|
<Box flexDirection="column">
|
|
52
71
|
<Box marginTop={1}>
|
|
53
72
|
<Text underline>Plan</Text>
|
|
54
73
|
<Text>: </Text>
|
|
55
|
-
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
74
|
+
{[
|
|
75
|
+
...actions.map((action) => {
|
|
76
|
+
const count = counts[action];
|
|
77
|
+
const color = actionColor(action);
|
|
78
|
+
return (
|
|
79
|
+
<Box key={action}>
|
|
80
|
+
<Text color={color}>
|
|
81
|
+
{count} to {action}
|
|
82
|
+
</Text>
|
|
83
|
+
</Box>
|
|
84
|
+
);
|
|
85
|
+
}),
|
|
86
|
+
...taskHeaderEntries.map((label, i) => (
|
|
87
|
+
<Box key={`task-${i}`}>
|
|
88
|
+
<Text color="cyan">{label}</Text>
|
|
64
89
|
</Box>
|
|
65
|
-
)
|
|
66
|
-
|
|
90
|
+
)),
|
|
91
|
+
].flatMap((box, i, arr) =>
|
|
92
|
+
i === arr.length - 1
|
|
67
93
|
? [box]
|
|
68
|
-
: [box, <Text key={
|
|
69
|
-
|
|
94
|
+
: [box, <Text key={`sep-${i}`}> | </Text>],
|
|
95
|
+
)}
|
|
70
96
|
</Box>
|
|
71
97
|
<Box flexDirection="column" marginTop={1}>
|
|
72
98
|
{flatItems.map((item) => {
|
|
@@ -99,6 +125,26 @@ export function Plan({ plan }: PlanProps): JSX.Element {
|
|
|
99
125
|
);
|
|
100
126
|
}
|
|
101
127
|
|
|
128
|
+
if (item.type === "action") {
|
|
129
|
+
return (
|
|
130
|
+
<Box key={key} flexDirection="row">
|
|
131
|
+
<Text>{indent}</Text>
|
|
132
|
+
<Box width={2}>
|
|
133
|
+
<Text color={color}>{icon} </Text>
|
|
134
|
+
</Box>
|
|
135
|
+
<Box>
|
|
136
|
+
<Text bold>{item.id}</Text>
|
|
137
|
+
</Box>
|
|
138
|
+
<Box marginLeft={1}>
|
|
139
|
+
<Text color="blackBright">({item.actionType})</Text>
|
|
140
|
+
</Box>
|
|
141
|
+
<Box marginLeft={1}>
|
|
142
|
+
<Text color="cyan">[action]</Text>
|
|
143
|
+
</Box>
|
|
144
|
+
</Box>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
102
148
|
// Resource item
|
|
103
149
|
return (
|
|
104
150
|
<Box key={key} flexDirection="row">
|
|
@@ -127,7 +173,7 @@ export function Plan({ plan }: PlanProps): JSX.Element {
|
|
|
127
173
|
|
|
128
174
|
type Color = Parameters<typeof Text>[0]["color"];
|
|
129
175
|
|
|
130
|
-
type AnyAction = CRUD["action"] | BindingAction | DerivedAction;
|
|
176
|
+
type AnyAction = CRUD["action"] | BindingAction | DerivedAction | ActionVerb;
|
|
131
177
|
|
|
132
178
|
const getActionColor = (action: AnyAction): Color =>
|
|
133
179
|
({
|
|
@@ -137,6 +183,7 @@ const getActionColor = (action: AnyAction): Color =>
|
|
|
137
183
|
delete: "red",
|
|
138
184
|
replace: "magenta",
|
|
139
185
|
mixed: "cyan",
|
|
186
|
+
run: "cyan",
|
|
140
187
|
})[action] ?? "gray";
|
|
141
188
|
|
|
142
189
|
const getActionIcon = (action: AnyAction): string =>
|
|
@@ -147,6 +194,7 @@ const getActionIcon = (action: AnyAction): string =>
|
|
|
147
194
|
noop: "•",
|
|
148
195
|
replace: "!",
|
|
149
196
|
mixed: "*",
|
|
197
|
+
run: "λ",
|
|
150
198
|
})[action] ?? "?";
|
|
151
199
|
|
|
152
200
|
const actionColor = (action: CRUD["action"]): Color => getActionColor(action);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useEffect, useMemo, useRef, useState, type JSX } from "react";
|
|
3
3
|
|
|
4
4
|
import { Box, Text } from "ink";
|
|
5
|
-
import type { CRUD, Plan } from "../../../Plan.ts";
|
|
5
|
+
import type { CRUD, Plan, ActionApply, ActionDelete } from "../../../Plan.ts";
|
|
6
6
|
|
|
7
7
|
import type {
|
|
8
8
|
ApplyEvent,
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
buildNamespaceTree,
|
|
14
14
|
flattenTree,
|
|
15
15
|
type FlattenedItem,
|
|
16
|
+
type ActionVerb,
|
|
16
17
|
} from "../../NamespaceTree.ts";
|
|
17
18
|
|
|
18
19
|
interface ProgressEventSource {
|
|
@@ -51,6 +52,14 @@ export type ProgressRow =
|
|
|
51
52
|
action: CRUD["action"];
|
|
52
53
|
/** For `noop` resources, persisted state status to show instead of `pending`. */
|
|
53
54
|
persistedApplyStatus?: "created" | "updated";
|
|
55
|
+
}
|
|
56
|
+
| {
|
|
57
|
+
key: string;
|
|
58
|
+
type: "task";
|
|
59
|
+
id: string;
|
|
60
|
+
depth: number;
|
|
61
|
+
actionType: string;
|
|
62
|
+
action: ActionVerb;
|
|
54
63
|
};
|
|
55
64
|
|
|
56
65
|
const getTaskKey = (item: FlattenedItem) => item.path.join("/");
|
|
@@ -65,42 +74,55 @@ export const buildProgressRows = (plan: Plan): ProgressRow[] => {
|
|
|
65
74
|
item !== undefined,
|
|
66
75
|
),
|
|
67
76
|
] as PlanItem[];
|
|
68
|
-
const
|
|
77
|
+
const taskItems = [
|
|
78
|
+
...Object.values(plan.actions ?? {}),
|
|
79
|
+
...Object.values(plan.actionDeletions ?? {}),
|
|
80
|
+
].filter((t): t is ActionApply | ActionDelete => t !== undefined);
|
|
81
|
+
const tree = buildNamespaceTree(items, taskItems);
|
|
69
82
|
return flattenTree(tree)
|
|
70
83
|
.filter((item) => item.type !== "binding")
|
|
71
|
-
.map((item) =>
|
|
72
|
-
item.type === "namespace"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
84
|
+
.map((item) => {
|
|
85
|
+
if (item.type === "namespace") {
|
|
86
|
+
return {
|
|
87
|
+
key: getTaskKey(item),
|
|
88
|
+
type: "namespace" as const,
|
|
89
|
+
id: item.id,
|
|
90
|
+
depth: item.depth,
|
|
91
|
+
action: item.action,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
if (item.type === "action") {
|
|
95
|
+
return {
|
|
96
|
+
key: getTaskKey(item),
|
|
97
|
+
type: "task" as const,
|
|
98
|
+
id: item.id,
|
|
99
|
+
depth: item.depth,
|
|
100
|
+
actionType: item.actionType ?? "unknown",
|
|
101
|
+
action: item.action as ActionVerb,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
key: getTaskKey(item),
|
|
106
|
+
type: "resource" as const,
|
|
107
|
+
id: item.id,
|
|
108
|
+
depth: item.depth,
|
|
109
|
+
resourceType: item.resourceType ?? "unknown",
|
|
110
|
+
action: item.action as CRUD["action"],
|
|
111
|
+
persistedApplyStatus:
|
|
112
|
+
item.action === "noop"
|
|
113
|
+
? (() => {
|
|
114
|
+
const crud = findCrudByLogicalId(plan, item.id);
|
|
115
|
+
return crud?.action === "noop" ? crud.state.status : undefined;
|
|
116
|
+
})()
|
|
117
|
+
: undefined,
|
|
118
|
+
};
|
|
119
|
+
});
|
|
98
120
|
};
|
|
99
121
|
|
|
100
122
|
const buildLogicalIdIndex = (rows: ProgressRow[]) => {
|
|
101
123
|
const index = new Map<string, string[]>();
|
|
102
124
|
for (const row of rows) {
|
|
103
|
-
if (row.type !== "resource") continue;
|
|
125
|
+
if (row.type !== "resource" && row.type !== "task") continue;
|
|
104
126
|
const keys = index.get(row.id);
|
|
105
127
|
if (keys) {
|
|
106
128
|
keys.push(row.key);
|
|
@@ -142,7 +164,27 @@ export function toPlanTask(
|
|
|
142
164
|
const buildInitialTasks = (rows: ProgressRow[]) =>
|
|
143
165
|
new Map(
|
|
144
166
|
rows.flatMap((row) =>
|
|
145
|
-
row.type === "resource"
|
|
167
|
+
row.type === "resource"
|
|
168
|
+
? [[row.key, toPlanTask(row)]]
|
|
169
|
+
: row.type === "task"
|
|
170
|
+
? [
|
|
171
|
+
[
|
|
172
|
+
row.key,
|
|
173
|
+
{
|
|
174
|
+
key: row.key,
|
|
175
|
+
id: row.id,
|
|
176
|
+
type: row.actionType,
|
|
177
|
+
// `noop` tasks are skipped — render as gray `•` from the start
|
|
178
|
+
// rather than briefly flashing the `ran` cyan styling.
|
|
179
|
+
status:
|
|
180
|
+
row.action === "noop"
|
|
181
|
+
? ("skipped" as ApplyStatus)
|
|
182
|
+
: ("pending" as ApplyStatus),
|
|
183
|
+
updatedAt: Date.now(),
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
]
|
|
187
|
+
: [],
|
|
146
188
|
),
|
|
147
189
|
);
|
|
148
190
|
|
|
@@ -220,6 +262,53 @@ export function PlanProgress(props: PlanProgressProps): JSX.Element {
|
|
|
220
262
|
);
|
|
221
263
|
}
|
|
222
264
|
|
|
265
|
+
if (row.type === "task") {
|
|
266
|
+
const t = tasks.get(row.key);
|
|
267
|
+
const status: ApplyStatus =
|
|
268
|
+
t?.status ?? (row.action === "noop" ? "ran" : "pending");
|
|
269
|
+
const color = statusColor(status);
|
|
270
|
+
const icon = taskIcon(row.action, status, spinner);
|
|
271
|
+
const label =
|
|
272
|
+
row.action === "delete"
|
|
273
|
+
? status === "deleted"
|
|
274
|
+
? "deleted"
|
|
275
|
+
: "drop"
|
|
276
|
+
: status === "ran"
|
|
277
|
+
? row.action === "noop"
|
|
278
|
+
? "skip"
|
|
279
|
+
: "ran"
|
|
280
|
+
: status === "running"
|
|
281
|
+
? "running"
|
|
282
|
+
: status === "fail"
|
|
283
|
+
? "fail"
|
|
284
|
+
: row.action === "noop"
|
|
285
|
+
? "skip"
|
|
286
|
+
: "run";
|
|
287
|
+
|
|
288
|
+
return (
|
|
289
|
+
<Box key={row.key} flexDirection="column">
|
|
290
|
+
<Box flexDirection="row">
|
|
291
|
+
<Text>{indent}</Text>
|
|
292
|
+
<Box width={2}>
|
|
293
|
+
<Text color={color}>{icon} </Text>
|
|
294
|
+
</Box>
|
|
295
|
+
<Text bold>{row.id}</Text>
|
|
296
|
+
<Text dimColor> ({row.actionType})</Text>
|
|
297
|
+
<Text color={color}> {label}</Text>
|
|
298
|
+
<Text color="cyan" dimColor>
|
|
299
|
+
{" "}
|
|
300
|
+
[action]
|
|
301
|
+
</Text>
|
|
302
|
+
</Box>
|
|
303
|
+
{t?.message ? (
|
|
304
|
+
<Box paddingLeft={row.depth * 2 + 2}>
|
|
305
|
+
<Text dimColor>• {t.message}</Text>
|
|
306
|
+
</Box>
|
|
307
|
+
) : null}
|
|
308
|
+
</Box>
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
|
|
223
312
|
const task = tasks.get(row.key) ?? toPlanTask(row);
|
|
224
313
|
const displayStatus = getDisplayStatus(row, task.status);
|
|
225
314
|
const color = statusColor(displayStatus);
|
|
@@ -276,6 +365,11 @@ function statusColor(
|
|
|
276
365
|
case "deleting":
|
|
277
366
|
case "deleted":
|
|
278
367
|
return "red";
|
|
368
|
+
case "running":
|
|
369
|
+
case "ran":
|
|
370
|
+
return "cyan";
|
|
371
|
+
case "skipped":
|
|
372
|
+
return "gray";
|
|
279
373
|
case "fail":
|
|
280
374
|
return "redBright";
|
|
281
375
|
default:
|
|
@@ -283,6 +377,21 @@ function statusColor(
|
|
|
283
377
|
}
|
|
284
378
|
}
|
|
285
379
|
|
|
380
|
+
function taskIcon(
|
|
381
|
+
action: ActionVerb,
|
|
382
|
+
status: ApplyStatus,
|
|
383
|
+
spinnerChar: string,
|
|
384
|
+
): string {
|
|
385
|
+
if (status === "running") return spinnerChar;
|
|
386
|
+
if (status === "fail") return "✗";
|
|
387
|
+
if (status === "skipped") return "•";
|
|
388
|
+
if (status === "ran") return action === "noop" ? "•" : "✓";
|
|
389
|
+
if (status === "deleted") return "✓";
|
|
390
|
+
if (action === "delete") return "-";
|
|
391
|
+
if (action === "noop") return "•";
|
|
392
|
+
return "λ";
|
|
393
|
+
}
|
|
394
|
+
|
|
286
395
|
function statusIcon(status: ApplyStatus, spinnerChar: string): string {
|
|
287
396
|
if (isInProgress(status)) return spinnerChar;
|
|
288
397
|
if (status === "fail") return "✗";
|
|
@@ -294,7 +403,8 @@ function isInProgress(status: ApplyStatus): boolean {
|
|
|
294
403
|
status === "pending" ||
|
|
295
404
|
status === "creating" ||
|
|
296
405
|
status === "updating" ||
|
|
297
|
-
status === "deleting"
|
|
406
|
+
status === "deleting" ||
|
|
407
|
+
status === "running"
|
|
298
408
|
);
|
|
299
409
|
}
|
|
300
410
|
|
package/src/Cloudflare/Access.ts
CHANGED
|
@@ -45,7 +45,7 @@ export const AnalyticsEngineDatasetBindingLive = Layer.effect(
|
|
|
45
45
|
return Effect.fnUntraced(function* (dataset: AnalyticsEngineDatasetLike) {
|
|
46
46
|
yield* bind(dataset);
|
|
47
47
|
|
|
48
|
-
const raw = WorkerEnvironment.
|
|
48
|
+
const raw = WorkerEnvironment.pipe(
|
|
49
49
|
Effect.map(
|
|
50
50
|
(env) =>
|
|
51
51
|
(env as Record<string, RuntimeAnalyticsEngineDataset>)[
|
|
@@ -106,7 +106,7 @@ export const ArtifactsBindingLive = Layer.effect(
|
|
|
106
106
|
|
|
107
107
|
return Effect.fn(function* (artifacts: ArtifactsLike) {
|
|
108
108
|
yield* Policy(artifacts);
|
|
109
|
-
const env = WorkerEnvironment
|
|
109
|
+
const env = WorkerEnvironment;
|
|
110
110
|
const raw = env.pipe(
|
|
111
111
|
Effect.map(
|
|
112
112
|
(env) => (env as Record<string, Artifacts>)[artifacts.name]!,
|
|
@@ -532,6 +532,7 @@ const HttpServer = NodeHttpServer;
|
|
|
532
532
|
`
|
|
533
533
|
}
|
|
534
534
|
import { Stack } from "alchemy/Stack";
|
|
535
|
+
import { makeEntrypointLayer } from "alchemy/Runtime";
|
|
535
536
|
import * as Effect from "effect/Effect";
|
|
536
537
|
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
|
|
537
538
|
import * as Layer from "effect/Layer";
|
|
@@ -539,13 +540,10 @@ import * as Logger from "effect/Logger";
|
|
|
539
540
|
import * as Context from "effect/Context";
|
|
540
541
|
import { MinimumLogLevel } from "effect/References";
|
|
541
542
|
|
|
542
|
-
import ${handler === "default" ? "
|
|
543
|
+
import ${handler === "default" ? "entrypoint" : `{ ${handler} as entrypoint }`} from "${importPath}";
|
|
543
544
|
|
|
544
545
|
const tag = Context.Service("${Self.key}")
|
|
545
|
-
const layer =
|
|
546
|
-
typeof entry?.build === "function"
|
|
547
|
-
? entry
|
|
548
|
-
: Layer.effect(tag, typeof entry?.asEffect === "function" ? entry.asEffect() : entry);
|
|
546
|
+
const layer = makeEntrypointLayer(tag, entrypoint);
|
|
549
547
|
|
|
550
548
|
const platform = Layer.mergeAll(
|
|
551
549
|
${runtime === "bun" ? "BunServices.layer" : "NodeServices.layer"},
|
|
@@ -561,7 +559,7 @@ const stack = Layer.succeed(Stack, {
|
|
|
561
559
|
resources: {}
|
|
562
560
|
});
|
|
563
561
|
|
|
564
|
-
const serverEffect = tag.
|
|
562
|
+
const serverEffect = tag.pipe(
|
|
565
563
|
Effect.flatMap(func => func.RuntimeContext.exports),
|
|
566
564
|
Effect.flatMap(exports => exports.default),
|
|
567
565
|
Effect.provide(
|
|
@@ -16,11 +16,11 @@ export const bindContainer = Effect.fnUntraced(function* <Shape, Req = never>(
|
|
|
16
16
|
| (ContainerApplication & Rpc<Shape>)
|
|
17
17
|
| Effect.Effect<ContainerApplication & Rpc<Shape>, never, Req>,
|
|
18
18
|
) {
|
|
19
|
-
const namespace = yield* DurableObjectNamespace
|
|
19
|
+
const namespace = yield* DurableObjectNamespace;
|
|
20
20
|
|
|
21
21
|
const container =
|
|
22
22
|
"asEffect" in containerEff
|
|
23
|
-
? yield*
|
|
23
|
+
? yield* containerEff as any as Effect.Effect<
|
|
24
24
|
ContainerApplication & Rpc<Shape>
|
|
25
25
|
>
|
|
26
26
|
: Effect.isEffect(containerEff)
|