alchemy-effect 0.5.0 → 0.6.2
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/alchemy-effect.js +7155 -17689
- package/bin/alchemy-effect.js.map +1 -1
- package/bin/alchemy-effect.sh +14 -0
- package/bin/alchemy-effect.ts +644 -130
- package/bin/process-manager.ts +10 -0
- package/lib/cli/index.d.ts +207 -378
- package/lib/cli/index.d.ts.map +1 -1
- package/lib/cli/index.js +4134 -985
- package/lib/cli/index.js.map +1 -1
- package/package.json +165 -103
- package/src/AWS/ACM/Certificate.ts +502 -0
- package/src/AWS/ACM/index.ts +1 -0
- package/src/AWS/AGENTS.md +505 -0
- package/src/AWS/Account.ts +56 -0
- package/src/AWS/Assets.ts +182 -0
- package/src/AWS/AutoScaling/AutoScalingGroup.ts +440 -0
- package/src/AWS/AutoScaling/LaunchTemplate.ts +535 -0
- package/src/AWS/AutoScaling/ScalingPolicy.ts +232 -0
- package/src/AWS/AutoScaling/index.ts +3 -0
- package/src/AWS/Bootstrap.ts +281 -0
- package/src/AWS/CloudFront/Distribution.ts +952 -0
- package/src/AWS/CloudFront/Function.ts +374 -0
- package/src/AWS/CloudFront/Invalidation.ts +202 -0
- package/src/AWS/CloudFront/KeyValueStore.ts +216 -0
- package/src/AWS/CloudFront/KvEntries.ts +250 -0
- package/src/AWS/CloudFront/KvRoutesUpdate.ts +301 -0
- package/src/AWS/CloudFront/ManagedPolicies.ts +20 -0
- package/src/AWS/CloudFront/OriginAccessControl.ts +266 -0
- package/src/AWS/CloudFront/common.ts +55 -0
- package/src/AWS/CloudFront/index.ts +15 -0
- package/src/AWS/CloudWatch/Alarm.ts +198 -0
- package/src/AWS/CloudWatch/AlarmMuteRule.ts +183 -0
- package/src/AWS/CloudWatch/AnomalyDetector.ts +242 -0
- package/src/AWS/CloudWatch/CompositeAlarm.ts +198 -0
- package/src/AWS/CloudWatch/Dashboard.ts +262 -0
- package/src/AWS/CloudWatch/DescribeAlarmContributors.ts +79 -0
- package/src/AWS/CloudWatch/DescribeAlarmHistory.ts +66 -0
- package/src/AWS/CloudWatch/DescribeAlarms.ts +94 -0
- package/src/AWS/CloudWatch/DescribeAlarmsForMetric.ts +66 -0
- package/src/AWS/CloudWatch/DescribeAnomalyDetectors.ts +68 -0
- package/src/AWS/CloudWatch/DescribeInsightRules.ts +66 -0
- package/src/AWS/CloudWatch/DisableAlarmActions.ts +74 -0
- package/src/AWS/CloudWatch/DisableInsightRules.ts +74 -0
- package/src/AWS/CloudWatch/EnableAlarmActions.ts +74 -0
- package/src/AWS/CloudWatch/GetAlarmMuteRule.ts +75 -0
- package/src/AWS/CloudWatch/GetDashboard.ts +75 -0
- package/src/AWS/CloudWatch/GetInsightRuleReport.ts +76 -0
- package/src/AWS/CloudWatch/GetMetricData.ts +62 -0
- package/src/AWS/CloudWatch/GetMetricStatistics.ts +64 -0
- package/src/AWS/CloudWatch/GetMetricStream.ts +75 -0
- package/src/AWS/CloudWatch/GetMetricWidgetImage.ts +66 -0
- package/src/AWS/CloudWatch/InsightRule.ts +277 -0
- package/src/AWS/CloudWatch/ListAlarmMuteRules.ts +64 -0
- package/src/AWS/CloudWatch/ListDashboards.ts +62 -0
- package/src/AWS/CloudWatch/ListManagedInsightRules.ts +68 -0
- package/src/AWS/CloudWatch/ListMetricStreams.ts +64 -0
- package/src/AWS/CloudWatch/ListMetrics.ts +62 -0
- package/src/AWS/CloudWatch/ListTagsForResource.ts +79 -0
- package/src/AWS/CloudWatch/MetricStream.ts +262 -0
- package/src/AWS/CloudWatch/PutMetricData.ts +62 -0
- package/src/AWS/CloudWatch/SetAlarmState.ts +73 -0
- package/src/AWS/CloudWatch/alarmStateChanges.ts +24 -0
- package/src/AWS/CloudWatch/binding-common.ts +42 -0
- package/src/AWS/CloudWatch/common.ts +168 -0
- package/src/AWS/CloudWatch/index.ts +32 -0
- package/src/AWS/Context.ts +30 -0
- package/src/AWS/Credentials.ts +52 -0
- package/src/AWS/DynamoDB/AttributeValue.ts +250 -0
- package/src/AWS/DynamoDB/BatchExecuteStatement.ts +113 -0
- package/src/AWS/DynamoDB/BatchGetItem.ts +138 -0
- package/src/AWS/DynamoDB/BatchWriteItem.ts +144 -0
- package/src/AWS/DynamoDB/DeleteItem.ts +67 -0
- package/src/AWS/DynamoDB/DescribeTable.ts +69 -0
- package/src/AWS/DynamoDB/DescribeTimeToLive.ts +72 -0
- package/src/AWS/DynamoDB/ExecuteStatement.ts +91 -0
- package/src/AWS/DynamoDB/ExecuteTransaction.ts +77 -0
- package/src/AWS/DynamoDB/GetItem.ts +85 -0
- package/src/AWS/DynamoDB/ListTables.ts +56 -0
- package/src/AWS/DynamoDB/ListTagsOfResource.ts +72 -0
- package/src/AWS/DynamoDB/ProjectionExpression.ts +159 -0
- package/src/AWS/DynamoDB/PutItem.ts +67 -0
- package/src/AWS/DynamoDB/Query.ts +68 -0
- package/src/AWS/DynamoDB/RestoreTableToPointInTime.ts +94 -0
- package/src/AWS/DynamoDB/Scan.ts +68 -0
- package/src/AWS/DynamoDB/Stream.ts +94 -0
- package/src/AWS/DynamoDB/Table.ts +1175 -0
- package/src/AWS/DynamoDB/TransactGetItems.ts +154 -0
- package/src/AWS/DynamoDB/TransactWriteItems.ts +216 -0
- package/src/AWS/DynamoDB/UpdateItem.ts +67 -0
- package/src/AWS/DynamoDB/UpdateTimeToLive.ts +71 -0
- package/src/AWS/DynamoDB/index.ts +24 -0
- package/src/AWS/EC2/EIP.ts +285 -0
- package/src/AWS/EC2/EgressOnlyInternetGateway.ts +248 -0
- package/src/AWS/EC2/Image.ts +108 -0
- package/src/AWS/EC2/Instance.ts +877 -0
- package/src/AWS/EC2/InternetGateway.ts +382 -0
- package/src/AWS/EC2/NatGateway.ts +474 -0
- package/src/AWS/EC2/Network.ts +459 -0
- package/src/AWS/EC2/NetworkAcl.ts +247 -0
- package/src/AWS/EC2/NetworkAclAssociation.ts +206 -0
- package/src/AWS/EC2/NetworkAclEntry.ts +300 -0
- package/src/AWS/EC2/Route.ts +323 -0
- package/src/AWS/EC2/RouteTable.ts +448 -0
- package/src/AWS/EC2/RouteTableAssociation.ts +274 -0
- package/src/AWS/EC2/SecurityGroup.ts +552 -0
- package/src/AWS/EC2/SecurityGroupRule.ts +395 -0
- package/src/AWS/EC2/Subnet.ts +583 -0
- package/src/AWS/EC2/Vpc.ts +455 -0
- package/src/AWS/EC2/VpcEndpoint.ts +657 -0
- package/src/AWS/EC2/hosted.ts +891 -0
- package/src/AWS/EC2/index.ts +18 -0
- package/src/AWS/ECR/Repository.ts +254 -0
- package/src/AWS/ECR/index.ts +1 -0
- package/src/AWS/ECS/Cluster.ts +257 -0
- package/src/AWS/ECS/DescribeTasks.ts +67 -0
- package/src/AWS/ECS/ListTasks.ts +67 -0
- package/src/AWS/ECS/RunTask.ts +82 -0
- package/src/AWS/ECS/Schedule.ts +115 -0
- package/src/AWS/ECS/Service.ts +572 -0
- package/src/AWS/ECS/StopTask.ts +64 -0
- package/src/AWS/ECS/Task.ts +981 -0
- package/src/AWS/ECS/index.ts +28 -0
- package/src/AWS/EKS/AccessEntry.ts +382 -0
- package/src/AWS/EKS/Addon.ts +385 -0
- package/src/AWS/EKS/AutoCluster.ts +288 -0
- package/src/AWS/EKS/Cluster.ts +655 -0
- package/src/AWS/EKS/LoadBalancedWorkload.ts +76 -0
- package/src/AWS/EKS/PodIdentityAssociation.ts +354 -0
- package/src/AWS/EKS/PodIdentityServiceAccount.ts +156 -0
- package/src/AWS/EKS/PodIdentityWorkload.ts +185 -0
- package/src/AWS/EKS/Workload.ts +145 -0
- package/src/AWS/EKS/index.ts +9 -0
- package/src/AWS/ELBv2/Listener.ts +139 -0
- package/src/AWS/ELBv2/LoadBalancer.ts +227 -0
- package/src/AWS/ELBv2/TargetGroup.ts +209 -0
- package/src/AWS/ELBv2/index.ts +3 -0
- package/src/AWS/Endpoint.ts +16 -0
- package/src/AWS/EventBridge/DescribeEventBus.ts +71 -0
- package/src/AWS/EventBridge/DescribeRule.ts +73 -0
- package/src/AWS/EventBridge/EventBus.ts +273 -0
- package/src/AWS/EventBridge/EventSource.ts +146 -0
- package/src/AWS/EventBridge/ListEventBuses.ts +60 -0
- package/src/AWS/EventBridge/ListRules.ts +87 -0
- package/src/AWS/EventBridge/ListTargetsByRule.ts +76 -0
- package/src/AWS/EventBridge/Permission.ts +151 -0
- package/src/AWS/EventBridge/PutEvents.ts +91 -0
- package/src/AWS/EventBridge/Rule.ts +620 -0
- package/src/AWS/EventBridge/TestEventPattern.ts +60 -0
- package/src/AWS/EventBridge/ToEcsTask.ts +118 -0
- package/src/AWS/EventBridge/ToLambda.ts +87 -0
- package/src/AWS/EventBridge/ToQueue.ts +97 -0
- package/src/AWS/EventBridge/index.ts +14 -0
- package/src/AWS/IAM/AccessKey.ts +142 -0
- package/src/AWS/IAM/AccountAlias.ts +96 -0
- package/src/AWS/IAM/AccountPasswordPolicy.ts +64 -0
- package/src/AWS/IAM/Group.ts +357 -0
- package/src/AWS/IAM/GroupMembership.ts +142 -0
- package/src/AWS/IAM/InstanceProfile.ts +285 -0
- package/src/AWS/IAM/LoginProfile.ts +137 -0
- package/src/AWS/IAM/OpenIDConnectProvider.ts +192 -0
- package/src/AWS/IAM/Policy.ts +387 -0
- package/src/AWS/IAM/Role.ts +500 -0
- package/src/AWS/IAM/SAMLProvider.ts +165 -0
- package/src/AWS/IAM/SSHPublicKey.ts +148 -0
- package/src/AWS/IAM/ServerCertificate.ts +261 -0
- package/src/AWS/IAM/ServiceSpecificCredential.ts +172 -0
- package/src/AWS/IAM/SigningCertificate.ts +137 -0
- package/src/AWS/IAM/User.ts +436 -0
- package/src/AWS/IAM/VirtualMFADevice.ts +259 -0
- package/src/AWS/IAM/common.ts +89 -0
- package/src/AWS/IAM/index.ts +40 -0
- package/src/AWS/IdentityCenter/AccountAssignment.ts +290 -0
- package/src/AWS/IdentityCenter/Group.ts +211 -0
- package/src/AWS/IdentityCenter/Instance.ts +190 -0
- package/src/AWS/IdentityCenter/PermissionSet.ts +235 -0
- package/src/AWS/IdentityCenter/common.ts +117 -0
- package/src/AWS/IdentityCenter/index.ts +4 -0
- package/src/AWS/Kinesis/DescribeAccountSettings.ts +63 -0
- package/src/AWS/Kinesis/DescribeLimits.ts +59 -0
- package/src/AWS/Kinesis/DescribeStream.ts +69 -0
- package/src/AWS/Kinesis/DescribeStreamConsumer.ts +72 -0
- package/src/AWS/Kinesis/DescribeStreamSummary.ts +72 -0
- package/src/AWS/Kinesis/GetRecords.ts +59 -0
- package/src/AWS/Kinesis/GetResourcePolicy.ts +72 -0
- package/src/AWS/Kinesis/GetShardIterator.ts +71 -0
- package/src/AWS/Kinesis/ListShards.ts +66 -0
- package/src/AWS/Kinesis/ListStreamConsumers.ts +72 -0
- package/src/AWS/Kinesis/ListStreams.ts +56 -0
- package/src/AWS/Kinesis/ListTagsForResource.ts +78 -0
- package/src/AWS/Kinesis/PutRecord.ts +67 -0
- package/src/AWS/Kinesis/PutRecords.ts +67 -0
- package/src/AWS/Kinesis/Stream.ts +731 -0
- package/src/AWS/Kinesis/StreamConsumer.ts +325 -0
- package/src/AWS/Kinesis/StreamEventSource.ts +106 -0
- package/src/AWS/Kinesis/StreamSink.ts +68 -0
- package/src/AWS/Kinesis/SubscribeToShard.ts +71 -0
- package/src/AWS/Kinesis/index.ts +19 -0
- package/src/AWS/Lambda/BucketEventSource.ts +146 -0
- package/src/AWS/Lambda/EventBridgeEventSource.ts +183 -0
- package/src/AWS/Lambda/EventSourceMapping.ts +438 -0
- package/src/AWS/Lambda/Function.ts +1185 -0
- package/src/AWS/Lambda/HttpServer.ts +125 -0
- package/src/AWS/Lambda/InvokeFunction.ts +67 -0
- package/src/AWS/Lambda/Permission.ts +217 -0
- package/src/AWS/Lambda/QueueEventSource.ts +96 -0
- package/src/AWS/Lambda/StreamEventSource.ts +123 -0
- package/src/AWS/Lambda/TableEventSource.ts +156 -0
- package/src/AWS/Lambda/TopicEventSource.ts +105 -0
- package/src/AWS/Lambda/index.ts +13 -0
- package/src/AWS/Logs/LogGroup.ts +209 -0
- package/src/AWS/Logs/index.ts +1 -0
- package/src/AWS/Organizations/Account.ts +328 -0
- package/src/AWS/Organizations/DelegatedAdministrator.ts +158 -0
- package/src/AWS/Organizations/Organization.ts +179 -0
- package/src/AWS/Organizations/OrganizationResourcePolicy.ts +108 -0
- package/src/AWS/Organizations/OrganizationalUnit.ts +268 -0
- package/src/AWS/Organizations/Policy.ts +241 -0
- package/src/AWS/Organizations/PolicyAttachment.ts +130 -0
- package/src/AWS/Organizations/Root.ts +151 -0
- package/src/AWS/Organizations/RootPolicyType.ts +130 -0
- package/src/AWS/Organizations/TenantRoot.ts +506 -0
- package/src/AWS/Organizations/TrustedServiceAccess.ts +107 -0
- package/src/AWS/Organizations/common.ts +130 -0
- package/src/AWS/Organizations/index.ts +11 -0
- package/src/AWS/Profile.ts +5 -0
- package/src/AWS/Providers.ts +324 -0
- package/src/AWS/RDS/Aurora.ts +499 -0
- package/src/AWS/RDS/Connect.ts +127 -0
- package/src/AWS/RDS/DBCluster.ts +361 -0
- package/src/AWS/RDS/DBClusterEndpoint.ts +226 -0
- package/src/AWS/RDS/DBClusterParameterGroup.ts +195 -0
- package/src/AWS/RDS/DBInstance.ts +274 -0
- package/src/AWS/RDS/DBParameterGroup.ts +190 -0
- package/src/AWS/RDS/DBProxy.ts +257 -0
- package/src/AWS/RDS/DBProxyEndpoint.ts +255 -0
- package/src/AWS/RDS/DBProxyTargetGroup.ts +243 -0
- package/src/AWS/RDS/DBSubnetGroup.ts +208 -0
- package/src/AWS/RDS/index.ts +11 -0
- package/src/AWS/RDSData/BatchExecuteStatement.ts +103 -0
- package/src/AWS/RDSData/BeginTransaction.ts +97 -0
- package/src/AWS/RDSData/CommitTransaction.ts +102 -0
- package/src/AWS/RDSData/ExecuteSql.ts +98 -0
- package/src/AWS/RDSData/ExecuteStatement.ts +99 -0
- package/src/AWS/RDSData/RollbackTransaction.ts +105 -0
- package/src/AWS/RDSData/index.ts +6 -0
- package/src/AWS/Region.ts +77 -0
- package/src/AWS/Route53/Record.ts +342 -0
- package/src/AWS/Route53/index.ts +1 -0
- package/src/AWS/S3/AbortMultipartUpload.ts +73 -0
- package/src/AWS/S3/Bucket.ts +550 -0
- package/src/AWS/S3/BucketEventSource.ts +26 -0
- package/src/AWS/S3/BucketNotifications.ts +77 -0
- package/src/AWS/S3/CompleteMultipartUpload.ts +73 -0
- package/src/AWS/S3/CopyObject.ts +68 -0
- package/src/AWS/S3/CreateMultipartUpload.ts +73 -0
- package/src/AWS/S3/DeleteObject.ts +67 -0
- package/src/AWS/S3/GetObject.ts +74 -0
- package/src/AWS/S3/HeadObject.ts +67 -0
- package/src/AWS/S3/ListObjectsV2.ts +67 -0
- package/src/AWS/S3/PutObject.ts +83 -0
- package/src/AWS/S3/S3Event.ts +43 -0
- package/src/AWS/S3/UploadPart.ts +67 -0
- package/src/AWS/S3/index.ts +14 -0
- package/src/AWS/SNS/AddPermission.ts +66 -0
- package/src/AWS/SNS/ConfirmSubscription.ts +72 -0
- package/src/AWS/SNS/GetDataProtectionPolicy.ts +72 -0
- package/src/AWS/SNS/GetSubscriptionAttributes.ts +72 -0
- package/src/AWS/SNS/GetTopicAttributes.ts +70 -0
- package/src/AWS/SNS/ListSubscriptions.ts +60 -0
- package/src/AWS/SNS/ListSubscriptionsByTopic.ts +72 -0
- package/src/AWS/SNS/ListTagsForResource.ts +72 -0
- package/src/AWS/SNS/ListTopics.ts +56 -0
- package/src/AWS/SNS/Publish.ts +66 -0
- package/src/AWS/SNS/PublishBatch.ts +66 -0
- package/src/AWS/SNS/PutDataProtectionPolicy.ts +72 -0
- package/src/AWS/SNS/RemovePermission.ts +66 -0
- package/src/AWS/SNS/SetSubscriptionAttributes.ts +72 -0
- package/src/AWS/SNS/SetTopicAttributes.ts +70 -0
- package/src/AWS/SNS/Subscription.ts +305 -0
- package/src/AWS/SNS/TagResource.ts +66 -0
- package/src/AWS/SNS/Topic.ts +363 -0
- package/src/AWS/SNS/TopicEventSource.ts +42 -0
- package/src/AWS/SNS/TopicSink.ts +61 -0
- package/src/AWS/SNS/UntagResource.ts +66 -0
- package/src/AWS/SNS/index.ts +21 -0
- package/src/AWS/SQS/DeleteMessage.ts +67 -0
- package/src/AWS/SQS/DeleteMessageBatch.ts +72 -0
- package/src/AWS/SQS/Queue.ts +210 -0
- package/src/AWS/SQS/QueueEventSource.ts +57 -0
- package/src/AWS/SQS/QueueSink.ts +62 -0
- package/src/AWS/SQS/ReceiveMessage.ts +68 -0
- package/src/AWS/SQS/SendMessage.ts +69 -0
- package/src/AWS/SQS/SendMessageBatch.ts +67 -0
- package/src/AWS/SQS/index.ts +8 -0
- package/src/AWS/Scheduler/Schedule.ts +296 -0
- package/src/AWS/Scheduler/ScheduleGroup.ts +186 -0
- package/src/AWS/Scheduler/builders.ts +229 -0
- package/src/AWS/Scheduler/index.ts +3 -0
- package/src/AWS/SecretsManager/DescribeSecret.ts +66 -0
- package/src/AWS/SecretsManager/GetRandomPassword.ts +65 -0
- package/src/AWS/SecretsManager/GetSecretValue.ts +78 -0
- package/src/AWS/SecretsManager/ListSecrets.ts +62 -0
- package/src/AWS/SecretsManager/PutSecretValue.ts +78 -0
- package/src/AWS/SecretsManager/Secret.ts +318 -0
- package/src/AWS/SecretsManager/index.ts +6 -0
- package/src/AWS/StageConfig.ts +44 -0
- package/src/AWS/Website/AssetDeployment.ts +348 -0
- package/src/AWS/Website/Router.ts +384 -0
- package/src/AWS/Website/SsrSite.ts +393 -0
- package/src/AWS/Website/StaticSite.ts +611 -0
- package/src/AWS/Website/cfcode.ts +180 -0
- package/src/AWS/Website/index.ts +5 -0
- package/src/AWS/Website/shared.ts +223 -0
- package/src/AWS/index.ts +37 -0
- package/src/AdoptPolicy.ts +25 -0
- package/src/Agent/Agent.ts +26 -0
- package/src/Agent/Aspect.ts +173 -0
- package/src/Agent/AspectGraph.ts +98 -0
- package/src/Agent/ContextPlugin.ts +18 -0
- package/src/Agent/Plugin.ts +29 -0
- package/src/Agent/chat/channel.ts +26 -0
- package/src/Agent/chat/event.ts +43 -0
- package/src/Agent/chat/message.ts +35 -0
- package/src/Agent/chat/service.ts +133 -0
- package/src/Agent/chat/thread.ts +17 -0
- package/src/Agent/coding/bash.ts +198 -0
- package/src/Agent/coding/edit.ts +152 -0
- package/src/Agent/coding/glob.ts +97 -0
- package/src/Agent/coding/grep.ts +144 -0
- package/src/Agent/coding/index.ts +7 -0
- package/src/Agent/coding/read.ts +119 -0
- package/src/Agent/coding/readlints.ts +78 -0
- package/src/Agent/coding/write.ts +79 -0
- package/src/Agent/fs/file.ts +22 -0
- package/src/Agent/fs/folder.ts +16 -0
- package/src/Agent/index.ts +9 -0
- package/src/Agent/llm/error.ts +330 -0
- package/src/Agent/llm/index.ts +4 -0
- package/src/Agent/llm/llm.ts +131 -0
- package/src/Agent/llm/stream-collectors.ts +58 -0
- package/src/Agent/llm/stream-text-part.ts +7 -0
- package/src/Agent/lsp/client.ts +293 -0
- package/src/Agent/lsp/diagnostics.ts +64 -0
- package/src/Agent/lsp/jsonrpc.ts +317 -0
- package/src/Agent/lsp/manager.ts +213 -0
- package/src/Agent/lsp/servers.ts +37 -0
- package/src/Agent/process/driver.ts +168 -0
- package/src/Agent/process/issue-service.ts +48 -0
- package/src/Agent/process/issue-tools.ts +33 -0
- package/src/Agent/process/issue.ts +22 -0
- package/src/Agent/process/organization.ts +16 -0
- package/src/Agent/process/process.ts +16 -0
- package/src/Agent/process/reply.ts +21 -0
- package/src/Agent/process/task.ts +34 -0
- package/src/Agent/tool/index.ts +3 -0
- package/src/Agent/tool/parameter.ts +35 -0
- package/src/Agent/tool/result.ts +51 -0
- package/src/Agent/tool/tool.ts +74 -0
- package/src/Agent/util/command-validator.ts +98 -0
- package/src/Agent/util/exec.ts +18 -0
- package/src/Agent/util/parser.ts +39 -0
- package/src/Agent/util/replace.ts +559 -0
- package/src/Agent/util/ripgrep.ts +256 -0
- package/src/Apply.ts +1074 -0
- package/src/Binding.ts +193 -0
- package/src/Build/Command.ts +322 -0
- package/src/Build/index.ts +1 -0
- package/src/Bundle/Bundle.ts +215 -0
- package/src/Bundle/Docker.ts +213 -0
- package/src/Bundle/TempRoot.ts +104 -0
- package/src/Bundle/index.ts +3 -0
- package/src/Cli/Cli.ts +23 -0
- package/src/Cli/Event.ts +32 -0
- package/src/Cli/InkCLI.tsx +60 -0
- package/src/Cli/NamespaceTree.ts +199 -0
- package/src/Cli/Reporter.ts +8 -0
- package/src/Cli/components/ApprovePlan.tsx +44 -0
- package/src/Cli/components/Plan.tsx +148 -0
- package/src/Cli/components/PlanProgress.tsx +325 -0
- package/src/Cli/index.ts +2 -0
- package/src/Cloudflare/Account.ts +38 -0
- package/src/Cloudflare/Container.ts +1345 -0
- package/src/Cloudflare/KV/Delete.ts +38 -0
- package/src/Cloudflare/KV/Get.ts +40 -0
- package/src/Cloudflare/KV/GetWithMetadata.ts +54 -0
- package/src/Cloudflare/KV/List.ts +45 -0
- package/src/Cloudflare/KV/Namespace.ts +150 -0
- package/src/Cloudflare/KV/NamespaceBinding.ts +25 -0
- package/src/Cloudflare/KV/Put.ts +59 -0
- package/src/Cloudflare/KV/index.ts +6 -0
- package/src/Cloudflare/Logs.ts +139 -0
- package/src/Cloudflare/Providers.ts +75 -0
- package/src/Cloudflare/R2/Bucket.ts +173 -0
- package/src/Cloudflare/R2/BucketBinding.ts +31 -0
- package/src/Cloudflare/R2/CreateMultipartUpload.ts +59 -0
- package/src/Cloudflare/R2/DeleteObject.ts +41 -0
- package/src/Cloudflare/R2/GetObject.ts +47 -0
- package/src/Cloudflare/R2/HeadObject.ts +41 -0
- package/src/Cloudflare/R2/ListObjects.ts +45 -0
- package/src/Cloudflare/R2/MultipartUploadClient.ts +40 -0
- package/src/Cloudflare/R2/PutObject.ts +55 -0
- package/src/Cloudflare/R2/ResumeMultipartUpload.ts +48 -0
- package/src/Cloudflare/R2/UploadValue.ts +10 -0
- package/src/Cloudflare/R2/index.ts +9 -0
- package/src/Cloudflare/StageConfig.ts +8 -0
- package/src/Cloudflare/Website/StaticSite.ts +35 -0
- package/src/Cloudflare/Website/TanstackStart.ts +14 -0
- package/src/Cloudflare/Website/index.ts +2 -0
- package/src/Cloudflare/Workers/Assets.ts +286 -0
- package/src/Cloudflare/Workers/ConfigProvider.ts +9 -0
- package/src/Cloudflare/Workers/DurableObject.ts +558 -0
- package/src/Cloudflare/Workers/DynamicWorker.ts +144 -0
- package/src/Cloudflare/Workers/Fetch.ts +142 -0
- package/src/Cloudflare/Workers/Fetcher.ts +280 -0
- package/src/Cloudflare/Workers/HttpServer.ts +159 -0
- package/src/Cloudflare/Workers/Rpc.ts +472 -0
- package/src/Cloudflare/Workers/WebSocket.ts +44 -0
- package/src/Cloudflare/Workers/Worker.ts +1222 -0
- package/src/Cloudflare/Workers/Workflow.ts +400 -0
- package/src/Cloudflare/Workers/cloudflare_workers.ts +25 -0
- package/src/Cloudflare/Workers/index.ts +10 -0
- package/src/Cloudflare/index.ts +7 -0
- package/src/Cloudflare/stream.ts +20 -0
- package/src/Config.ts +31 -0
- package/src/Construct.ts +75 -0
- package/src/Daemon/Client.ts +112 -0
- package/src/Daemon/Config.ts +28 -0
- package/src/Daemon/Errors.ts +32 -0
- package/src/Daemon/Lock.ts +162 -0
- package/src/Daemon/ProcessRegistry.ts +284 -0
- package/src/Daemon/RpcSchema.ts +43 -0
- package/src/Daemon/RpcServer.ts +231 -0
- package/src/Daemon/index.ts +25 -0
- package/src/Destroy.ts +15 -0
- package/src/Diff.ts +142 -0
- package/src/ExecutionContext.ts +30 -0
- package/src/FQN.ts +94 -0
- package/src/Http.ts +105 -0
- package/src/Input.ts +91 -0
- package/src/InstanceId.ts +19 -0
- package/src/Kubernetes/ConfigMap.ts +59 -0
- package/src/Kubernetes/Deployment.ts +123 -0
- package/src/Kubernetes/Job.ts +82 -0
- package/src/Kubernetes/Namespace.ts +49 -0
- package/src/Kubernetes/Object.ts +99 -0
- package/src/Kubernetes/Service.ts +78 -0
- package/src/Kubernetes/ServiceAccount.ts +49 -0
- package/src/Kubernetes/client.ts +298 -0
- package/src/Kubernetes/common.ts +23 -0
- package/src/Kubernetes/index.ts +11 -0
- package/src/Kubernetes/types.ts +177 -0
- package/src/Namespace.ts +64 -0
- package/src/Observability.ts +0 -0
- package/src/Output.ts +584 -0
- package/src/Phase.ts +5 -0
- package/src/PhysicalName.ts +62 -0
- package/src/Plan.ts +899 -0
- package/src/Platform.ts +398 -0
- package/src/Provider.ts +156 -0
- package/src/Ref.ts +46 -0
- package/src/RemovalPolicy.ts +51 -0
- package/src/Resource.ts +387 -0
- package/src/SQLite/BunSQLite.ts +132 -0
- package/src/SQLite/SQLite.ts +19 -0
- package/src/SQLite/SQLiteConnection.ts +55 -0
- package/src/SQLite/SQLiteError.ts +904 -0
- package/src/SQLite/SQLiteStatement.ts +24 -0
- package/src/SQLite/index.ts +6 -0
- package/src/SQLite/libSQL.ts +194 -0
- package/src/Schema.ts +333 -0
- package/src/Self.ts +10 -0
- package/src/Server/Process.ts +30 -0
- package/src/Server/S3BucketEventSource.ts +100 -0
- package/src/Server/SQSQueueEventSource.ts +77 -0
- package/src/Server/index.ts +3 -0
- package/src/Serverless/Function.ts +18 -0
- package/src/Serverless/index.ts +1 -0
- package/src/Spawn.ts +23 -0
- package/src/Stack.ts +84 -0
- package/src/Stage.ts +3 -0
- package/src/State/InMemoryState.ts +86 -0
- package/src/State/LocalState.ts +120 -0
- package/src/State/ResourceState.ts +121 -0
- package/src/State/State.ts +72 -0
- package/src/State/index.ts +4 -0
- package/src/Tags.ts +104 -0
- package/src/Test/TestCli.ts +21 -0
- package/src/Test/TestState.ts +37 -0
- package/src/Test/Vitest.ts +503 -0
- package/src/Test/index.ts +3 -0
- package/src/Trait.ts +105 -0
- package/src/Util/base32.ts +44 -0
- package/src/Util/camel.ts +23 -0
- package/src/Util/class.ts +7 -0
- package/src/Util/effect.ts +57 -0
- package/src/Util/index.ts +15 -0
- package/src/Util/instance.ts +9 -0
- package/src/Util/pointer.ts +5 -0
- package/src/Util/schema-to-type.ts +456 -0
- package/src/Util/service.ts +16 -0
- package/src/Util/sha256.ts +27 -0
- package/src/Util/stable.ts +41 -0
- package/src/Util/todo.ts +4 -0
- package/src/Util/types.ts +25 -0
- package/src/Util/unknown.ts +19 -0
- package/src/Util/zip.ts +27 -0
- package/src/index.ts +29 -26
- package/README.md +0 -179
- package/lib/$.d.ts +0 -5
- package/lib/$.d.ts.map +0 -1
- package/lib/$.js +0 -9
- package/lib/$.js.map +0 -1
- package/lib/app.d.ts +0 -15
- package/lib/app.d.ts.map +0 -1
- package/lib/app.js +0 -7
- package/lib/app.js.map +0 -1
- package/lib/apply.d.ts +0 -18
- package/lib/apply.d.ts.map +0 -1
- package/lib/apply.js +0 -567
- package/lib/apply.js.map +0 -1
- package/lib/assert-never.d.ts +0 -12
- package/lib/assert-never.d.ts.map +0 -1
- package/lib/assert-never.js +0 -11
- package/lib/assert-never.js.map +0 -1
- package/lib/aws/account.d.ts +0 -27
- package/lib/aws/account.d.ts.map +0 -1
- package/lib/aws/account.js +0 -33
- package/lib/aws/account.js.map +0 -1
- package/lib/aws/arn.d.ts +0 -2
- package/lib/aws/arn.d.ts.map +0 -1
- package/lib/aws/arn.js +0 -1
- package/lib/aws/arn.js.map +0 -1
- package/lib/aws/assets.d.ts +0 -8
- package/lib/aws/assets.d.ts.map +0 -1
- package/lib/aws/assets.js +0 -4
- package/lib/aws/assets.js.map +0 -1
- package/lib/aws/bundle.d.ts +0 -4
- package/lib/aws/bundle.d.ts.map +0 -1
- package/lib/aws/bundle.js +0 -4
- package/lib/aws/bundle.js.map +0 -1
- package/lib/aws/client.d.ts +0 -8
- package/lib/aws/client.d.ts.map +0 -1
- package/lib/aws/client.js +0 -27
- package/lib/aws/client.js.map +0 -1
- package/lib/aws/config.d.ts +0 -15
- package/lib/aws/config.d.ts.map +0 -1
- package/lib/aws/config.js +0 -1
- package/lib/aws/config.js.map +0 -1
- package/lib/aws/credentials.d.ts +0 -156
- package/lib/aws/credentials.d.ts.map +0 -1
- package/lib/aws/credentials.js +0 -196
- package/lib/aws/credentials.js.map +0 -1
- package/lib/aws/dynamodb/attribute-value.d.ts +0 -20
- package/lib/aws/dynamodb/attribute-value.d.ts.map +0 -1
- package/lib/aws/dynamodb/attribute-value.js +0 -217
- package/lib/aws/dynamodb/attribute-value.js.map +0 -1
- package/lib/aws/dynamodb/client.d.ts +0 -12
- package/lib/aws/dynamodb/client.d.ts.map +0 -1
- package/lib/aws/dynamodb/client.js +0 -11
- package/lib/aws/dynamodb/client.js.map +0 -1
- package/lib/aws/dynamodb/expr.d.ts +0 -41
- package/lib/aws/dynamodb/expr.d.ts.map +0 -1
- package/lib/aws/dynamodb/expr.js +0 -1
- package/lib/aws/dynamodb/expr.js.map +0 -1
- package/lib/aws/dynamodb/index.d.ts +0 -10
- package/lib/aws/dynamodb/index.d.ts.map +0 -1
- package/lib/aws/dynamodb/index.js +0 -9
- package/lib/aws/dynamodb/index.js.map +0 -1
- package/lib/aws/dynamodb/projection.d.ts +0 -25
- package/lib/aws/dynamodb/projection.d.ts.map +0 -1
- package/lib/aws/dynamodb/projection.js +0 -1
- package/lib/aws/dynamodb/projection.js.map +0 -1
- package/lib/aws/dynamodb/secondary-index.d.ts +0 -26
- package/lib/aws/dynamodb/secondary-index.d.ts.map +0 -1
- package/lib/aws/dynamodb/secondary-index.js +0 -4
- package/lib/aws/dynamodb/secondary-index.js.map +0 -1
- package/lib/aws/dynamodb/table.d.ts +0 -59
- package/lib/aws/dynamodb/table.d.ts.map +0 -1
- package/lib/aws/dynamodb/table.get-item.d.ts +0 -57
- package/lib/aws/dynamodb/table.get-item.d.ts.map +0 -1
- package/lib/aws/dynamodb/table.get-item.js +0 -77
- package/lib/aws/dynamodb/table.get-item.js.map +0 -1
- package/lib/aws/dynamodb/table.js +0 -4
- package/lib/aws/dynamodb/table.js.map +0 -1
- package/lib/aws/dynamodb/table.provider.d.ts +0 -7
- package/lib/aws/dynamodb/table.provider.d.ts.map +0 -1
- package/lib/aws/dynamodb/table.provider.js +0 -196
- package/lib/aws/dynamodb/table.provider.js.map +0 -1
- package/lib/aws/ec2/client.d.ts +0 -12
- package/lib/aws/ec2/client.d.ts.map +0 -1
- package/lib/aws/ec2/client.js +0 -11
- package/lib/aws/ec2/client.js.map +0 -1
- package/lib/aws/ec2/index.d.ts +0 -15
- package/lib/aws/ec2/index.d.ts.map +0 -1
- package/lib/aws/ec2/index.js +0 -15
- package/lib/aws/ec2/index.js.map +0 -1
- package/lib/aws/ec2/internet-gateway.d.ts +0 -65
- package/lib/aws/ec2/internet-gateway.d.ts.map +0 -1
- package/lib/aws/ec2/internet-gateway.js +0 -4
- package/lib/aws/ec2/internet-gateway.js.map +0 -1
- package/lib/aws/ec2/internet-gateway.provider.d.ts +0 -6
- package/lib/aws/ec2/internet-gateway.provider.d.ts.map +0 -1
- package/lib/aws/ec2/internet-gateway.provider.js +0 -193
- package/lib/aws/ec2/internet-gateway.provider.js.map +0 -1
- package/lib/aws/ec2/route-table-association.d.ts +0 -63
- package/lib/aws/ec2/route-table-association.d.ts.map +0 -1
- package/lib/aws/ec2/route-table-association.js +0 -4
- package/lib/aws/ec2/route-table-association.js.map +0 -1
- package/lib/aws/ec2/route-table-association.provider.d.ts +0 -4
- package/lib/aws/ec2/route-table-association.provider.d.ts.map +0 -1
- package/lib/aws/ec2/route-table-association.provider.js +0 -121
- package/lib/aws/ec2/route-table-association.provider.js.map +0 -1
- package/lib/aws/ec2/route-table.d.ts +0 -159
- package/lib/aws/ec2/route-table.d.ts.map +0 -1
- package/lib/aws/ec2/route-table.js +0 -4
- package/lib/aws/ec2/route-table.js.map +0 -1
- package/lib/aws/ec2/route-table.provider.d.ts +0 -6
- package/lib/aws/ec2/route-table.provider.d.ts.map +0 -1
- package/lib/aws/ec2/route-table.provider.js +0 -213
- package/lib/aws/ec2/route-table.provider.js.map +0 -1
- package/lib/aws/ec2/route.d.ts +0 -155
- package/lib/aws/ec2/route.d.ts.map +0 -1
- package/lib/aws/ec2/route.js +0 -3
- package/lib/aws/ec2/route.js.map +0 -1
- package/lib/aws/ec2/route.provider.d.ts +0 -4
- package/lib/aws/ec2/route.provider.d.ts.map +0 -1
- package/lib/aws/ec2/route.provider.js +0 -166
- package/lib/aws/ec2/route.provider.js.map +0 -1
- package/lib/aws/ec2/subnet.d.ts +0 -175
- package/lib/aws/ec2/subnet.d.ts.map +0 -1
- package/lib/aws/ec2/subnet.js +0 -4
- package/lib/aws/ec2/subnet.js.map +0 -1
- package/lib/aws/ec2/subnet.provider.d.ts +0 -4
- package/lib/aws/ec2/subnet.provider.d.ts.map +0 -1
- package/lib/aws/ec2/subnet.provider.js +0 -250
- package/lib/aws/ec2/subnet.provider.js.map +0 -1
- package/lib/aws/ec2/vpc.d.ts +0 -136
- package/lib/aws/ec2/vpc.d.ts.map +0 -1
- package/lib/aws/ec2/vpc.js +0 -4
- package/lib/aws/ec2/vpc.js.map +0 -1
- package/lib/aws/ec2/vpc.provider.d.ts +0 -6
- package/lib/aws/ec2/vpc.provider.d.ts.map +0 -1
- package/lib/aws/ec2/vpc.provider.js +0 -205
- package/lib/aws/ec2/vpc.provider.js.map +0 -1
- package/lib/aws/iam.d.ts +0 -23
- package/lib/aws/iam.d.ts.map +0 -1
- package/lib/aws/iam.js +0 -7
- package/lib/aws/iam.js.map +0 -1
- package/lib/aws/index.d.ts +0 -28
- package/lib/aws/index.d.ts.map +0 -1
- package/lib/aws/index.js +0 -21
- package/lib/aws/index.js.map +0 -1
- package/lib/aws/lambda/client.d.ts +0 -8
- package/lib/aws/lambda/client.d.ts.map +0 -1
- package/lib/aws/lambda/client.js +0 -7
- package/lib/aws/lambda/client.js.map +0 -1
- package/lib/aws/lambda/consume.d.ts +0 -16
- package/lib/aws/lambda/consume.d.ts.map +0 -1
- package/lib/aws/lambda/consume.js +0 -30
- package/lib/aws/lambda/consume.js.map +0 -1
- package/lib/aws/lambda/function.d.ts +0 -41
- package/lib/aws/lambda/function.d.ts.map +0 -1
- package/lib/aws/lambda/function.handler.d.ts +0 -7
- package/lib/aws/lambda/function.handler.d.ts.map +0 -1
- package/lib/aws/lambda/function.handler.js +0 -8
- package/lib/aws/lambda/function.handler.js.map +0 -1
- package/lib/aws/lambda/function.invoke.d.ts +0 -12
- package/lib/aws/lambda/function.invoke.d.ts.map +0 -1
- package/lib/aws/lambda/function.invoke.js +0 -33
- package/lib/aws/lambda/function.invoke.js.map +0 -1
- package/lib/aws/lambda/function.js +0 -3
- package/lib/aws/lambda/function.js.map +0 -1
- package/lib/aws/lambda/function.provider.d.ts +0 -10
- package/lib/aws/lambda/function.provider.d.ts.map +0 -1
- package/lib/aws/lambda/function.provider.js +0 -464
- package/lib/aws/lambda/function.provider.js.map +0 -1
- package/lib/aws/lambda/index.d.ts +0 -9
- package/lib/aws/lambda/index.d.ts.map +0 -1
- package/lib/aws/lambda/index.js +0 -10
- package/lib/aws/lambda/index.js.map +0 -1
- package/lib/aws/lambda/serve.d.ts +0 -12
- package/lib/aws/lambda/serve.d.ts.map +0 -1
- package/lib/aws/lambda/serve.js +0 -7
- package/lib/aws/lambda/serve.js.map +0 -1
- package/lib/aws/parse-ini.d.ts +0 -4
- package/lib/aws/parse-ini.d.ts.map +0 -1
- package/lib/aws/parse-ini.js +0 -67
- package/lib/aws/parse-ini.js.map +0 -1
- package/lib/aws/profile.d.ts +0 -6
- package/lib/aws/profile.d.ts.map +0 -1
- package/lib/aws/profile.js +0 -4
- package/lib/aws/profile.js.map +0 -1
- package/lib/aws/region.d.ts +0 -31
- package/lib/aws/region.d.ts.map +0 -1
- package/lib/aws/region.js +0 -46
- package/lib/aws/region.js.map +0 -1
- package/lib/aws/s3.d.ts +0 -8
- package/lib/aws/s3.d.ts.map +0 -1
- package/lib/aws/s3.js +0 -7
- package/lib/aws/s3.js.map +0 -1
- package/lib/aws/sqs/client.d.ts +0 -12
- package/lib/aws/sqs/client.d.ts.map +0 -1
- package/lib/aws/sqs/client.js +0 -11
- package/lib/aws/sqs/client.js.map +0 -1
- package/lib/aws/sqs/index.d.ts +0 -8
- package/lib/aws/sqs/index.d.ts.map +0 -1
- package/lib/aws/sqs/index.js +0 -8
- package/lib/aws/sqs/index.js.map +0 -1
- package/lib/aws/sqs/queue.consume.d.ts +0 -12
- package/lib/aws/sqs/queue.consume.d.ts.map +0 -1
- package/lib/aws/sqs/queue.consume.js +0 -2
- package/lib/aws/sqs/queue.consume.js.map +0 -1
- package/lib/aws/sqs/queue.d.ts +0 -81
- package/lib/aws/sqs/queue.d.ts.map +0 -1
- package/lib/aws/sqs/queue.event-source.d.ts +0 -22
- package/lib/aws/sqs/queue.event-source.d.ts.map +0 -1
- package/lib/aws/sqs/queue.event-source.js +0 -130
- package/lib/aws/sqs/queue.event-source.js.map +0 -1
- package/lib/aws/sqs/queue.js +0 -3
- package/lib/aws/sqs/queue.js.map +0 -1
- package/lib/aws/sqs/queue.provider.d.ts +0 -6
- package/lib/aws/sqs/queue.provider.d.ts.map +0 -1
- package/lib/aws/sqs/queue.provider.js +0 -87
- package/lib/aws/sqs/queue.provider.js.map +0 -1
- package/lib/aws/sqs/queue.send-message.d.ts +0 -13
- package/lib/aws/sqs/queue.send-message.d.ts.map +0 -1
- package/lib/aws/sqs/queue.send-message.js +0 -34
- package/lib/aws/sqs/queue.send-message.js.map +0 -1
- package/lib/aws/sts.d.ts +0 -8
- package/lib/aws/sts.d.ts.map +0 -1
- package/lib/aws/sts.js +0 -7
- package/lib/aws/sts.js.map +0 -1
- package/lib/aws/zip.d.ts +0 -3
- package/lib/aws/zip.d.ts.map +0 -1
- package/lib/aws/zip.js +0 -12
- package/lib/aws/zip.js.map +0 -1
- package/lib/binding.d.ts +0 -106
- package/lib/binding.d.ts.map +0 -1
- package/lib/binding.js +0 -27
- package/lib/binding.js.map +0 -1
- package/lib/capability.d.ts +0 -49
- package/lib/capability.d.ts.map +0 -1
- package/lib/capability.js +0 -1
- package/lib/capability.js.map +0 -1
- package/lib/cli/components/ApprovePlan.d.ts +0 -8
- package/lib/cli/components/ApprovePlan.d.ts.map +0 -1
- package/lib/cli/components/ApprovePlan.js +0 -30
- package/lib/cli/components/ApprovePlan.js.map +0 -1
- package/lib/cli/components/Plan.d.ts +0 -7
- package/lib/cli/components/Plan.d.ts.map +0 -1
- package/lib/cli/components/Plan.js +0 -100
- package/lib/cli/components/Plan.js.map +0 -1
- package/lib/cli/components/PlanProgress.d.ts +0 -13
- package/lib/cli/components/PlanProgress.d.ts.map +0 -1
- package/lib/cli/components/PlanProgress.js +0 -176
- package/lib/cli/components/PlanProgress.js.map +0 -1
- package/lib/cli/ink-service.d.ts +0 -4
- package/lib/cli/ink-service.d.ts.map +0 -1
- package/lib/cli/ink-service.js +0 -43
- package/lib/cli/ink-service.js.map +0 -1
- package/lib/cli/service.d.ts +0 -21
- package/lib/cli/service.d.ts.map +0 -1
- package/lib/cli/service.js +0 -5
- package/lib/cli/service.js.map +0 -1
- package/lib/cloudflare/account.d.ts +0 -10
- package/lib/cloudflare/account.d.ts.map +0 -1
- package/lib/cloudflare/account.js +0 -24
- package/lib/cloudflare/account.js.map +0 -1
- package/lib/cloudflare/api.d.ts +0 -36
- package/lib/cloudflare/api.d.ts.map +0 -1
- package/lib/cloudflare/api.js +0 -100
- package/lib/cloudflare/api.js.map +0 -1
- package/lib/cloudflare/config.d.ts +0 -9
- package/lib/cloudflare/config.d.ts.map +0 -1
- package/lib/cloudflare/config.js +0 -1
- package/lib/cloudflare/config.js.map +0 -1
- package/lib/cloudflare/context.d.ts +0 -27
- package/lib/cloudflare/context.d.ts.map +0 -1
- package/lib/cloudflare/context.js +0 -24
- package/lib/cloudflare/context.js.map +0 -1
- package/lib/cloudflare/index.d.ts +0 -8
- package/lib/cloudflare/index.d.ts.map +0 -1
- package/lib/cloudflare/index.js +0 -8
- package/lib/cloudflare/index.js.map +0 -1
- package/lib/cloudflare/kv/index.d.ts +0 -4
- package/lib/cloudflare/kv/index.d.ts.map +0 -1
- package/lib/cloudflare/kv/index.js +0 -4
- package/lib/cloudflare/kv/index.js.map +0 -1
- package/lib/cloudflare/kv/namespace.binding.d.ts +0 -10
- package/lib/cloudflare/kv/namespace.binding.d.ts.map +0 -1
- package/lib/cloudflare/kv/namespace.binding.js +0 -15
- package/lib/cloudflare/kv/namespace.binding.js.map +0 -1
- package/lib/cloudflare/kv/namespace.client.d.ts +0 -11
- package/lib/cloudflare/kv/namespace.client.d.ts.map +0 -1
- package/lib/cloudflare/kv/namespace.client.js +0 -31
- package/lib/cloudflare/kv/namespace.client.js.map +0 -1
- package/lib/cloudflare/kv/namespace.d.ts +0 -24
- package/lib/cloudflare/kv/namespace.d.ts.map +0 -1
- package/lib/cloudflare/kv/namespace.js +0 -3
- package/lib/cloudflare/kv/namespace.js.map +0 -1
- package/lib/cloudflare/kv/namespace.provider.d.ts +0 -6
- package/lib/cloudflare/kv/namespace.provider.d.ts.map +0 -1
- package/lib/cloudflare/kv/namespace.provider.js +0 -87
- package/lib/cloudflare/kv/namespace.provider.js.map +0 -1
- package/lib/cloudflare/live.d.ts +0 -11
- package/lib/cloudflare/live.d.ts.map +0 -1
- package/lib/cloudflare/live.js +0 -15
- package/lib/cloudflare/live.js.map +0 -1
- package/lib/cloudflare/r2/bucket.binding.d.ts +0 -10
- package/lib/cloudflare/r2/bucket.binding.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.binding.js +0 -18
- package/lib/cloudflare/r2/bucket.binding.js.map +0 -1
- package/lib/cloudflare/r2/bucket.client.d.ts +0 -8
- package/lib/cloudflare/r2/bucket.client.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.client.js +0 -9
- package/lib/cloudflare/r2/bucket.client.js.map +0 -1
- package/lib/cloudflare/r2/bucket.d.ts +0 -33
- package/lib/cloudflare/r2/bucket.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.del.d.ts +0 -4
- package/lib/cloudflare/r2/bucket.del.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.del.js +0 -7
- package/lib/cloudflare/r2/bucket.del.js.map +0 -1
- package/lib/cloudflare/r2/bucket.get.d.ts +0 -5
- package/lib/cloudflare/r2/bucket.get.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.get.js +0 -7
- package/lib/cloudflare/r2/bucket.get.js.map +0 -1
- package/lib/cloudflare/r2/bucket.head.d.ts +0 -4
- package/lib/cloudflare/r2/bucket.head.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.head.js +0 -7
- package/lib/cloudflare/r2/bucket.head.js.map +0 -1
- package/lib/cloudflare/r2/bucket.js +0 -3
- package/lib/cloudflare/r2/bucket.js.map +0 -1
- package/lib/cloudflare/r2/bucket.list.d.ts +0 -5
- package/lib/cloudflare/r2/bucket.list.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.list.js +0 -7
- package/lib/cloudflare/r2/bucket.list.js.map +0 -1
- package/lib/cloudflare/r2/bucket.multipart.d.ts +0 -19
- package/lib/cloudflare/r2/bucket.multipart.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.multipart.js +0 -25
- package/lib/cloudflare/r2/bucket.multipart.js.map +0 -1
- package/lib/cloudflare/r2/bucket.provider.d.ts +0 -5
- package/lib/cloudflare/r2/bucket.provider.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.provider.js +0 -78
- package/lib/cloudflare/r2/bucket.provider.js.map +0 -1
- package/lib/cloudflare/r2/bucket.put.d.ts +0 -6
- package/lib/cloudflare/r2/bucket.put.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.put.js +0 -8
- package/lib/cloudflare/r2/bucket.put.js.map +0 -1
- package/lib/cloudflare/r2/index.d.ts +0 -10
- package/lib/cloudflare/r2/index.d.ts.map +0 -1
- package/lib/cloudflare/r2/index.js +0 -10
- package/lib/cloudflare/r2/index.js.map +0 -1
- package/lib/cloudflare/stream.d.ts +0 -10
- package/lib/cloudflare/stream.d.ts.map +0 -1
- package/lib/cloudflare/stream.js +0 -16
- package/lib/cloudflare/stream.js.map +0 -1
- package/lib/cloudflare/worker/assets.fetch.d.ts +0 -9
- package/lib/cloudflare/worker/assets.fetch.d.ts.map +0 -1
- package/lib/cloudflare/worker/assets.fetch.js +0 -12
- package/lib/cloudflare/worker/assets.fetch.js.map +0 -1
- package/lib/cloudflare/worker/assets.provider.d.ts +0 -66
- package/lib/cloudflare/worker/assets.provider.d.ts.map +0 -1
- package/lib/cloudflare/worker/assets.provider.js +0 -145
- package/lib/cloudflare/worker/assets.provider.js.map +0 -1
- package/lib/cloudflare/worker/index.d.ts +0 -5
- package/lib/cloudflare/worker/index.d.ts.map +0 -1
- package/lib/cloudflare/worker/index.js +0 -5
- package/lib/cloudflare/worker/index.js.map +0 -1
- package/lib/cloudflare/worker/worker.d.ts +0 -66
- package/lib/cloudflare/worker/worker.d.ts.map +0 -1
- package/lib/cloudflare/worker/worker.handler.d.ts +0 -11
- package/lib/cloudflare/worker/worker.handler.d.ts.map +0 -1
- package/lib/cloudflare/worker/worker.handler.js +0 -15
- package/lib/cloudflare/worker/worker.handler.js.map +0 -1
- package/lib/cloudflare/worker/worker.js +0 -4
- package/lib/cloudflare/worker/worker.js.map +0 -1
- package/lib/cloudflare/worker/worker.provider.d.ts +0 -10
- package/lib/cloudflare/worker/worker.provider.d.ts.map +0 -1
- package/lib/cloudflare/worker/worker.provider.js +0 -225
- package/lib/cloudflare/worker/worker.provider.js.map +0 -1
- package/lib/cloudflare/worker/worker.serve.d.ts +0 -39
- package/lib/cloudflare/worker/worker.serve.d.ts.map +0 -1
- package/lib/cloudflare/worker/worker.serve.js +0 -4
- package/lib/cloudflare/worker/worker.serve.js.map +0 -1
- package/lib/data.d.ts +0 -3
- package/lib/data.d.ts.map +0 -1
- package/lib/data.js +0 -8
- package/lib/data.js.map +0 -1
- package/lib/destroy.d.ts +0 -2
- package/lib/destroy.d.ts.map +0 -1
- package/lib/destroy.js +0 -3
- package/lib/destroy.js.map +0 -1
- package/lib/diff.d.ts +0 -18
- package/lib/diff.d.ts.map +0 -1
- package/lib/diff.js +0 -22
- package/lib/diff.js.map +0 -1
- package/lib/dot-alchemy.d.ts +0 -10
- package/lib/dot-alchemy.d.ts.map +0 -1
- package/lib/dot-alchemy.js +0 -15
- package/lib/dot-alchemy.js.map +0 -1
- package/lib/env.d.ts +0 -9
- package/lib/env.d.ts.map +0 -1
- package/lib/env.js +0 -19
- package/lib/env.js.map +0 -1
- package/lib/esbuild.d.ts +0 -28
- package/lib/esbuild.d.ts.map +0 -1
- package/lib/esbuild.js +0 -63
- package/lib/esbuild.js.map +0 -1
- package/lib/event.d.ts +0 -16
- package/lib/event.d.ts.map +0 -1
- package/lib/event.js +0 -1
- package/lib/event.js.map +0 -1
- package/lib/exports.d.ts +0 -9
- package/lib/exports.d.ts.map +0 -1
- package/lib/exports.js +0 -13
- package/lib/exports.js.map +0 -1
- package/lib/index.d.ts +0 -27
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -27
- package/lib/index.js.map +0 -1
- package/lib/input.d.ts +0 -32
- package/lib/input.d.ts.map +0 -1
- package/lib/input.js +0 -1
- package/lib/input.js.map +0 -1
- package/lib/instance-id.d.ts +0 -12
- package/lib/instance-id.d.ts.map +0 -1
- package/lib/instance-id.js +0 -16
- package/lib/instance-id.js.map +0 -1
- package/lib/output.d.ts +0 -145
- package/lib/output.d.ts.map +0 -1
- package/lib/output.js +0 -283
- package/lib/output.js.map +0 -1
- package/lib/phase.d.ts +0 -2
- package/lib/phase.d.ts.map +0 -1
- package/lib/phase.js +0 -1
- package/lib/phase.js.map +0 -1
- package/lib/physical-name.d.ts +0 -28
- package/lib/physical-name.d.ts.map +0 -1
- package/lib/physical-name.js +0 -55
- package/lib/physical-name.js.map +0 -1
- package/lib/plan.d.ts +0 -135
- package/lib/plan.d.ts.map +0 -1
- package/lib/plan.js +0 -686
- package/lib/plan.js.map +0 -1
- package/lib/policy.d.ts +0 -54
- package/lib/policy.d.ts.map +0 -1
- package/lib/policy.js +0 -24
- package/lib/policy.js.map +0 -1
- package/lib/provider.d.ts +0 -71
- package/lib/provider.d.ts.map +0 -1
- package/lib/provider.js +0 -11
- package/lib/provider.js.map +0 -1
- package/lib/ref.d.ts +0 -14
- package/lib/ref.d.ts.map +0 -1
- package/lib/ref.js +0 -21
- package/lib/ref.js.map +0 -1
- package/lib/reporter.d.ts +0 -8
- package/lib/reporter.d.ts.map +0 -1
- package/lib/reporter.js +0 -4
- package/lib/reporter.js.map +0 -1
- package/lib/resource.d.ts +0 -36
- package/lib/resource.d.ts.map +0 -1
- package/lib/resource.js +0 -26
- package/lib/resource.js.map +0 -1
- package/lib/runtime.d.ts +0 -40
- package/lib/runtime.d.ts.map +0 -1
- package/lib/runtime.js +0 -54
- package/lib/runtime.js.map +0 -1
- package/lib/schema.d.ts +0 -37
- package/lib/schema.d.ts.map +0 -1
- package/lib/schema.js +0 -61
- package/lib/schema.js.map +0 -1
- package/lib/service.d.ts +0 -36
- package/lib/service.d.ts.map +0 -1
- package/lib/service.js +0 -4
- package/lib/service.js.map +0 -1
- package/lib/sha256.d.ts +0 -5
- package/lib/sha256.d.ts.map +0 -1
- package/lib/sha256.js +0 -16
- package/lib/sha256.js.map +0 -1
- package/lib/stack.d.ts +0 -60
- package/lib/stack.d.ts.map +0 -1
- package/lib/stack.js +0 -11
- package/lib/stack.js.map +0 -1
- package/lib/stage.d.ts +0 -39
- package/lib/stage.d.ts.map +0 -1
- package/lib/stage.js +0 -32
- package/lib/stage.js.map +0 -1
- package/lib/state.d.ts +0 -157
- package/lib/state.d.ts.map +0 -1
- package/lib/state.js +0 -71
- package/lib/state.js.map +0 -1
- package/lib/tags.d.ts +0 -32
- package/lib/tags.d.ts.map +0 -1
- package/lib/tags.js +0 -49
- package/lib/tags.js.map +0 -1
- package/lib/test.d.ts +0 -35
- package/lib/test.d.ts.map +0 -1
- package/lib/test.js +0 -68
- package/lib/test.js.map +0 -1
- package/lib/todo.d.ts +0 -3
- package/lib/todo.d.ts.map +0 -1
- package/lib/todo.js +0 -3
- package/lib/todo.js.map +0 -1
- package/lib/tsconfig.test.tsbuildinfo +0 -1
- package/lib/type.d.ts +0 -6
- package/lib/type.d.ts.map +0 -1
- package/lib/type.js +0 -3
- package/lib/type.js.map +0 -1
- package/lib/unknown.d.ts +0 -4
- package/lib/unknown.d.ts.map +0 -1
- package/lib/unknown.js +0 -4
- package/lib/unknown.js.map +0 -1
- package/lib/user.d.ts +0 -3
- package/lib/user.d.ts.map +0 -1
- package/lib/user.js +0 -3
- package/lib/user.js.map +0 -1
- package/lib/util.d.ts +0 -6
- package/lib/util.d.ts.map +0 -1
- package/lib/util.js +0 -9
- package/lib/util.js.map +0 -1
- package/src/$.ts +0 -17
- package/src/app.ts +0 -15
- package/src/apply.ts +0 -858
- package/src/aws/account.ts +0 -57
- package/src/aws/assets.ts +0 -8
- package/src/aws/bundle.ts +0 -5
- package/src/aws/client.ts +0 -46
- package/src/aws/config.ts +0 -16
- package/src/aws/credentials.ts +0 -444
- package/src/aws/dynamodb/attribute-value.ts +0 -240
- package/src/aws/dynamodb/client.ts +0 -20
- package/src/aws/dynamodb/index.ts +0 -12
- package/src/aws/dynamodb/projection.ts +0 -159
- package/src/aws/dynamodb/secondary-index.ts +0 -45
- package/src/aws/dynamodb/table.get-item.ts +0 -173
- package/src/aws/dynamodb/table.provider.ts +0 -288
- package/src/aws/dynamodb/table.ts +0 -101
- package/src/aws/ec2/client.ts +0 -20
- package/src/aws/ec2/index.ts +0 -15
- package/src/aws/ec2/internet-gateway.provider.ts +0 -316
- package/src/aws/ec2/internet-gateway.ts +0 -79
- package/src/aws/ec2/route-table-association.provider.ts +0 -214
- package/src/aws/ec2/route-table-association.ts +0 -82
- package/src/aws/ec2/route-table.provider.ts +0 -306
- package/src/aws/ec2/route-table.ts +0 -175
- package/src/aws/ec2/route.provider.ts +0 -213
- package/src/aws/ec2/route.ts +0 -192
- package/src/aws/ec2/subnet.provider.ts +0 -358
- package/src/aws/ec2/subnet.ts +0 -213
- package/src/aws/ec2/vpc.provider.ts +0 -294
- package/src/aws/ec2/vpc.ts +0 -165
- package/src/aws/iam.ts +0 -30
- package/src/aws/index.ts +0 -63
- package/src/aws/lambda/client.ts +0 -14
- package/src/aws/lambda/consume.ts +0 -64
- package/src/aws/lambda/function.handler.ts +0 -30
- package/src/aws/lambda/function.invoke.ts +0 -44
- package/src/aws/lambda/function.provider.ts +0 -675
- package/src/aws/lambda/function.ts +0 -48
- package/src/aws/lambda/index.ts +0 -11
- package/src/aws/lambda/serve.ts +0 -29
- package/src/aws/parse-ini.ts +0 -80
- package/src/aws/profile.ts +0 -3
- package/src/aws/region.ts +0 -76
- package/src/aws/s3.ts +0 -10
- package/src/aws/sqs/client.ts +0 -20
- package/src/aws/sqs/index.ts +0 -8
- package/src/aws/sqs/queue.consume.ts +0 -13
- package/src/aws/sqs/queue.event-source.ts +0 -227
- package/src/aws/sqs/queue.provider.ts +0 -108
- package/src/aws/sqs/queue.send-message.ts +0 -48
- package/src/aws/sqs/queue.ts +0 -91
- package/src/aws/sts.ts +0 -13
- package/src/aws/zip.ts +0 -17
- package/src/binding.ts +0 -240
- package/src/capability.ts +0 -63
- package/src/cli/components/ApprovePlan.tsx +0 -44
- package/src/cli/components/Plan.tsx +0 -155
- package/src/cli/components/PlanProgress.tsx +0 -224
- package/src/cli/index.ts +0 -2
- package/src/cli/ink-service.tsx +0 -61
- package/src/cli/service.ts +0 -23
- package/src/cloudflare/account.ts +0 -37
- package/src/cloudflare/api.ts +0 -156
- package/src/cloudflare/config.ts +0 -7
- package/src/cloudflare/context.ts +0 -49
- package/src/cloudflare/index.ts +0 -8
- package/src/cloudflare/kv/index.ts +0 -3
- package/src/cloudflare/kv/namespace.binding.ts +0 -27
- package/src/cloudflare/kv/namespace.client.ts +0 -70
- package/src/cloudflare/kv/namespace.provider.ts +0 -105
- package/src/cloudflare/kv/namespace.ts +0 -30
- package/src/cloudflare/live.ts +0 -32
- package/src/cloudflare/r2/bucket.binding.ts +0 -29
- package/src/cloudflare/r2/bucket.client.ts +0 -22
- package/src/cloudflare/r2/bucket.del.ts +0 -11
- package/src/cloudflare/r2/bucket.get.ts +0 -13
- package/src/cloudflare/r2/bucket.head.ts +0 -11
- package/src/cloudflare/r2/bucket.list.ts +0 -12
- package/src/cloudflare/r2/bucket.multipart.ts +0 -55
- package/src/cloudflare/r2/bucket.provider.ts +0 -94
- package/src/cloudflare/r2/bucket.put.ts +0 -17
- package/src/cloudflare/r2/bucket.ts +0 -44
- package/src/cloudflare/r2/index.ts +0 -9
- package/src/cloudflare/stream.ts +0 -21
- package/src/cloudflare/worker/assets.fetch.ts +0 -29
- package/src/cloudflare/worker/assets.provider.ts +0 -249
- package/src/cloudflare/worker/index.ts +0 -4
- package/src/cloudflare/worker/worker.handler.ts +0 -39
- package/src/cloudflare/worker/worker.provider.ts +0 -279
- package/src/cloudflare/worker/worker.serve.ts +0 -22
- package/src/cloudflare/worker/worker.ts +0 -77
- package/src/destroy.ts +0 -3
- package/src/diff.ts +0 -48
- package/src/dot-alchemy.ts +0 -18
- package/src/env.ts +0 -39
- package/src/esbuild.ts +0 -98
- package/src/event.ts +0 -33
- package/src/exports.ts +0 -21
- package/src/input.ts +0 -81
- package/src/instance-id.ts +0 -20
- package/src/output.ts +0 -542
- package/src/phase.ts +0 -1
- package/src/physical-name.ts +0 -84
- package/src/plan.ts +0 -1123
- package/src/policy.ts +0 -128
- package/src/provider.ts +0 -112
- package/src/ref.ts +0 -48
- package/src/reporter.ts +0 -8
- package/src/resource.ts +0 -140
- package/src/runtime.ts +0 -152
- package/src/schema.ts +0 -102
- package/src/service.ts +0 -59
- package/src/sha256.ts +0 -23
- package/src/stack.ts +0 -116
- package/src/stage.ts +0 -85
- package/src/state.ts +0 -390
- package/src/tags.ts +0 -69
- package/src/test.ts +0 -172
- package/src/todo.ts +0 -4
- package/src/unknown.ts +0 -6
- package/src/user.ts +0 -4
- package/src/util.ts +0 -21
- /package/src/{aws/arn.ts → AWS/Arn.ts} +0 -0
- /package/src/{aws/dynamodb/expr.ts → AWS/DynamoDB/Expr.ts} +0 -0
- /package/src/{assert-never.ts → Util/assert-never.ts} +0 -0
- /package/src/{data.ts → Util/data.ts} +0 -0
- /package/src/{type.ts → Util/type.ts} +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import * as S from "effect/Schema";
|
|
2
|
+
import * as ServiceMap from "effect/ServiceMap";
|
|
3
|
+
import type { Instance } from "..//Util/instance.ts";
|
|
4
|
+
import type { Pointer } from "..//Util/pointer.ts";
|
|
5
|
+
import { isAspect, type Aspect, type AspectLike } from "./Aspect.ts";
|
|
6
|
+
|
|
7
|
+
export class AspectGraph extends ServiceMap.Service<
|
|
8
|
+
AspectGraph,
|
|
9
|
+
{
|
|
10
|
+
aspects: AspectIndex<AspectLike>;
|
|
11
|
+
schema: S.Schema<AspectIndex>;
|
|
12
|
+
}
|
|
13
|
+
>()("AspectGraphService") {}
|
|
14
|
+
|
|
15
|
+
export type AspectIndex<A extends AspectLike = AspectLike> = {
|
|
16
|
+
[type in AspectSet<A>["type"]]: {
|
|
17
|
+
[id in Extract<AspectSet<A>, { type: type }>["id"]]: Extract<
|
|
18
|
+
Extract<AspectSet<A>, { type: type }>,
|
|
19
|
+
{ id: id }
|
|
20
|
+
>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type AspectCategory<Aspects extends Aspect> = {
|
|
25
|
+
[id in keyof Aspects["id"]]: Extract<Aspects, { id: id }>;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type AspectSet<A extends AspectLike = any> =
|
|
29
|
+
| A
|
|
30
|
+
| Visit<A["references"][number], FQN<A>>;
|
|
31
|
+
|
|
32
|
+
type Visit<Value, Seen extends string = never> =
|
|
33
|
+
Pointer.Resolve<Value> extends infer A
|
|
34
|
+
? A extends {
|
|
35
|
+
type: string;
|
|
36
|
+
id: string;
|
|
37
|
+
references: infer References extends any[];
|
|
38
|
+
}
|
|
39
|
+
? FQN<A> extends Seen
|
|
40
|
+
? never
|
|
41
|
+
: Instance<A> | Visit<References[number], Seen | FQN<A>>
|
|
42
|
+
: A extends readonly (infer I)[]
|
|
43
|
+
? Visit<I, Seen>
|
|
44
|
+
: A extends Record<string, infer V>
|
|
45
|
+
? Visit<V, Seen>
|
|
46
|
+
: never
|
|
47
|
+
: never;
|
|
48
|
+
|
|
49
|
+
type FQN<A extends { type: string; id: string } = any> = A["id"] extends string
|
|
50
|
+
? `${A["type"]}:${A["id"]}`
|
|
51
|
+
: never;
|
|
52
|
+
|
|
53
|
+
const getFqn = <A extends { type: string; id: string }>(a: A): FQN<A> =>
|
|
54
|
+
`${a.type}:${a.id}` as FQN<A>;
|
|
55
|
+
|
|
56
|
+
export type AspectKinds<A extends Aspect> = {
|
|
57
|
+
[type in keyof AspectIndex<A>]: {
|
|
58
|
+
// @ts-expect-error
|
|
59
|
+
[id in keyof AspectIndex<A>[type]]: InstanceType<
|
|
60
|
+
// @ts-expect-error
|
|
61
|
+
AspectIndex<A>[type][id]["class"]
|
|
62
|
+
>;
|
|
63
|
+
// @ts-expect-error
|
|
64
|
+
}[keyof AspectIndex<A>[type]];
|
|
65
|
+
}[keyof AspectIndex<A>];
|
|
66
|
+
|
|
67
|
+
export const deriveGraph = <A extends AspectLike>(agent: A): AspectIndex<A> => {
|
|
68
|
+
const seen = new Set<FQN>();
|
|
69
|
+
return [agent, ...agent.references.flatMap((v) => visit(v, seen))].reduce(
|
|
70
|
+
(acc: AspectIndex<A>, aspect) => ({
|
|
71
|
+
...acc,
|
|
72
|
+
[aspect.type]: {
|
|
73
|
+
...acc[aspect.type as keyof AspectIndex<A>],
|
|
74
|
+
[aspect.id as keyof AspectIndex<A>[keyof AspectIndex<A>]]: aspect,
|
|
75
|
+
},
|
|
76
|
+
}),
|
|
77
|
+
{} as AspectIndex<A>,
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const visit = <A>(a: A, seen: Set<FQN>): Aspect[] => {
|
|
82
|
+
if (isAspect(a)) {
|
|
83
|
+
const fqn = getFqn(a);
|
|
84
|
+
if (!seen.has(fqn)) {
|
|
85
|
+
seen.add(fqn);
|
|
86
|
+
return [a, ...a.references.flatMap((v) => visit(v, seen))];
|
|
87
|
+
}
|
|
88
|
+
} else if (Array.isArray(a)) {
|
|
89
|
+
return a.flatMap((v) => visit(v, seen));
|
|
90
|
+
} else if (a instanceof Set) {
|
|
91
|
+
return Array.from(a).flatMap((v) => visit(v, seen));
|
|
92
|
+
} else if (a instanceof Map) {
|
|
93
|
+
return Array.from(a.values()).flatMap((v) => visit(v, seen));
|
|
94
|
+
} else if (typeof a === "object" && a !== null) {
|
|
95
|
+
return Object.values(a).flatMap((v) => visit(v, seen));
|
|
96
|
+
}
|
|
97
|
+
return [];
|
|
98
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as ServiceMap from "effect/ServiceMap";
|
|
2
|
+
import type { Aspect } from "./Aspect.ts";
|
|
3
|
+
|
|
4
|
+
export type ContextPlugin<A extends Aspect> = ServiceMap.Service<
|
|
5
|
+
`ContextPlugin<${A["type"]}>`,
|
|
6
|
+
ContextPluginService<A>
|
|
7
|
+
>;
|
|
8
|
+
|
|
9
|
+
export interface ContextPluginService<A extends Aspect> {
|
|
10
|
+
context: (a: A) => string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const ContextPlugin = <A extends Aspect>(
|
|
14
|
+
type: A["type"],
|
|
15
|
+
): ContextPlugin<A> =>
|
|
16
|
+
ServiceMap.Service<`ContextPlugin<${A["type"]}>`, ContextPluginService<A>>(
|
|
17
|
+
`ContextPlugin<${type}>`,
|
|
18
|
+
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Layer from "effect/Layer";
|
|
3
|
+
import * as ServiceMap from "effect/ServiceMap";
|
|
4
|
+
import type { Aspect } from "./Aspect.ts";
|
|
5
|
+
import type { ContextPlugin, ContextPluginService } from "./ContextPlugin.ts";
|
|
6
|
+
|
|
7
|
+
export type Plugins<A extends Aspect> = {
|
|
8
|
+
readonly context: Plugin<ContextPlugin<A>, ContextPluginService<A>>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type Plugin<Tag, Service> = {
|
|
12
|
+
effect: <Err, Req>(
|
|
13
|
+
eff: Effect.Effect<Service, Err, Req>,
|
|
14
|
+
) => Layer.Layer<Tag, Err, Req>;
|
|
15
|
+
succeed: (service: Service) => Layer.Layer<Tag>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type ContextPlugins<C> = C extends Aspect ? ContextPlugin<C> : never;
|
|
19
|
+
|
|
20
|
+
export const createPluginBuilder = <
|
|
21
|
+
Tag extends ServiceMap.Service<string, Service>,
|
|
22
|
+
Service,
|
|
23
|
+
>(
|
|
24
|
+
tag: Tag,
|
|
25
|
+
) => ({
|
|
26
|
+
effect: <Err, Req>(eff: Effect.Effect<Service, Err, Req>) =>
|
|
27
|
+
Layer.effect(tag, eff),
|
|
28
|
+
succeed: (service: Service) => Layer.succeed(tag, service),
|
|
29
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as S from "effect/Schema";
|
|
2
|
+
import { defineAspect, type Aspect } from "../Aspect.ts";
|
|
3
|
+
|
|
4
|
+
export interface Channel<
|
|
5
|
+
Name extends string = string,
|
|
6
|
+
References extends any[] = any[],
|
|
7
|
+
> extends Aspect<Channel, "channel", Name, References> {}
|
|
8
|
+
|
|
9
|
+
export type ChannelId = string;
|
|
10
|
+
export const ChannelId = S.String.annotate({
|
|
11
|
+
description: "The ID of the channel",
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const Channel =
|
|
15
|
+
defineAspect<
|
|
16
|
+
<const Name extends string>(
|
|
17
|
+
name: Name,
|
|
18
|
+
) => <References extends any[]>(
|
|
19
|
+
template: TemplateStringsArray,
|
|
20
|
+
...references: References
|
|
21
|
+
) => Channel<Name, References>
|
|
22
|
+
>("channel");
|
|
23
|
+
|
|
24
|
+
export const channelContext = Channel.plugin.context.succeed({
|
|
25
|
+
context: (channel) => `#${channel.id}`,
|
|
26
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as S from "effect/Schema";
|
|
2
|
+
import { Task } from "../process/task.ts";
|
|
3
|
+
import { Message } from "./message.ts";
|
|
4
|
+
import { Thread } from "./thread.ts";
|
|
5
|
+
|
|
6
|
+
export class MessageCreatedEvent extends S.Class<MessageCreatedEvent>(
|
|
7
|
+
"MessageCreatedEvent",
|
|
8
|
+
)({
|
|
9
|
+
message: Message,
|
|
10
|
+
}) {}
|
|
11
|
+
|
|
12
|
+
export class ThreadCreatedEvent extends S.Class<ThreadCreatedEvent>(
|
|
13
|
+
"ThreadCreatedEvent",
|
|
14
|
+
)({
|
|
15
|
+
thread: Thread,
|
|
16
|
+
}) {}
|
|
17
|
+
|
|
18
|
+
export class ThreadUpdatedEvent extends S.Class<ThreadUpdatedEvent>(
|
|
19
|
+
"ThreadUpdatedEvent",
|
|
20
|
+
)({
|
|
21
|
+
thread: Thread,
|
|
22
|
+
}) {}
|
|
23
|
+
|
|
24
|
+
export class TaskStartedEvent extends S.Class<TaskStartedEvent>(
|
|
25
|
+
"TaskStartedEvent",
|
|
26
|
+
)({
|
|
27
|
+
task: Task,
|
|
28
|
+
}) {}
|
|
29
|
+
|
|
30
|
+
export class TaskCompletedEvent extends S.Class<TaskCompletedEvent>(
|
|
31
|
+
"TaskCompletedEvent",
|
|
32
|
+
)({
|
|
33
|
+
task: Task,
|
|
34
|
+
}) {}
|
|
35
|
+
|
|
36
|
+
export type ChatEvent = S.Schema.Type<typeof ChatEvent>;
|
|
37
|
+
export const ChatEvent = S.Union([
|
|
38
|
+
MessageCreatedEvent,
|
|
39
|
+
ThreadCreatedEvent,
|
|
40
|
+
ThreadUpdatedEvent,
|
|
41
|
+
TaskStartedEvent,
|
|
42
|
+
TaskCompletedEvent,
|
|
43
|
+
]);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as S from "effect/Schema";
|
|
2
|
+
import { TaskId } from "../process/task.ts";
|
|
3
|
+
|
|
4
|
+
export type Message = (typeof Message)["Type"];
|
|
5
|
+
export const Message = S.Union([
|
|
6
|
+
S.suspend((): S.Schema<TextMessage> => TextMessage),
|
|
7
|
+
S.suspend((): S.Schema<TaskMessage> => TaskMessage),
|
|
8
|
+
]);
|
|
9
|
+
|
|
10
|
+
export type MessageId = string;
|
|
11
|
+
|
|
12
|
+
export const MessageId = S.String.annotate({
|
|
13
|
+
description: "The ID of the message",
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export class TextMessage extends S.Class<TextMessage>("TextMessage")({
|
|
17
|
+
messageId: MessageId,
|
|
18
|
+
content: S.String.annotate({
|
|
19
|
+
description: "The content of the message",
|
|
20
|
+
}),
|
|
21
|
+
sender: S.String.annotate({
|
|
22
|
+
description: "The sender of the message",
|
|
23
|
+
}),
|
|
24
|
+
timestamp: S.Number.annotate({
|
|
25
|
+
description: "The timestamp of the message",
|
|
26
|
+
}),
|
|
27
|
+
}) {}
|
|
28
|
+
|
|
29
|
+
export class TaskMessage extends S.Class<TaskMessage>("TaskMessage")({
|
|
30
|
+
messageId: MessageId,
|
|
31
|
+
taskId: TaskId,
|
|
32
|
+
taskDescription: S.String.annotate({
|
|
33
|
+
description: "The description of the task",
|
|
34
|
+
}),
|
|
35
|
+
}) {}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as S from "effect/Schema";
|
|
3
|
+
import * as ServiceMap from "effect/ServiceMap";
|
|
4
|
+
import { AgentId } from "../Agent.ts";
|
|
5
|
+
import { StreamTextPart } from "../llm/stream-text-part.ts";
|
|
6
|
+
import { Task, TaskId } from "../process/task.ts";
|
|
7
|
+
import { ChannelId } from "./channel.ts";
|
|
8
|
+
import { Message, MessageId } from "./message.ts";
|
|
9
|
+
import { Thread, ThreadId } from "./thread.ts";
|
|
10
|
+
|
|
11
|
+
export type SenderId = string;
|
|
12
|
+
export const SenderId = S.String.annotate({
|
|
13
|
+
description: "The ID of the Agent or User who sent the message",
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export class GetThreadRequest extends S.Class<GetThreadRequest>(
|
|
17
|
+
"GetThreadRequest",
|
|
18
|
+
)({
|
|
19
|
+
threadId: ThreadId,
|
|
20
|
+
}) {}
|
|
21
|
+
|
|
22
|
+
export class GetThreadResponse extends S.Class<GetThreadResponse>(
|
|
23
|
+
"GetThreadResponse",
|
|
24
|
+
)({
|
|
25
|
+
thread: S.optional(Thread),
|
|
26
|
+
}) {}
|
|
27
|
+
|
|
28
|
+
export class CreateThreadRequest extends S.Class<CreateThreadRequest>(
|
|
29
|
+
"CreateThreadRequest",
|
|
30
|
+
)({
|
|
31
|
+
channelId: ChannelId,
|
|
32
|
+
parentThreadId: S.optional(ThreadId),
|
|
33
|
+
}) {}
|
|
34
|
+
|
|
35
|
+
export class CreateThreadResponse extends S.Class<CreateThreadResponse>(
|
|
36
|
+
"CreateThreadResponse",
|
|
37
|
+
)({
|
|
38
|
+
thread: Thread,
|
|
39
|
+
}) {}
|
|
40
|
+
|
|
41
|
+
export class SendMessageRequest extends S.Class<SendMessageRequest>(
|
|
42
|
+
"SendMessageRequest",
|
|
43
|
+
)({
|
|
44
|
+
threadId: ThreadId,
|
|
45
|
+
sender: SenderId,
|
|
46
|
+
content: S.String,
|
|
47
|
+
}) {}
|
|
48
|
+
|
|
49
|
+
export class SendMessageResponse extends S.Class<SendMessageResponse>(
|
|
50
|
+
"SendMessageResponse",
|
|
51
|
+
)({
|
|
52
|
+
messageId: MessageId,
|
|
53
|
+
}) {}
|
|
54
|
+
|
|
55
|
+
export class ListMessagesRequest extends S.Class<ListMessagesRequest>(
|
|
56
|
+
"ListMessagesRequest",
|
|
57
|
+
)({
|
|
58
|
+
threadId: ThreadId,
|
|
59
|
+
nextToken: S.optional(S.String),
|
|
60
|
+
}) {}
|
|
61
|
+
|
|
62
|
+
export class ListMessagesResponse extends S.Class<ListMessagesResponse>(
|
|
63
|
+
"ListMessagesResponse",
|
|
64
|
+
)({
|
|
65
|
+
messages: S.Array(Message),
|
|
66
|
+
nextToken: S.optional(S.String),
|
|
67
|
+
}) {}
|
|
68
|
+
|
|
69
|
+
export class ListThreadsRequest extends S.Class<ListThreadsRequest>(
|
|
70
|
+
"ListThreadsRequest",
|
|
71
|
+
)({
|
|
72
|
+
channelId: ChannelId,
|
|
73
|
+
nextToken: S.optional(S.String),
|
|
74
|
+
}) {}
|
|
75
|
+
|
|
76
|
+
export class ListThreadsResponse extends S.Class<ListThreadsResponse>(
|
|
77
|
+
"ListThreadsResponse",
|
|
78
|
+
)({
|
|
79
|
+
threads: S.Array(Thread),
|
|
80
|
+
nextToken: S.optional(S.String),
|
|
81
|
+
}) {}
|
|
82
|
+
|
|
83
|
+
export class AppendRequest extends S.Class<AppendRequest>("AppendRequest")({
|
|
84
|
+
taskId: TaskId,
|
|
85
|
+
part: StreamTextPart,
|
|
86
|
+
}) {}
|
|
87
|
+
|
|
88
|
+
export class SubscribeRequest extends S.Class<SubscribeRequest>(
|
|
89
|
+
"SubscribeRequest",
|
|
90
|
+
)({
|
|
91
|
+
taskId: TaskId,
|
|
92
|
+
}) {}
|
|
93
|
+
|
|
94
|
+
export class CreateTaskRequest extends S.Class<CreateTaskRequest>(
|
|
95
|
+
"CreateTaskRequest",
|
|
96
|
+
)({
|
|
97
|
+
threadId: ThreadId,
|
|
98
|
+
agentId: AgentId,
|
|
99
|
+
}) {}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The ChatService is the central service for managing Channels, Threads, and Messages.
|
|
103
|
+
*/
|
|
104
|
+
export class Chat extends ServiceMap.Service<
|
|
105
|
+
Chat,
|
|
106
|
+
{
|
|
107
|
+
getThread: (request: GetThreadRequest) => Effect.Effect<GetThreadResponse>;
|
|
108
|
+
createThread: (
|
|
109
|
+
request: CreateThreadRequest,
|
|
110
|
+
) => Effect.Effect<CreateThreadResponse>;
|
|
111
|
+
listThreads: (
|
|
112
|
+
request: ListThreadsRequest,
|
|
113
|
+
) => Effect.Effect<ListThreadsResponse>;
|
|
114
|
+
sendMessage: (
|
|
115
|
+
request: SendMessageRequest,
|
|
116
|
+
) => Effect.Effect<SendMessageResponse>;
|
|
117
|
+
listMessages: (
|
|
118
|
+
request: ListMessagesRequest,
|
|
119
|
+
) => Effect.Effect<ListMessagesResponse>;
|
|
120
|
+
subscribe: (request: SubscribeRequest) => Effect.Effect<StreamTextPart>;
|
|
121
|
+
createTask: (request: CreateTaskRequest) => Effect.Effect<Task>;
|
|
122
|
+
appendTask: (request: AppendRequest) => Effect.Effect<void>;
|
|
123
|
+
subscribeTask: (request: SubscribeRequest) => Effect.Effect<StreamTextPart>;
|
|
124
|
+
sinkTask: (
|
|
125
|
+
taskId: TaskId,
|
|
126
|
+
sink: (part: StreamTextPart) => Effect.Effect<void>,
|
|
127
|
+
) => Effect.Effect<void>;
|
|
128
|
+
sinkThreadDriver: (
|
|
129
|
+
threadId: ThreadId,
|
|
130
|
+
sink: (part: StreamTextPart) => Effect.Effect<void>,
|
|
131
|
+
) => Effect.Effect<void>;
|
|
132
|
+
}
|
|
133
|
+
>()("Chat") {}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as S from "effect/Schema";
|
|
2
|
+
|
|
3
|
+
export type ThreadId = string;
|
|
4
|
+
export const ThreadId = S.String.annotate({
|
|
5
|
+
description: "The ID of the thread",
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export class Thread extends S.Class<Thread>("Thread")({
|
|
9
|
+
threadId: ThreadId,
|
|
10
|
+
participants: S.Array(S.String).annotate({
|
|
11
|
+
description: "The agent participants in the thread",
|
|
12
|
+
}),
|
|
13
|
+
messages: S.Array(S.String).annotate({
|
|
14
|
+
description: "The messages in the thread",
|
|
15
|
+
}),
|
|
16
|
+
parent: S.optional(S.suspend((): S.Schema<Thread> => Thread)),
|
|
17
|
+
}) {}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Option from "effect/Option";
|
|
3
|
+
import * as S from "effect/Schema";
|
|
4
|
+
import { ChildProcess } from "effect/unstable/process";
|
|
5
|
+
import { cwd } from "../../Config.ts";
|
|
6
|
+
import { AspectConfig } from "../Aspect.ts";
|
|
7
|
+
import { Tool } from "../tool/tool.ts";
|
|
8
|
+
import { CommandValidator } from "../util/command-validator.ts";
|
|
9
|
+
import { exec } from "../util/exec.ts";
|
|
10
|
+
|
|
11
|
+
export class command extends Tool.input("command")`The command to execute` {}
|
|
12
|
+
|
|
13
|
+
export class timeout extends Tool.input(
|
|
14
|
+
"timeout",
|
|
15
|
+
S.optional(S.Number),
|
|
16
|
+
)`Optional timeout in milliseconds` {}
|
|
17
|
+
|
|
18
|
+
export class workdir extends Tool.input(
|
|
19
|
+
"workdir",
|
|
20
|
+
S.optional(S.String),
|
|
21
|
+
)`The working directory to run the command in. Defaults to ${cwd}. Use this instead of 'cd' commands.` {}
|
|
22
|
+
|
|
23
|
+
export class description extends Tool.input(
|
|
24
|
+
"description",
|
|
25
|
+
)`Clear, concise description of what this command does in 5-10 words. Examples:
|
|
26
|
+
Input: ls
|
|
27
|
+
Output: Lists files in current directory
|
|
28
|
+
|
|
29
|
+
Input: git status
|
|
30
|
+
Output: Shows working tree status
|
|
31
|
+
|
|
32
|
+
Input: npm install
|
|
33
|
+
Output: Installs package dependencies
|
|
34
|
+
|
|
35
|
+
Input: mkdir foo
|
|
36
|
+
Output: Creates directory 'foo'` {}
|
|
37
|
+
|
|
38
|
+
export class exitCode extends Tool.output(
|
|
39
|
+
"exitCode",
|
|
40
|
+
S.Number,
|
|
41
|
+
)`The exit code of the command.` {}
|
|
42
|
+
|
|
43
|
+
export class stdout extends Tool.output(
|
|
44
|
+
"stdout",
|
|
45
|
+
S.String,
|
|
46
|
+
)`Containing both stdout and stderr.` {}
|
|
47
|
+
|
|
48
|
+
export class bash extends Tool("bash", {
|
|
49
|
+
alias: (model) => (model.includes("anthropic") ? "AnthropicBash" : undefined),
|
|
50
|
+
})`Executes a given bash ${command} in a persistent shell session with optional ${timeout}, ensuring proper handling and security measures.
|
|
51
|
+
Returns the ${exitCode} and ${stdout} containing both stdout and stderr.
|
|
52
|
+
If the command is invalid, an error message will be returned as a ${S.String}.
|
|
53
|
+
|
|
54
|
+
All commands run in ${cwd} by default. Use the ${workdir} parameter if you need to run a command in a different directory. AVOID using \`cd <directory> && <command>\` patterns - use \`workdir\` instead.
|
|
55
|
+
|
|
56
|
+
IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.
|
|
57
|
+
|
|
58
|
+
Before executing the command, please follow these steps:
|
|
59
|
+
|
|
60
|
+
1. Directory Verification:
|
|
61
|
+
- If the command will create new directories or files, first use \`ls\` to verify the parent directory exists and is the correct location
|
|
62
|
+
- For example, before running "mkdir foo/bar", first use \`ls foo\` to check that "foo" exists and is the intended parent directory
|
|
63
|
+
|
|
64
|
+
2. Command Execution:
|
|
65
|
+
- Always quote file paths that contain spaces with double quotes (e.g., rm "path with spaces/file.txt")
|
|
66
|
+
- Examples of proper quoting:
|
|
67
|
+
- mkdir "/Users/name/My Documents" (correct)
|
|
68
|
+
- mkdir /Users/name/My Documents (incorrect - will fail)
|
|
69
|
+
- python "/path/with spaces/script.py" (correct)
|
|
70
|
+
- python /path/with spaces/script.py (incorrect - will fail)
|
|
71
|
+
- After ensuring proper quoting, execute the command.
|
|
72
|
+
- Capture the output of the command.
|
|
73
|
+
|
|
74
|
+
Usage notes:
|
|
75
|
+
- The command argument is required.
|
|
76
|
+
- You can specify an optional timeout in milliseconds (up to 600000ms / 10 minutes). If not specified, commands will time out after 120000ms (2 minutes).
|
|
77
|
+
- It is very helpful if you write a clear, concise ${description} of what this command does in 5-10 words.
|
|
78
|
+
- If the output exceeds 30000 characters, output will be truncated before being returned to you.
|
|
79
|
+
- You can use the \`run_in_background\` parameter to run the command in the background, which allows you to continue working while the command runs. You can monitor the output using the Bash tool as it becomes available. You do not need to use '&' at the end of the command when using this parameter.
|
|
80
|
+
|
|
81
|
+
- Avoid using Bash with the \`find\`, \`grep\`, \`cat\`, \`head\`, \`tail\`, \`sed\`, \`awk\`, or \`echo\` commands, unless explicitly instructed or when these commands are truly necessary for the task. Instead, always prefer using the dedicated tools for these commands:
|
|
82
|
+
- File search: Use Glob (NOT find or ls)
|
|
83
|
+
- Content search: Use Grep (NOT grep or rg)
|
|
84
|
+
- Read files: Use Read (NOT cat/head/tail)
|
|
85
|
+
- Edit files: Use Edit (NOT sed/awk)
|
|
86
|
+
- Write files: Use Write (NOT echo >/cat <<EOF)
|
|
87
|
+
- Communication: Output text directly (NOT echo/printf)
|
|
88
|
+
- When issuing multiple commands:
|
|
89
|
+
- If the commands are independent and can run in parallel, make multiple Bash tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two Bash tool calls in parallel.
|
|
90
|
+
- If the commands depend on each other and must run sequentially, use a single Bash call with '&&' to chain them together (e.g., \`git add . && git commit -m "message" && git push\`). For instance, if one operation must complete before another starts (like mkdir before cp, Write before Bash for git operations, or git add before git commit), run these operations sequentially instead.
|
|
91
|
+
- Use ';' only when you need to run commands sequentially but don't care if earlier commands fail
|
|
92
|
+
- DO NOT use newlines to separate commands (newlines are ok in quoted strings)
|
|
93
|
+
- AVOID using \`cd <directory> && <command>\`. Use the \`workdir\` parameter to change directories instead.
|
|
94
|
+
<good-example>
|
|
95
|
+
Use workdir="/foo/bar" with command: pytest tests
|
|
96
|
+
</good-example>
|
|
97
|
+
<bad-example>
|
|
98
|
+
cd /foo/bar && pytest tests
|
|
99
|
+
</bad-example>
|
|
100
|
+
|
|
101
|
+
# Committing changes with git
|
|
102
|
+
|
|
103
|
+
Only create commits when requested by the user. If unclear, ask first. When the user asks you to create a new git commit, follow these steps carefully:
|
|
104
|
+
|
|
105
|
+
Git Safety Protocol:
|
|
106
|
+
- NEVER update the git config
|
|
107
|
+
- NEVER run destructive/irreversible git commands (like push --force, hard reset, etc) unless the user explicitly requests them
|
|
108
|
+
- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it
|
|
109
|
+
- NEVER run force push to main/master, warn the user if they request it
|
|
110
|
+
- Avoid git commit --amend. ONLY use --amend when ALL conditions are met:
|
|
111
|
+
(1) User explicitly requested amend, OR commit SUCCEEDED but pre-commit hook auto-modified files that need including
|
|
112
|
+
(2) HEAD commit was created by you in this conversation (verify: git log -1 --format='%an %ae')
|
|
113
|
+
(3) Commit has NOT been pushed to remote (verify: git status shows "Your branch is ahead")
|
|
114
|
+
- CRITICAL: If commit FAILED or was REJECTED by hook, NEVER amend - fix the issue and create a NEW commit
|
|
115
|
+
- CRITICAL: If you already pushed to remote, NEVER amend unless user explicitly requests it (requires force push)
|
|
116
|
+
- NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive.
|
|
117
|
+
|
|
118
|
+
1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel, each using the Bash tool:
|
|
119
|
+
- Run a git status command to see all untracked files.
|
|
120
|
+
- Run a git diff command to see both staged and unstaged changes that will be committed.
|
|
121
|
+
- Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.
|
|
122
|
+
2. Analyze all staged changes (both previously staged and newly added) and draft a commit message:
|
|
123
|
+
- Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.). Ensure the message accurately reflects the changes and their purpose (i.e. "add" means a wholly new feature, "update" means an enhancement to an existing feature, "fix" means a bug fix, etc.).
|
|
124
|
+
- Do not commit files that likely contain secrets (.env, credentials.json, etc.). Warn the user if they specifically request to commit those files
|
|
125
|
+
- Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what"
|
|
126
|
+
- Ensure it accurately reflects the changes and their purpose
|
|
127
|
+
3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands:
|
|
128
|
+
- Add relevant untracked files to the staging area.
|
|
129
|
+
- Create the commit with a message
|
|
130
|
+
- Run git status after the commit completes to verify success.
|
|
131
|
+
Note: git status depends on the commit completing, so run it sequentially after the commit.
|
|
132
|
+
4. If the commit fails due to pre-commit hook, fix the issue and create a NEW commit (see amend rules above)
|
|
133
|
+
|
|
134
|
+
Important notes:
|
|
135
|
+
- NEVER run additional commands to read or explore code, besides git bash commands
|
|
136
|
+
- NEVER use the TodoWrite or Task tools
|
|
137
|
+
- DO NOT push to the remote repository unless the user explicitly asks you to do so
|
|
138
|
+
- IMPORTANT: Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported.
|
|
139
|
+
- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit
|
|
140
|
+
|
|
141
|
+
# Creating pull requests
|
|
142
|
+
Use the gh command via the Bash tool for ALL GitHub-related tasks including working with issues, pull requests, checks, and releases. If given a Github URL use the gh command to get the information needed.
|
|
143
|
+
|
|
144
|
+
IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:
|
|
145
|
+
|
|
146
|
+
1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel using the Bash tool, in order to understand the current state of the branch since it diverged from the main branch:
|
|
147
|
+
- Run a git status command to see all untracked files
|
|
148
|
+
- Run a git diff command to see both staged and unstaged changes that will be committed
|
|
149
|
+
- Check if the current branch tracks a remote branch and is up to date with the remote, so you know if you need to push to the remote
|
|
150
|
+
- Run a git log command and \`git diff [base-branch]...HEAD\` to understand the full commit history for the current branch (from the time it diverged from the base branch)
|
|
151
|
+
2. Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request!!!), and draft a pull request summary
|
|
152
|
+
3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands in parallel:
|
|
153
|
+
- Create new branch if needed
|
|
154
|
+
- Push to remote with -u flag if needed
|
|
155
|
+
- Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.
|
|
156
|
+
<example>
|
|
157
|
+
gh pr create --title "the pr title" --body "$(cat <<'EOF'
|
|
158
|
+
## Summary
|
|
159
|
+
<1-3 bullet points>
|
|
160
|
+
</example>
|
|
161
|
+
|
|
162
|
+
Important:
|
|
163
|
+
- DO NOT use the TodoWrite or Task tools
|
|
164
|
+
- Return the PR URL when you're done, so the user can see it
|
|
165
|
+
|
|
166
|
+
# Other common operations
|
|
167
|
+
- View comments on a Github PR: gh api repos/foo/bar/pulls/123/comments
|
|
168
|
+
`(function* ({ command, workdir }) {
|
|
169
|
+
const config = yield* Effect.serviceOption(AspectConfig).pipe(
|
|
170
|
+
Effect.map(Option.getOrElse(() => ({ cwd: process.cwd() }))),
|
|
171
|
+
);
|
|
172
|
+
const validator = yield* Effect.serviceOption(CommandValidator).pipe(
|
|
173
|
+
Effect.map(Option.getOrUndefined),
|
|
174
|
+
);
|
|
175
|
+
yield* Effect.logDebug(`[bash] command=${command}`);
|
|
176
|
+
|
|
177
|
+
if (validator) {
|
|
178
|
+
const validationError = yield* validator.validate(command).pipe(
|
|
179
|
+
Effect.map(() => null),
|
|
180
|
+
Effect.catch((e) => Effect.succeed(`${e}`)),
|
|
181
|
+
);
|
|
182
|
+
if (validationError) {
|
|
183
|
+
return `Security violation: ${validationError}`;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const cmd = ChildProcess.setCwd(
|
|
188
|
+
ChildProcess.make(command, [], { shell: true }),
|
|
189
|
+
workdir ?? config.cwd,
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
const result = yield* exec(cmd);
|
|
193
|
+
|
|
194
|
+
return {
|
|
195
|
+
exitCode: result.exitCode,
|
|
196
|
+
stdout: result.stdout + result.stderr,
|
|
197
|
+
};
|
|
198
|
+
}) {}
|