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
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
}) {}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import * as Context from "effect/Context";
|
|
2
|
-
import * as Effect from "effect/Effect";
|
|
3
|
-
import * as S from "effect/Schema";
|
|
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 Context.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") {}
|
package/src/Agent/chat/thread.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
}) {}
|
package/src/Agent/coding/bash.ts
DELETED
|
@@ -1,197 +0,0 @@
|
|
|
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 { AspectConfig } from "../Aspect.ts";
|
|
6
|
-
import { Tool } from "../tool/tool.ts";
|
|
7
|
-
import { CommandValidator } from "../util/command-validator.ts";
|
|
8
|
-
import { exec } from "../util/exec.ts";
|
|
9
|
-
|
|
10
|
-
export class command extends Tool.input("command")`The command to execute` {}
|
|
11
|
-
|
|
12
|
-
export class timeout extends Tool.input(
|
|
13
|
-
"timeout",
|
|
14
|
-
S.optional(S.Number),
|
|
15
|
-
)`Optional timeout in milliseconds` {}
|
|
16
|
-
|
|
17
|
-
export class workdir extends Tool.input(
|
|
18
|
-
"workdir",
|
|
19
|
-
S.optional(S.String),
|
|
20
|
-
)`The working directory to run the command in. Defaults to cwd. Use this instead of 'cd' commands.` {}
|
|
21
|
-
|
|
22
|
-
export class description extends Tool.input(
|
|
23
|
-
"description",
|
|
24
|
-
)`Clear, concise description of what this command does in 5-10 words. Examples:
|
|
25
|
-
Input: ls
|
|
26
|
-
Output: Lists files in current directory
|
|
27
|
-
|
|
28
|
-
Input: git status
|
|
29
|
-
Output: Shows working tree status
|
|
30
|
-
|
|
31
|
-
Input: npm install
|
|
32
|
-
Output: Installs package dependencies
|
|
33
|
-
|
|
34
|
-
Input: mkdir foo
|
|
35
|
-
Output: Creates directory 'foo'` {}
|
|
36
|
-
|
|
37
|
-
export class exitCode extends Tool.output(
|
|
38
|
-
"exitCode",
|
|
39
|
-
S.Number,
|
|
40
|
-
)`The exit code of the command.` {}
|
|
41
|
-
|
|
42
|
-
export class stdout extends Tool.output(
|
|
43
|
-
"stdout",
|
|
44
|
-
S.String,
|
|
45
|
-
)`Containing both stdout and stderr.` {}
|
|
46
|
-
|
|
47
|
-
export class bash extends Tool("bash", {
|
|
48
|
-
alias: (model) => (model.includes("anthropic") ? "AnthropicBash" : undefined),
|
|
49
|
-
})`Executes a given bash ${command} in a persistent shell session with optional ${timeout}, ensuring proper handling and security measures.
|
|
50
|
-
Returns the ${exitCode} and ${stdout} containing both stdout and stderr.
|
|
51
|
-
If the command is invalid, an error message will be returned as a ${S.String}.
|
|
52
|
-
|
|
53
|
-
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.
|
|
54
|
-
|
|
55
|
-
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.
|
|
56
|
-
|
|
57
|
-
Before executing the command, please follow these steps:
|
|
58
|
-
|
|
59
|
-
1. Directory Verification:
|
|
60
|
-
- If the command will create new directories or files, first use \`ls\` to verify the parent directory exists and is the correct location
|
|
61
|
-
- For example, before running "mkdir foo/bar", first use \`ls foo\` to check that "foo" exists and is the intended parent directory
|
|
62
|
-
|
|
63
|
-
2. Command Execution:
|
|
64
|
-
- Always quote file paths that contain spaces with double quotes (e.g., rm "path with spaces/file.txt")
|
|
65
|
-
- Examples of proper quoting:
|
|
66
|
-
- mkdir "/Users/name/My Documents" (correct)
|
|
67
|
-
- mkdir /Users/name/My Documents (incorrect - will fail)
|
|
68
|
-
- python "/path/with spaces/script.py" (correct)
|
|
69
|
-
- python /path/with spaces/script.py (incorrect - will fail)
|
|
70
|
-
- After ensuring proper quoting, execute the command.
|
|
71
|
-
- Capture the output of the command.
|
|
72
|
-
|
|
73
|
-
Usage notes:
|
|
74
|
-
- The command argument is required.
|
|
75
|
-
- You can specify an optional timeout in milliseconds (up to 600000ms / 10 minutes). If not specified, commands will time out after 120000ms (2 minutes).
|
|
76
|
-
- It is very helpful if you write a clear, concise ${description} of what this command does in 5-10 words.
|
|
77
|
-
- If the output exceeds 30000 characters, output will be truncated before being returned to you.
|
|
78
|
-
- 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.
|
|
79
|
-
|
|
80
|
-
- 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:
|
|
81
|
-
- File search: Use Glob (NOT find or ls)
|
|
82
|
-
- Content search: Use Grep (NOT grep or rg)
|
|
83
|
-
- Read files: Use Read (NOT cat/head/tail)
|
|
84
|
-
- Edit files: Use Edit (NOT sed/awk)
|
|
85
|
-
- Write files: Use Write (NOT echo >/cat <<EOF)
|
|
86
|
-
- Communication: Output text directly (NOT echo/printf)
|
|
87
|
-
- When issuing multiple commands:
|
|
88
|
-
- 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.
|
|
89
|
-
- 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.
|
|
90
|
-
- Use ';' only when you need to run commands sequentially but don't care if earlier commands fail
|
|
91
|
-
- DO NOT use newlines to separate commands (newlines are ok in quoted strings)
|
|
92
|
-
- AVOID using \`cd <directory> && <command>\`. Use the \`workdir\` parameter to change directories instead.
|
|
93
|
-
<good-example>
|
|
94
|
-
Use workdir="/foo/bar" with command: pytest tests
|
|
95
|
-
</good-example>
|
|
96
|
-
<bad-example>
|
|
97
|
-
cd /foo/bar && pytest tests
|
|
98
|
-
</bad-example>
|
|
99
|
-
|
|
100
|
-
# Committing changes with git
|
|
101
|
-
|
|
102
|
-
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:
|
|
103
|
-
|
|
104
|
-
Git Safety Protocol:
|
|
105
|
-
- NEVER update the git config
|
|
106
|
-
- NEVER run destructive/irreversible git commands (like push --force, hard reset, etc) unless the user explicitly requests them
|
|
107
|
-
- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it
|
|
108
|
-
- NEVER run force push to main/master, warn the user if they request it
|
|
109
|
-
- Avoid git commit --amend. ONLY use --amend when ALL conditions are met:
|
|
110
|
-
(1) User explicitly requested amend, OR commit SUCCEEDED but pre-commit hook auto-modified files that need including
|
|
111
|
-
(2) HEAD commit was created by you in this conversation (verify: git log -1 --format='%an %ae')
|
|
112
|
-
(3) Commit has NOT been pushed to remote (verify: git status shows "Your branch is ahead")
|
|
113
|
-
- CRITICAL: If commit FAILED or was REJECTED by hook, NEVER amend - fix the issue and create a NEW commit
|
|
114
|
-
- CRITICAL: If you already pushed to remote, NEVER amend unless user explicitly requests it (requires force push)
|
|
115
|
-
- 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.
|
|
116
|
-
|
|
117
|
-
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:
|
|
118
|
-
- Run a git status command to see all untracked files.
|
|
119
|
-
- Run a git diff command to see both staged and unstaged changes that will be committed.
|
|
120
|
-
- Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.
|
|
121
|
-
2. Analyze all staged changes (both previously staged and newly added) and draft a commit message:
|
|
122
|
-
- 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.).
|
|
123
|
-
- Do not commit files that likely contain secrets (.env, credentials.json, etc.). Warn the user if they specifically request to commit those files
|
|
124
|
-
- Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what"
|
|
125
|
-
- Ensure it accurately reflects the changes and their purpose
|
|
126
|
-
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:
|
|
127
|
-
- Add relevant untracked files to the staging area.
|
|
128
|
-
- Create the commit with a message
|
|
129
|
-
- Run git status after the commit completes to verify success.
|
|
130
|
-
Note: git status depends on the commit completing, so run it sequentially after the commit.
|
|
131
|
-
4. If the commit fails due to pre-commit hook, fix the issue and create a NEW commit (see amend rules above)
|
|
132
|
-
|
|
133
|
-
Important notes:
|
|
134
|
-
- NEVER run additional commands to read or explore code, besides git bash commands
|
|
135
|
-
- NEVER use the TodoWrite or Task tools
|
|
136
|
-
- DO NOT push to the remote repository unless the user explicitly asks you to do so
|
|
137
|
-
- 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.
|
|
138
|
-
- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit
|
|
139
|
-
|
|
140
|
-
# Creating pull requests
|
|
141
|
-
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.
|
|
142
|
-
|
|
143
|
-
IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:
|
|
144
|
-
|
|
145
|
-
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:
|
|
146
|
-
- Run a git status command to see all untracked files
|
|
147
|
-
- Run a git diff command to see both staged and unstaged changes that will be committed
|
|
148
|
-
- 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
|
|
149
|
-
- 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)
|
|
150
|
-
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
|
|
151
|
-
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:
|
|
152
|
-
- Create new branch if needed
|
|
153
|
-
- Push to remote with -u flag if needed
|
|
154
|
-
- Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.
|
|
155
|
-
<example>
|
|
156
|
-
gh pr create --title "the pr title" --body "$(cat <<'EOF'
|
|
157
|
-
## Summary
|
|
158
|
-
<1-3 bullet points>
|
|
159
|
-
</example>
|
|
160
|
-
|
|
161
|
-
Important:
|
|
162
|
-
- DO NOT use the TodoWrite or Task tools
|
|
163
|
-
- Return the PR URL when you're done, so the user can see it
|
|
164
|
-
|
|
165
|
-
# Other common operations
|
|
166
|
-
- View comments on a Github PR: gh api repos/foo/bar/pulls/123/comments
|
|
167
|
-
`(function* ({ command, workdir }) {
|
|
168
|
-
const config = yield* Effect.serviceOption(AspectConfig).pipe(
|
|
169
|
-
Effect.map(Option.getOrElse(() => ({ cwd: process.cwd() }))),
|
|
170
|
-
);
|
|
171
|
-
const validator = yield* Effect.serviceOption(CommandValidator).pipe(
|
|
172
|
-
Effect.map(Option.getOrUndefined),
|
|
173
|
-
);
|
|
174
|
-
yield* Effect.logDebug(`[bash] command=${command}`);
|
|
175
|
-
|
|
176
|
-
if (validator) {
|
|
177
|
-
const validationError = yield* validator.validate(command).pipe(
|
|
178
|
-
Effect.map(() => null),
|
|
179
|
-
Effect.catch((e) => Effect.succeed(`${e}`)),
|
|
180
|
-
);
|
|
181
|
-
if (validationError) {
|
|
182
|
-
return `Security violation: ${validationError}`;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
const cmd = ChildProcess.setCwd(
|
|
187
|
-
ChildProcess.make(command, [], { shell: true }),
|
|
188
|
-
workdir ?? config.cwd,
|
|
189
|
-
);
|
|
190
|
-
|
|
191
|
-
const result = yield* exec(cmd);
|
|
192
|
-
|
|
193
|
-
return {
|
|
194
|
-
exitCode: result.exitCode,
|
|
195
|
-
stdout: result.stdout + result.stderr,
|
|
196
|
-
};
|
|
197
|
-
}) {}
|
package/src/Agent/coding/edit.ts
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as FileSystem from "effect/FileSystem";
|
|
3
|
-
import * as Option from "effect/Option";
|
|
4
|
-
import * as Path from "effect/Path";
|
|
5
|
-
import * as S from "effect/Schema";
|
|
6
|
-
import { AspectConfig } from "../Aspect.ts";
|
|
7
|
-
import {
|
|
8
|
-
formatDiagnostics,
|
|
9
|
-
getDiagnosticsIfAvailable,
|
|
10
|
-
} from "../lsp/diagnostics.ts";
|
|
11
|
-
import { Tool } from "../tool/tool.ts";
|
|
12
|
-
import { replace } from "../util/replace.ts";
|
|
13
|
-
|
|
14
|
-
export class filePath extends Tool.input(
|
|
15
|
-
"filePath",
|
|
16
|
-
)`The absolute path to the file to modify` {}
|
|
17
|
-
|
|
18
|
-
export class oldString extends Tool.input(
|
|
19
|
-
"oldString",
|
|
20
|
-
)`The text to replace. Use an empty string "" to create a new file.` {}
|
|
21
|
-
|
|
22
|
-
export class newString extends Tool.input(
|
|
23
|
-
"newString",
|
|
24
|
-
)`The text to replace it with (must be different from oldString)` {}
|
|
25
|
-
|
|
26
|
-
export class replaceAll extends Tool.input(
|
|
27
|
-
"replaceAll",
|
|
28
|
-
S.Boolean,
|
|
29
|
-
)`Replace all occurrences of oldString (default false). Use this when renaming variables or updating repeated patterns.` {}
|
|
30
|
-
|
|
31
|
-
export class output extends Tool.output(
|
|
32
|
-
"result",
|
|
33
|
-
)`The result of the edit operation, including any diagnostics from LSP.` {}
|
|
34
|
-
|
|
35
|
-
export class edit extends Tool(
|
|
36
|
-
"edit",
|
|
37
|
-
)`Performs exact string replacements in files.
|
|
38
|
-
Returns the ${output} of the operation.
|
|
39
|
-
|
|
40
|
-
Given a ${filePath}, ${oldString}, and ${newString}:
|
|
41
|
-
- Replaces the first occurrence of ${oldString} with ${newString}
|
|
42
|
-
- Use ${replaceAll} to replace all occurrences (defaults to false)
|
|
43
|
-
- Use empty ${oldString} ("") to create a new file with ${newString} as content
|
|
44
|
-
`(function* ({
|
|
45
|
-
filePath: _filePath,
|
|
46
|
-
oldString,
|
|
47
|
-
newString,
|
|
48
|
-
replaceAll: doReplaceAll,
|
|
49
|
-
}) {
|
|
50
|
-
const config = yield* Effect.serviceOption(AspectConfig).pipe(
|
|
51
|
-
Effect.map(Option.getOrElse(() => ({ cwd: process.cwd() }))),
|
|
52
|
-
);
|
|
53
|
-
const pathService = yield* Path.Path;
|
|
54
|
-
const fs = yield* FileSystem.FileSystem;
|
|
55
|
-
|
|
56
|
-
const filePath = pathService.isAbsolute(_filePath)
|
|
57
|
-
? _filePath
|
|
58
|
-
: pathService.join(config.cwd, _filePath);
|
|
59
|
-
|
|
60
|
-
// Determine new content and whether this is a create operation
|
|
61
|
-
let newContent: string;
|
|
62
|
-
|
|
63
|
-
if (oldString === "") {
|
|
64
|
-
// Create new file
|
|
65
|
-
newContent = newString;
|
|
66
|
-
} else {
|
|
67
|
-
// Edit existing file - validate it exists
|
|
68
|
-
const stat = yield* fs
|
|
69
|
-
.stat(filePath)
|
|
70
|
-
.pipe(Effect.catch(() => Effect.succeed(null)));
|
|
71
|
-
|
|
72
|
-
if (!stat) {
|
|
73
|
-
return { result: `File not found: ${filePath}` };
|
|
74
|
-
}
|
|
75
|
-
if (stat.type === "Directory") {
|
|
76
|
-
return { result: `Path is a directory, not a file: ${filePath}` };
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Read existing content
|
|
80
|
-
const oldContent = yield* fs
|
|
81
|
-
.readFileString(filePath)
|
|
82
|
-
.pipe(Effect.catch((e) => Effect.succeed(`Failed to read file: ${e}`)));
|
|
83
|
-
if (oldContent.startsWith("Failed to read")) {
|
|
84
|
-
return { result: oldContent };
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Perform replacement
|
|
88
|
-
const replaceResult = yield* replace(
|
|
89
|
-
oldContent,
|
|
90
|
-
oldString,
|
|
91
|
-
newString,
|
|
92
|
-
doReplaceAll ?? false,
|
|
93
|
-
).pipe(
|
|
94
|
-
Effect.catchTag("ReplaceSameStringError", () =>
|
|
95
|
-
Effect.succeed("oldString and newString must be different"),
|
|
96
|
-
),
|
|
97
|
-
Effect.catchTag("ReplaceNotFoundError", (e) =>
|
|
98
|
-
Effect.succeed(
|
|
99
|
-
`Could not find oldString in file. The text "${e.oldString.slice(0, 100)}${e.oldString.length > 100 ? "..." : ""}" was not found in ${filePath}.`,
|
|
100
|
-
),
|
|
101
|
-
),
|
|
102
|
-
Effect.catchTag("ReplaceMultipleMatchesError", (e) =>
|
|
103
|
-
Effect.succeed(
|
|
104
|
-
`Found multiple matches for oldString "${e.oldString.slice(0, 50)}${e.oldString.length > 50 ? "..." : ""}". Provide more surrounding context to identify the correct match, or use replaceAll=true to replace all occurrences.`,
|
|
105
|
-
),
|
|
106
|
-
),
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
// Check for replace errors
|
|
110
|
-
if (
|
|
111
|
-
replaceResult.startsWith("Could not find") ||
|
|
112
|
-
replaceResult.startsWith("Found multiple") ||
|
|
113
|
-
replaceResult.startsWith("oldString and newString")
|
|
114
|
-
) {
|
|
115
|
-
yield* Effect.logDebug(`[edit] ${replaceResult}`);
|
|
116
|
-
return { result: replaceResult };
|
|
117
|
-
}
|
|
118
|
-
newContent = replaceResult;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const isCreate = oldString === "";
|
|
122
|
-
|
|
123
|
-
// Write file
|
|
124
|
-
const writeResult = yield* fs
|
|
125
|
-
.writeFileString(filePath, newContent)
|
|
126
|
-
.pipe(
|
|
127
|
-
Effect.catch((e) =>
|
|
128
|
-
Effect.succeed(
|
|
129
|
-
`Failed to ${isCreate ? "create" : "write"} file: ${e.message}`,
|
|
130
|
-
),
|
|
131
|
-
),
|
|
132
|
-
);
|
|
133
|
-
if (typeof writeResult === "string") {
|
|
134
|
-
yield* Effect.logDebug(`[edit] ${writeResult}`);
|
|
135
|
-
return { result: writeResult };
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// Get diagnostics from LSP servers
|
|
139
|
-
const diagnostics = yield* getDiagnosticsIfAvailable(filePath, newContent);
|
|
140
|
-
const formatted = formatDiagnostics(diagnostics);
|
|
141
|
-
|
|
142
|
-
yield* Effect.logDebug(
|
|
143
|
-
`[edit] diagnostics for ${filePath}: ${formatted || "(none)"}`,
|
|
144
|
-
);
|
|
145
|
-
|
|
146
|
-
const action = isCreate ? "Created" : "Edited";
|
|
147
|
-
return {
|
|
148
|
-
result: formatted
|
|
149
|
-
? `${action} file: ${filePath}\n\n${formatted}`
|
|
150
|
-
: `${action} file: ${filePath}`,
|
|
151
|
-
};
|
|
152
|
-
}) {}
|
package/src/Agent/coding/glob.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as FileSystem from "effect/FileSystem";
|
|
3
|
-
import * as Option from "effect/Option";
|
|
4
|
-
import * as Path from "effect/Path";
|
|
5
|
-
import * as S from "effect/Schema";
|
|
6
|
-
import { AspectConfig } from "../Aspect.ts";
|
|
7
|
-
import { Tool } from "../tool/tool.ts";
|
|
8
|
-
import * as Ripgrep from "../util/ripgrep.ts";
|
|
9
|
-
|
|
10
|
-
export class pattern extends Tool.input(
|
|
11
|
-
"pattern",
|
|
12
|
-
)`The glob pattern to match files against.
|
|
13
|
-
Patterns not starting with "**/" are automatically prepended with "**/" to enable recursive searching.
|
|
14
|
-
|
|
15
|
-
Examples:
|
|
16
|
-
- "*.js" (becomes "**/*.js") - find all .js files
|
|
17
|
-
- "**/node_modules/**" - find all node_modules directories
|
|
18
|
-
- "**/test/**/test_*.ts" - find all test_*.ts files in any test directory` {}
|
|
19
|
-
|
|
20
|
-
export class path extends Tool.input(
|
|
21
|
-
"path",
|
|
22
|
-
S.optional(S.String),
|
|
23
|
-
)`The directory to search in. Defaults to cwd if not specified.` {}
|
|
24
|
-
|
|
25
|
-
export class files extends Tool.output(
|
|
26
|
-
"files",
|
|
27
|
-
)`The list of matching file paths, sorted by modification time (most recent first). Returns a message if no files are found.` {}
|
|
28
|
-
|
|
29
|
-
export class glob extends Tool(
|
|
30
|
-
"glob",
|
|
31
|
-
)`Fast file pattern matching tool that works with any codebase size.
|
|
32
|
-
Returns matching ${files} sorted by modification time.
|
|
33
|
-
|
|
34
|
-
Given a ${pattern} and optional ${path}:
|
|
35
|
-
- Supports glob patterns like "**/*.js" or "src/**/*.ts"
|
|
36
|
-
- Returns matching file paths sorted by modification time
|
|
37
|
-
- Use this tool when you need to find files by name patterns
|
|
38
|
-
- When you are doing an open-ended search that may require multiple rounds of globbing and grepping, use the Task tool instead
|
|
39
|
-
- You have the capability to call multiple tools in a single response. It is always better to speculatively perform multiple searches as a batch that are potentially useful.
|
|
40
|
-
`(function* ({ pattern, path: searchDir }) {
|
|
41
|
-
yield* Effect.logDebug(`[glob] pattern=${pattern} path=${searchDir}`);
|
|
42
|
-
|
|
43
|
-
const config = yield* Effect.serviceOption(AspectConfig).pipe(
|
|
44
|
-
Effect.map(Option.getOrElse(() => ({ cwd: process.cwd() }))),
|
|
45
|
-
);
|
|
46
|
-
const pathService = yield* Path.Path;
|
|
47
|
-
const fs = yield* FileSystem.FileSystem;
|
|
48
|
-
|
|
49
|
-
let searchPath = searchDir || config.cwd;
|
|
50
|
-
searchPath = pathService.isAbsolute(searchPath)
|
|
51
|
-
? searchPath
|
|
52
|
-
: pathService.resolve(config.cwd, searchPath);
|
|
53
|
-
|
|
54
|
-
const fileList: { path: string; mtime: number }[] = [];
|
|
55
|
-
const limit = 100;
|
|
56
|
-
let truncated = false;
|
|
57
|
-
|
|
58
|
-
const foundFiles = yield* Ripgrep.findFiles({
|
|
59
|
-
cwd: searchPath,
|
|
60
|
-
glob: [pattern],
|
|
61
|
-
}).pipe(Effect.catch(() => Effect.succeed([] as string[])));
|
|
62
|
-
|
|
63
|
-
for (const filePath of foundFiles) {
|
|
64
|
-
if (fileList.length >= limit) {
|
|
65
|
-
truncated = true;
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
const stats = yield* fs
|
|
69
|
-
.stat(filePath)
|
|
70
|
-
.pipe(Effect.catch(() => Effect.succeed(null)));
|
|
71
|
-
if (!stats) continue;
|
|
72
|
-
fileList.push({
|
|
73
|
-
path: filePath,
|
|
74
|
-
mtime: stats.mtime.pipe(Option.getOrElse(() => new Date(0))).getTime(),
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
fileList.sort((a, b) => b.mtime - a.mtime);
|
|
79
|
-
const output = fileList.map((f) => f.path);
|
|
80
|
-
|
|
81
|
-
if (output.length === 0) {
|
|
82
|
-
return {
|
|
83
|
-
files: `No files found matching pattern "${pattern}" in ${searchPath}`,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (truncated) {
|
|
88
|
-
return {
|
|
89
|
-
files: `${output.join("\n")}\n\n(${output.length} files found. Results are truncated, consider using a more specific pattern.)`,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return {
|
|
94
|
-
files: output.join("\n"),
|
|
95
|
-
};
|
|
96
|
-
}) {}
|