alchemy 2.0.0-beta.37 → 2.0.0-beta.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/exec.js +488 -69
- package/bin/exec.js.map +1 -1
- package/lib/AWS/AutoScaling/LaunchTemplate.d.ts +1 -1
- package/lib/AWS/CloudWatch/common.d.ts +1 -1
- package/lib/AWS/Credentials.d.ts.map +1 -1
- package/lib/AWS/Credentials.js +1 -2
- package/lib/AWS/Credentials.js.map +1 -1
- package/lib/AWS/DynamoDB/Stream.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/Stream.js +1 -1
- package/lib/AWS/DynamoDB/Stream.js.map +1 -1
- package/lib/AWS/EC2/Instance.d.ts +1 -1
- package/lib/AWS/EC2/hosted.d.ts +1 -1
- package/lib/AWS/EC2/hosted.d.ts.map +1 -1
- package/lib/AWS/EC2/hosted.js +3 -5
- package/lib/AWS/EC2/hosted.js.map +1 -1
- package/lib/AWS/ECS/Task.d.ts +1 -1
- package/lib/AWS/ECS/Task.d.ts.map +1 -1
- package/lib/AWS/ECS/Task.js +3 -5
- package/lib/AWS/ECS/Task.js.map +1 -1
- package/lib/AWS/Endpoint.d.ts.map +1 -1
- package/lib/AWS/Endpoint.js +1 -2
- package/lib/AWS/Endpoint.js.map +1 -1
- package/lib/AWS/Environment.d.ts +2 -2
- package/lib/AWS/EventBridge/EventSource.d.ts.map +1 -1
- package/lib/AWS/EventBridge/EventSource.js +1 -1
- package/lib/AWS/EventBridge/EventSource.js.map +1 -1
- package/lib/AWS/Kinesis/StreamEventSource.d.ts.map +1 -1
- package/lib/AWS/Kinesis/StreamEventSource.js +1 -1
- package/lib/AWS/Kinesis/StreamEventSource.js.map +1 -1
- package/lib/AWS/Lambda/BucketEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/EventBridgeEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/Function.d.ts +1 -1
- package/lib/AWS/Lambda/Function.d.ts.map +1 -1
- package/lib/AWS/Lambda/Function.js +7 -11
- package/lib/AWS/Lambda/Function.js.map +1 -1
- package/lib/AWS/Lambda/QueueEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/StreamEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/TableEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/TopicEventSource.d.ts +1 -1
- package/lib/AWS/Organizations/common.d.ts +1 -1
- package/lib/AWS/Providers.d.ts.map +1 -1
- package/lib/AWS/Providers.js +21 -3
- package/lib/AWS/Providers.js.map +1 -1
- package/lib/AWS/Region.d.ts +1 -1
- package/lib/AWS/Region.d.ts.map +1 -1
- package/lib/AWS/Region.js +2 -3
- package/lib/AWS/Region.js.map +1 -1
- package/lib/AWS/S3/Bucket.d.ts.map +1 -1
- package/lib/AWS/S3/Bucket.js +5 -2
- package/lib/AWS/S3/Bucket.js.map +1 -1
- package/lib/AWS/S3/BucketNotifications.d.ts.map +1 -1
- package/lib/AWS/S3/BucketNotifications.js +1 -1
- package/lib/AWS/S3/BucketNotifications.js.map +1 -1
- package/lib/AWS/SNS/TopicEventSource.d.ts.map +1 -1
- package/lib/AWS/SNS/TopicEventSource.js +1 -1
- package/lib/AWS/SNS/TopicEventSource.js.map +1 -1
- package/lib/AWS/SQS/Queue.d.ts.map +1 -1
- package/lib/AWS/SQS/Queue.js +23 -5
- package/lib/AWS/SQS/Queue.js.map +1 -1
- package/lib/Action.d.ts +77 -0
- package/lib/Action.d.ts.map +1 -0
- package/lib/Action.js +89 -0
- package/lib/Action.js.map +1 -0
- package/lib/AlchemyContext.d.ts +1 -1
- package/lib/Apply.d.ts.map +1 -1
- package/lib/Apply.js +222 -3
- package/lib/Apply.js.map +1 -1
- package/lib/Artifacts.d.ts +1 -1
- package/lib/Artifacts.d.ts.map +1 -1
- package/lib/Artifacts.js +1 -1
- package/lib/Artifacts.js.map +1 -1
- package/lib/Auth/AuthProvider.js +1 -1
- package/lib/Auth/AuthProvider.js.map +1 -1
- package/lib/Auth/Env.d.ts.map +1 -1
- package/lib/Auth/Env.js +4 -12
- package/lib/Auth/Env.js.map +1 -1
- package/lib/Binding.d.ts.map +1 -1
- package/lib/Binding.js +5 -5
- package/lib/Binding.js.map +1 -1
- package/lib/Build/Command.d.ts +1 -1
- package/lib/Build/Memo.d.ts +1 -1
- package/lib/Bundle/Docker.d.ts +3 -3
- package/lib/Bundle/Docker.js +1 -1
- package/lib/Bundle/Docker.js.map +1 -1
- package/lib/Bundle/TempRoot.d.ts +3 -3
- package/lib/Cli/Event.d.ts +1 -1
- package/lib/Cli/Event.d.ts.map +1 -1
- package/lib/Cli/NamespaceTree.d.ts +11 -5
- package/lib/Cli/NamespaceTree.d.ts.map +1 -1
- package/lib/Cli/NamespaceTree.js +28 -1
- package/lib/Cli/NamespaceTree.js.map +1 -1
- package/lib/Cli/commands/_shared.d.ts +1 -1
- package/lib/Cli/commands/_shared.js +2 -2
- package/lib/Cli/commands/_shared.js.map +1 -1
- package/lib/Cli/commands/aws.d.ts +1 -1
- package/lib/Cli/commands/cloudflare.d.ts +2 -2
- package/lib/Cli/commands/cloudflare.d.ts.map +1 -1
- package/lib/Cli/commands/deploy.d.ts +9 -9
- package/lib/Cli/commands/deploy.js +1 -1
- package/lib/Cli/commands/deploy.js.map +1 -1
- package/lib/Cli/commands/login.d.ts +1 -1
- package/lib/Cli/commands/logs.d.ts +1 -1
- package/lib/Cli/commands/logs.js.map +1 -1
- package/lib/Cli/commands/profile.d.ts +1 -3
- package/lib/Cli/commands/profile.d.ts.map +1 -1
- package/lib/Cli/commands/state.d.ts +1 -1
- package/lib/Cli/commands/state.d.ts.map +1 -1
- package/lib/Cli/commands/tail.d.ts +1 -1
- package/lib/Cli/commands/tail.js.map +1 -1
- package/lib/Cli/tui/components/Plan.d.ts.map +1 -1
- package/lib/Cli/tui/components/Plan.js +27 -13
- package/lib/Cli/tui/components/Plan.js.map +1 -1
- package/lib/Cli/tui/components/PlanProgress.d.ts +8 -1
- package/lib/Cli/tui/components/PlanProgress.d.ts.map +1 -1
- package/lib/Cli/tui/components/PlanProgress.js +95 -16
- package/lib/Cli/tui/components/PlanProgress.js.map +1 -1
- package/lib/Cloudflare/Access.js +0 -1
- package/lib/Cloudflare/Access.js.map +1 -1
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js +1 -1
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js.map +1 -1
- package/lib/Cloudflare/Artifacts/ArtifactsBinding.js +1 -1
- package/lib/Cloudflare/Artifacts/ArtifactsBinding.js.map +1 -1
- package/lib/Cloudflare/CloudflareEnvironment.d.ts +1 -1
- package/lib/Cloudflare/Container/Container.js +0 -1
- package/lib/Cloudflare/Container/Container.js.map +1 -1
- package/lib/Cloudflare/Container/ContainerApplication.d.ts +1 -1
- package/lib/Cloudflare/Container/ContainerApplication.d.ts.map +1 -1
- package/lib/Cloudflare/Container/ContainerApplication.js +4 -6
- package/lib/Cloudflare/Container/ContainerApplication.js.map +1 -1
- package/lib/Cloudflare/Container/ContainerBinding.js +2 -2
- package/lib/Cloudflare/Container/ContainerBinding.js.map +1 -1
- package/lib/Cloudflare/D1/D1Database.d.ts +1 -1
- package/lib/Cloudflare/D1/D1SqlFile.d.ts +2 -2
- package/lib/Cloudflare/Email/EmailAddress.d.ts +45 -0
- package/lib/Cloudflare/Email/EmailAddress.d.ts.map +1 -0
- package/lib/Cloudflare/Email/EmailAddress.js +99 -0
- package/lib/Cloudflare/Email/EmailAddress.js.map +1 -0
- package/lib/Cloudflare/Email/EmailRouting.d.ts +42 -0
- package/lib/Cloudflare/Email/EmailRouting.d.ts.map +1 -0
- package/lib/Cloudflare/Email/EmailRouting.js +89 -0
- package/lib/Cloudflare/Email/EmailRouting.js.map +1 -0
- package/lib/Cloudflare/Email/EmailRule.d.ts +80 -0
- package/lib/Cloudflare/Email/EmailRule.d.ts.map +1 -0
- package/lib/Cloudflare/Email/EmailRule.js +110 -0
- package/lib/Cloudflare/Email/EmailRule.js.map +1 -0
- package/lib/Cloudflare/Email/SendEmail.d.ts +74 -0
- package/lib/Cloudflare/Email/SendEmail.d.ts.map +1 -0
- package/lib/Cloudflare/Email/SendEmail.js +19 -0
- package/lib/Cloudflare/Email/SendEmail.js.map +1 -0
- package/lib/Cloudflare/Email/SendEmailBinding.d.ts +64 -0
- package/lib/Cloudflare/Email/SendEmailBinding.d.ts.map +1 -0
- package/lib/Cloudflare/Email/SendEmailBinding.js +54 -0
- package/lib/Cloudflare/Email/SendEmailBinding.js.map +1 -0
- package/lib/Cloudflare/Email/index.d.ts +6 -0
- package/lib/Cloudflare/Email/index.d.ts.map +1 -0
- package/lib/Cloudflare/Email/index.js +6 -0
- package/lib/Cloudflare/Email/index.js.map +1 -0
- package/lib/Cloudflare/Hyperdrive/Hyperdrive.d.ts +1 -1
- package/lib/Cloudflare/Images/ImagesBinding.js +1 -1
- package/lib/Cloudflare/Images/ImagesBinding.js.map +1 -1
- package/lib/Cloudflare/KV/KVNamespaceBinding.js +1 -1
- package/lib/Cloudflare/KV/KVNamespaceBinding.js.map +1 -1
- package/lib/Cloudflare/Local/Sidecar.d.ts +1 -1
- package/lib/Cloudflare/Local/SidecarHandlers.d.ts +1 -1
- package/lib/Cloudflare/Local/SidecarServer.js +1 -1
- package/lib/Cloudflare/Local/SidecarServer.js.map +1 -1
- package/lib/Cloudflare/Providers.d.ts.map +1 -1
- package/lib/Cloudflare/Providers.js +6 -1
- package/lib/Cloudflare/Providers.js.map +1 -1
- package/lib/Cloudflare/Queue/QueueBinding.js +1 -1
- package/lib/Cloudflare/Queue/QueueBinding.js.map +1 -1
- package/lib/Cloudflare/R2/R2BucketBinding.js +1 -1
- package/lib/Cloudflare/R2/R2BucketBinding.js.map +1 -1
- package/lib/Cloudflare/SecretsStore/SecretBinding.js +1 -1
- package/lib/Cloudflare/SecretsStore/SecretBinding.js.map +1 -1
- package/lib/Cloudflare/StateStore/Api.d.ts +1 -1
- package/lib/Cloudflare/StateStore/State.d.ts +2 -2
- package/lib/Cloudflare/Workers/Assets.d.ts +2 -2
- package/lib/Cloudflare/Workers/Assets.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Assets.js +5 -4
- package/lib/Cloudflare/Workers/Assets.js.map +1 -1
- package/lib/Cloudflare/Workers/HttpServer.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/HttpServer.js +25 -3
- package/lib/Cloudflare/Workers/HttpServer.js.map +1 -1
- package/lib/Cloudflare/Workers/InferEnv.d.ts +1 -1
- package/lib/Cloudflare/Workers/InferEnv.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.d.ts +4 -3
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +67 -32
- package/lib/Cloudflare/Workers/Worker.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.js +4 -6
- package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerName.d.ts +1 -1
- package/lib/Cloudflare/Workers/Workflow.js +2 -2
- package/lib/Cloudflare/Workers/Workflow.js.map +1 -1
- package/lib/Cloudflare/index.d.ts +1 -0
- package/lib/Cloudflare/index.d.ts.map +1 -1
- package/lib/Cloudflare/index.js +1 -0
- package/lib/Cloudflare/index.js.map +1 -1
- package/lib/Construct.d.ts +3 -3
- package/lib/Construct.d.ts.map +1 -1
- package/lib/Construct.js.map +1 -1
- package/lib/Deploy.d.ts +1 -1
- package/lib/Destroy.d.ts +1 -1
- package/lib/Destroy.d.ts.map +1 -1
- package/lib/Destroy.js +1 -0
- package/lib/Destroy.js.map +1 -1
- package/lib/Drizzle/Providers.d.ts +1 -1
- package/lib/Drizzle/Schema.d.ts +1 -1
- package/lib/GitHub/Providers.d.ts +1 -1
- package/lib/Http.d.ts +1 -1
- package/lib/Http.d.ts.map +1 -1
- package/lib/Http.js +1 -1
- package/lib/Http.js.map +1 -1
- package/lib/Namespace.d.ts.map +1 -1
- package/lib/Namespace.js +3 -4
- package/lib/Namespace.js.map +1 -1
- package/lib/Neon/Branch.d.ts +2 -2
- package/lib/Neon/Branch.d.ts.map +1 -1
- package/lib/Neon/Branch.js +59 -27
- package/lib/Neon/Branch.js.map +1 -1
- package/lib/Neon/Credentials.d.ts +2 -2
- package/lib/Neon/Credentials.d.ts.map +1 -1
- package/lib/Neon/Credentials.js +2 -2
- package/lib/Neon/Credentials.js.map +1 -1
- package/lib/Neon/NeonEnvironment.d.ts +1 -1
- package/lib/Neon/Project.d.ts +25 -1
- package/lib/Neon/Project.d.ts.map +1 -1
- package/lib/Neon/Project.js +121 -42
- package/lib/Neon/Project.js.map +1 -1
- package/lib/Neon/Providers.d.ts +1 -1
- package/lib/Neon/SqlFile.d.ts +2 -2
- package/lib/Output.d.ts +3 -4
- package/lib/Output.d.ts.map +1 -1
- package/lib/Output.js +7 -4
- package/lib/Output.js.map +1 -1
- package/lib/PhysicalName.d.ts +1 -1
- package/lib/Plan.d.ts +36 -1
- package/lib/Plan.d.ts.map +1 -1
- package/lib/Plan.js +197 -31
- package/lib/Plan.js.map +1 -1
- package/lib/Platform.js +6 -6
- package/lib/Platform.js.map +1 -1
- package/lib/Provider.d.ts +1 -1
- package/lib/Provider.d.ts.map +1 -1
- package/lib/Provider.js +1 -1
- package/lib/Provider.js.map +1 -1
- package/lib/Random.d.ts +1 -1
- package/lib/Random.d.ts.map +1 -1
- package/lib/Random.js +1 -1
- package/lib/Random.js.map +1 -1
- package/lib/Resource.d.ts.map +1 -1
- package/lib/Resource.js +2 -25
- package/lib/Resource.js.map +1 -1
- package/lib/Runtime.d.ts +24 -0
- package/lib/Runtime.d.ts.map +1 -0
- package/lib/Runtime.js +31 -0
- package/lib/Runtime.js.map +1 -0
- package/lib/Secret.js +1 -1
- package/lib/Secret.js.map +1 -1
- package/lib/Sidecar/RpcClient.d.ts +1 -1
- package/lib/Sidecar/RpcPaths.d.ts +1 -1
- package/lib/Sidecar/RpcServer.d.ts +1 -1
- package/lib/Sidecar/RpcServices.d.ts +1 -1
- package/lib/Stack.d.ts +7 -2
- package/lib/Stack.d.ts.map +1 -1
- package/lib/Stack.js +4 -4
- package/lib/Stack.js.map +1 -1
- package/lib/State/ActionState.d.ts +48 -0
- package/lib/State/ActionState.d.ts.map +1 -0
- package/lib/State/ActionState.js +1 -0
- package/lib/State/ActionState.js.map +1 -0
- package/lib/State/HttpStateStore.d.ts.map +1 -1
- package/lib/State/HttpStateStore.js +1 -1
- package/lib/State/HttpStateStore.js.map +1 -1
- package/lib/State/InMemoryState.d.ts.map +1 -1
- package/lib/State/InMemoryState.js.map +1 -1
- package/lib/State/LocalState.d.ts +2 -2
- package/lib/State/ResourceState.d.ts +5 -0
- package/lib/State/ResourceState.d.ts.map +1 -1
- package/lib/State/State.d.ts +10 -2
- package/lib/State/State.d.ts.map +1 -1
- package/lib/State/State.js +2 -0
- package/lib/State/State.js.map +1 -1
- package/lib/State/index.d.ts +1 -0
- package/lib/State/index.d.ts.map +1 -1
- package/lib/State/index.js +1 -0
- package/lib/State/index.js.map +1 -1
- package/lib/Test/Core.d.ts +2 -2
- package/lib/Test/Core.d.ts.map +1 -1
- package/lib/Test/Core.js +4 -1
- package/lib/Test/Core.js.map +1 -1
- package/lib/Util/FileLogger.d.ts +1 -1
- package/lib/Util/effect.js +4 -4
- package/lib/Util/effect.js.map +1 -1
- package/lib/Util/exec.d.ts.map +1 -0
- package/lib/Util/exec.js.map +1 -0
- package/lib/Util/hash.d.ts +8 -0
- package/lib/Util/hash.d.ts.map +1 -0
- package/lib/Util/hash.js +11 -0
- package/lib/Util/hash.js.map +1 -0
- package/lib/Util/ignore.d.ts +40 -0
- package/lib/Util/ignore.d.ts.map +1 -0
- package/lib/Util/ignore.js +591 -0
- package/lib/Util/ignore.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +22 -28
- package/src/AWS/Credentials.ts +1 -2
- package/src/AWS/DynamoDB/Stream.ts +1 -4
- package/src/AWS/EC2/hosted.ts +14 -16
- package/src/AWS/ECS/Task.ts +14 -16
- package/src/AWS/Endpoint.ts +2 -5
- package/src/AWS/EventBridge/EventSource.ts +1 -4
- package/src/AWS/Kinesis/StreamEventSource.ts +1 -4
- package/src/AWS/Lambda/Function.ts +31 -35
- package/src/AWS/Providers.ts +22 -3
- package/src/AWS/Region.ts +2 -3
- package/src/AWS/S3/Bucket.ts +7 -2
- package/src/AWS/S3/BucketNotifications.ts +1 -4
- package/src/AWS/SNS/TopicEventSource.ts +1 -4
- package/src/AWS/SQS/Queue.ts +40 -6
- package/src/Action.ts +280 -0
- package/src/Apply.ts +351 -23
- package/src/Artifacts.ts +2 -4
- package/src/Auth/AuthProvider.ts +1 -1
- package/src/Auth/Env.ts +12 -20
- package/src/Binding.ts +5 -9
- package/src/Bundle/Docker.ts +1 -1
- package/src/Cli/Event.ts +4 -0
- package/src/Cli/NamespaceTree.ts +52 -5
- package/src/Cli/commands/_shared.ts +2 -2
- package/src/Cli/commands/deploy.ts +1 -1
- package/src/Cli/commands/logs.ts +4 -4
- package/src/Cli/commands/tail.ts +4 -4
- package/src/Cli/tui/components/Plan.tsx +65 -17
- package/src/Cli/tui/components/PlanProgress.tsx +142 -32
- package/src/Cloudflare/Access.ts +1 -1
- package/src/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.ts +1 -1
- package/src/Cloudflare/Artifacts/ArtifactsBinding.ts +1 -1
- package/src/Cloudflare/Container/Container.ts +1 -1
- package/src/Cloudflare/Container/ContainerApplication.ts +4 -6
- package/src/Cloudflare/Container/ContainerBinding.ts +2 -2
- package/src/Cloudflare/Email/EmailAddress.ts +155 -0
- package/src/Cloudflare/Email/EmailRouting.ts +138 -0
- package/src/Cloudflare/Email/EmailRule.ts +210 -0
- package/src/Cloudflare/Email/SendEmail.ts +95 -0
- package/src/Cloudflare/Email/SendEmailBinding.ts +124 -0
- package/src/Cloudflare/Email/index.ts +5 -0
- package/src/Cloudflare/Images/ImagesBinding.ts +1 -1
- package/src/Cloudflare/KV/KVNamespaceBinding.ts +1 -1
- package/src/Cloudflare/Local/SidecarServer.ts +1 -1
- package/src/Cloudflare/Providers.ts +9 -0
- package/src/Cloudflare/Queue/QueueBinding.ts +1 -1
- package/src/Cloudflare/R2/R2BucketBinding.ts +1 -1
- package/src/Cloudflare/SecretsStore/SecretBinding.ts +1 -1
- package/src/Cloudflare/Workers/Assets.ts +5 -6
- package/src/Cloudflare/Workers/HttpServer.ts +37 -5
- package/src/Cloudflare/Workers/InferEnv.ts +15 -11
- package/src/Cloudflare/Workers/Worker.ts +78 -36
- package/src/Cloudflare/Workers/WorkerBundle.ts +4 -6
- package/src/Cloudflare/Workers/Workflow.ts +2 -2
- package/src/Cloudflare/index.ts +1 -0
- package/src/Construct.ts +3 -7
- package/src/Destroy.ts +1 -0
- package/src/Http.ts +1 -1
- package/src/Namespace.ts +4 -4
- package/src/Neon/Branch.ts +93 -59
- package/src/Neon/Credentials.ts +2 -2
- package/src/Neon/Project.ts +193 -64
- package/src/Output.ts +9 -7
- package/src/Plan.ts +303 -53
- package/src/Platform.ts +7 -7
- package/src/Provider.ts +8 -3
- package/src/Random.ts +1 -1
- package/src/Resource.ts +2 -25
- package/src/Runtime.ts +38 -0
- package/src/Secret.ts +1 -1
- package/src/Stack.ts +10 -6
- package/src/State/ActionState.ts +51 -0
- package/src/State/HttpStateStore.ts +6 -2
- package/src/State/InMemoryState.ts +3 -3
- package/src/State/ResourceState.ts +5 -0
- package/src/State/State.ts +17 -2
- package/src/State/index.ts +1 -0
- package/src/Test/Core.ts +4 -3
- package/src/Util/effect.ts +4 -4
- package/src/Util/hash.ts +14 -0
- package/src/Util/ignore.ts +815 -0
- package/src/index.ts +6 -0
- package/lib/Agent/Agent.d.ts +0 -9
- package/lib/Agent/Agent.d.ts.map +0 -1
- package/lib/Agent/Agent.js +0 -10
- package/lib/Agent/Agent.js.map +0 -1
- package/lib/Agent/Aspect.d.ts +0 -51
- package/lib/Agent/Aspect.d.ts.map +0 -1
- package/lib/Agent/Aspect.js +0 -45
- package/lib/Agent/Aspect.js.map +0 -1
- package/lib/Agent/AspectGraph.d.ts +0 -45
- package/lib/Agent/AspectGraph.d.ts.map +0 -1
- package/lib/Agent/AspectGraph.js +0 -39
- package/lib/Agent/AspectGraph.js.map +0 -1
- package/lib/Agent/ContextPlugin.d.ts +0 -8
- package/lib/Agent/ContextPlugin.d.ts.map +0 -1
- package/lib/Agent/ContextPlugin.js +0 -3
- package/lib/Agent/ContextPlugin.js.map +0 -1
- package/lib/Agent/Plugin.d.ts +0 -18
- package/lib/Agent/Plugin.d.ts.map +0 -1
- package/lib/Agent/Plugin.js +0 -8
- package/lib/Agent/Plugin.js.map +0 -1
- package/lib/Agent/chat/channel.d.ts +0 -9
- package/lib/Agent/chat/channel.d.ts.map +0 -1
- package/lib/Agent/chat/channel.js +0 -10
- package/lib/Agent/chat/channel.js.map +0 -1
- package/lib/Agent/chat/event.d.ts +0 -32
- package/lib/Agent/chat/event.d.ts.map +0 -1
- package/lib/Agent/chat/event.js +0 -32
- package/lib/Agent/chat/event.js.map +0 -1
- package/lib/Agent/chat/message.d.ts +0 -22
- package/lib/Agent/chat/message.d.ts.map +0 -1
- package/lib/Agent/chat/message.js +0 -31
- package/lib/Agent/chat/message.js.map +0 -1
- package/lib/Agent/chat/service.d.ts +0 -102
- package/lib/Agent/chat/service.d.ts.map +0 -1
- package/lib/Agent/chat/service.js +0 -79
- package/lib/Agent/chat/service.js.map +0 -1
- package/lib/Agent/chat/thread.d.ts +0 -13
- package/lib/Agent/chat/thread.d.ts.map +0 -1
- package/lib/Agent/chat/thread.js +0 -16
- package/lib/Agent/chat/thread.js.map +0 -1
- package/lib/Agent/coding/bash.d.ts +0 -36
- package/lib/Agent/coding/bash.d.ts.map +0 -1
- package/lib/Agent/coding/bash.js +0 -170
- package/lib/Agent/coding/bash.js.map +0 -1
- package/lib/Agent/coding/edit.d.ts +0 -31
- package/lib/Agent/coding/edit.d.ts.map +0 -1
- package/lib/Agent/coding/edit.js +0 -90
- package/lib/Agent/coding/edit.js.map +0 -1
- package/lib/Agent/coding/glob.d.ts +0 -23
- package/lib/Agent/coding/glob.d.ts.map +0 -1
- package/lib/Agent/coding/glob.js +0 -78
- package/lib/Agent/coding/glob.js.map +0 -1
- package/lib/Agent/coding/grep.d.ts +0 -26
- package/lib/Agent/coding/grep.d.ts.map +0 -1
- package/lib/Agent/coding/grep.js +0 -105
- package/lib/Agent/coding/grep.js.map +0 -1
- package/lib/Agent/coding/index.d.ts +0 -8
- package/lib/Agent/coding/index.d.ts.map +0 -1
- package/lib/Agent/coding/index.js +0 -8
- package/lib/Agent/coding/index.js.map +0 -1
- package/lib/Agent/coding/read.d.ts +0 -27
- package/lib/Agent/coding/read.d.ts.map +0 -1
- package/lib/Agent/coding/read.js +0 -89
- package/lib/Agent/coding/read.js.map +0 -1
- package/lib/Agent/coding/readlints.d.ts +0 -19
- package/lib/Agent/coding/readlints.d.ts.map +0 -1
- package/lib/Agent/coding/readlints.js +0 -53
- package/lib/Agent/coding/readlints.js.map +0 -1
- package/lib/Agent/coding/write.d.ts +0 -22
- package/lib/Agent/coding/write.d.ts.map +0 -1
- package/lib/Agent/coding/write.js +0 -53
- package/lib/Agent/coding/write.js.map +0 -1
- package/lib/Agent/fs/file.d.ts +0 -12
- package/lib/Agent/fs/file.d.ts.map +0 -1
- package/lib/Agent/fs/file.js +0 -8
- package/lib/Agent/fs/file.js.map +0 -1
- package/lib/Agent/fs/folder.d.ts +0 -5
- package/lib/Agent/fs/folder.d.ts.map +0 -1
- package/lib/Agent/fs/folder.js +0 -3
- package/lib/Agent/fs/folder.js.map +0 -1
- package/lib/Agent/index.d.ts +0 -9
- package/lib/Agent/index.d.ts.map +0 -1
- package/lib/Agent/index.js +0 -9
- package/lib/Agent/index.js.map +0 -1
- package/lib/Agent/llm/error.d.ts +0 -208
- package/lib/Agent/llm/error.d.ts.map +0 -1
- package/lib/Agent/llm/error.js +0 -209
- package/lib/Agent/llm/error.js.map +0 -1
- package/lib/Agent/llm/index.d.ts +0 -5
- package/lib/Agent/llm/index.d.ts.map +0 -1
- package/lib/Agent/llm/index.js +0 -5
- package/lib/Agent/llm/index.js.map +0 -1
- package/lib/Agent/llm/llm.d.ts +0 -32
- package/lib/Agent/llm/llm.d.ts.map +0 -1
- package/lib/Agent/llm/llm.js +0 -74
- package/lib/Agent/llm/llm.js.map +0 -1
- package/lib/Agent/llm/stream-collectors.d.ts +0 -46
- package/lib/Agent/llm/stream-collectors.d.ts.map +0 -1
- package/lib/Agent/llm/stream-collectors.js +0 -33
- package/lib/Agent/llm/stream-collectors.js.map +0 -1
- package/lib/Agent/llm/stream-text-part.d.ts +0 -5
- package/lib/Agent/llm/stream-text-part.d.ts.map +0 -1
- package/lib/Agent/llm/stream-text-part.js +0 -4
- package/lib/Agent/llm/stream-text-part.js.map +0 -1
- package/lib/Agent/lsp/client.d.ts +0 -122
- package/lib/Agent/lsp/client.d.ts.map +0 -1
- package/lib/Agent/lsp/client.js +0 -180
- package/lib/Agent/lsp/client.js.map +0 -1
- package/lib/Agent/lsp/diagnostics.d.ts +0 -16
- package/lib/Agent/lsp/diagnostics.d.ts.map +0 -1
- package/lib/Agent/lsp/diagnostics.js +0 -48
- package/lib/Agent/lsp/diagnostics.js.map +0 -1
- package/lib/Agent/lsp/jsonrpc.d.ts +0 -90
- package/lib/Agent/lsp/jsonrpc.d.ts.map +0 -1
- package/lib/Agent/lsp/jsonrpc.js +0 -178
- package/lib/Agent/lsp/jsonrpc.js.map +0 -1
- package/lib/Agent/lsp/manager.d.ts +0 -38
- package/lib/Agent/lsp/manager.d.ts.map +0 -1
- package/lib/Agent/lsp/manager.js +0 -98
- package/lib/Agent/lsp/manager.js.map +0 -1
- package/lib/Agent/lsp/servers.d.ts +0 -28
- package/lib/Agent/lsp/servers.d.ts.map +0 -1
- package/lib/Agent/lsp/servers.js +0 -21
- package/lib/Agent/lsp/servers.js.map +0 -1
- package/lib/Agent/process/driver.d.ts +0 -10
- package/lib/Agent/process/driver.d.ts.map +0 -1
- package/lib/Agent/process/driver.js +0 -153
- package/lib/Agent/process/driver.js.map +0 -1
- package/lib/Agent/process/issue-service.d.ts +0 -44
- package/lib/Agent/process/issue-service.d.ts.map +0 -1
- package/lib/Agent/process/issue-service.js +0 -28
- package/lib/Agent/process/issue-service.js.map +0 -1
- package/lib/Agent/process/issue-tools.d.ts +0 -28
- package/lib/Agent/process/issue-tools.d.ts.map +0 -1
- package/lib/Agent/process/issue-tools.js +0 -28
- package/lib/Agent/process/issue-tools.js.map +0 -1
- package/lib/Agent/process/issue.d.ts +0 -16
- package/lib/Agent/process/issue.d.ts.map +0 -1
- package/lib/Agent/process/issue.js +0 -17
- package/lib/Agent/process/issue.js.map +0 -1
- package/lib/Agent/process/organization.d.ts +0 -4
- package/lib/Agent/process/organization.d.ts.map +0 -1
- package/lib/Agent/process/organization.js +0 -3
- package/lib/Agent/process/organization.js.map +0 -1
- package/lib/Agent/process/process.d.ts +0 -5
- package/lib/Agent/process/process.d.ts.map +0 -1
- package/lib/Agent/process/process.js +0 -3
- package/lib/Agent/process/process.js.map +0 -1
- package/lib/Agent/process/reply.d.ts +0 -16
- package/lib/Agent/process/reply.d.ts.map +0 -1
- package/lib/Agent/process/reply.js +0 -18
- package/lib/Agent/process/reply.js.map +0 -1
- package/lib/Agent/process/task.d.ts +0 -25
- package/lib/Agent/process/task.d.ts.map +0 -1
- package/lib/Agent/process/task.js +0 -26
- package/lib/Agent/process/task.js.map +0 -1
- package/lib/Agent/tool/index.d.ts +0 -4
- package/lib/Agent/tool/index.d.ts.map +0 -1
- package/lib/Agent/tool/index.js +0 -4
- package/lib/Agent/tool/index.js.map +0 -1
- package/lib/Agent/tool/parameter.d.ts +0 -12
- package/lib/Agent/tool/parameter.d.ts.map +0 -1
- package/lib/Agent/tool/parameter.js +0 -6
- package/lib/Agent/tool/parameter.js.map +0 -1
- package/lib/Agent/tool/result.d.ts +0 -17
- package/lib/Agent/tool/result.d.ts.map +0 -1
- package/lib/Agent/tool/result.js +0 -6
- package/lib/Agent/tool/result.js.map +0 -1
- package/lib/Agent/tool/tool.d.ts +0 -32
- package/lib/Agent/tool/tool.d.ts.map +0 -1
- package/lib/Agent/tool/tool.js +0 -16
- package/lib/Agent/tool/tool.js.map +0 -1
- package/lib/Agent/util/command-validator.d.ts +0 -12
- package/lib/Agent/util/command-validator.d.ts.map +0 -1
- package/lib/Agent/util/command-validator.js +0 -74
- package/lib/Agent/util/command-validator.js.map +0 -1
- package/lib/Agent/util/exec.d.ts.map +0 -1
- package/lib/Agent/util/exec.js.map +0 -1
- package/lib/Agent/util/parser.d.ts +0 -5
- package/lib/Agent/util/parser.d.ts.map +0 -1
- package/lib/Agent/util/parser.js +0 -41
- package/lib/Agent/util/parser.js.map +0 -1
- package/lib/Agent/util/replace.d.ts +0 -38
- package/lib/Agent/util/replace.d.ts.map +0 -1
- package/lib/Agent/util/replace.js +0 -458
- package/lib/Agent/util/replace.js.map +0 -1
- package/lib/Agent/util/ripgrep.d.ts +0 -109
- package/lib/Agent/util/ripgrep.d.ts.map +0 -1
- package/lib/Agent/util/ripgrep.js +0 -221
- package/lib/Agent/util/ripgrep.js.map +0 -1
- package/lib/Neon/api.d.ts +0 -258
- package/lib/Neon/api.d.ts.map +0 -1
- package/lib/Neon/api.js +0 -215
- package/lib/Neon/api.js.map +0 -1
- package/src/Agent/Agent.ts +0 -26
- package/src/Agent/Aspect.ts +0 -173
- package/src/Agent/AspectGraph.ts +0 -98
- package/src/Agent/ContextPlugin.ts +0 -18
- package/src/Agent/Plugin.ts +0 -29
- package/src/Agent/chat/channel.ts +0 -26
- package/src/Agent/chat/event.ts +0 -43
- package/src/Agent/chat/message.ts +0 -35
- package/src/Agent/chat/service.ts +0 -133
- package/src/Agent/chat/thread.ts +0 -17
- package/src/Agent/coding/bash.ts +0 -197
- package/src/Agent/coding/edit.ts +0 -152
- package/src/Agent/coding/glob.ts +0 -96
- package/src/Agent/coding/grep.ts +0 -143
- package/src/Agent/coding/index.ts +0 -7
- package/src/Agent/coding/read.ts +0 -119
- package/src/Agent/coding/readlints.ts +0 -78
- package/src/Agent/coding/write.ts +0 -79
- package/src/Agent/fs/file.ts +0 -22
- package/src/Agent/fs/folder.ts +0 -16
- package/src/Agent/index.ts +0 -9
- package/src/Agent/llm/error.ts +0 -330
- package/src/Agent/llm/index.ts +0 -4
- package/src/Agent/llm/llm.ts +0 -131
- package/src/Agent/llm/stream-collectors.ts +0 -58
- package/src/Agent/llm/stream-text-part.ts +0 -7
- package/src/Agent/lsp/client.ts +0 -293
- package/src/Agent/lsp/diagnostics.ts +0 -64
- package/src/Agent/lsp/jsonrpc.ts +0 -317
- package/src/Agent/lsp/manager.ts +0 -213
- package/src/Agent/lsp/servers.ts +0 -37
- package/src/Agent/process/driver.ts +0 -168
- package/src/Agent/process/issue-service.ts +0 -48
- package/src/Agent/process/issue-tools.ts +0 -33
- package/src/Agent/process/issue.ts +0 -22
- package/src/Agent/process/organization.ts +0 -16
- package/src/Agent/process/process.ts +0 -16
- package/src/Agent/process/reply.ts +0 -21
- package/src/Agent/process/task.ts +0 -34
- package/src/Agent/tool/index.ts +0 -3
- package/src/Agent/tool/parameter.ts +0 -35
- package/src/Agent/tool/result.ts +0 -51
- package/src/Agent/tool/tool.ts +0 -74
- package/src/Agent/util/command-validator.ts +0 -98
- package/src/Agent/util/parser.ts +0 -39
- package/src/Agent/util/replace.ts +0 -559
- package/src/Agent/util/ripgrep.ts +0 -256
- package/src/Neon/api.ts +0 -579
- /package/lib/{Agent/util → Util}/exec.d.ts +0 -0
- /package/lib/{Agent/util → Util}/exec.js +0 -0
- /package/src/{Agent/util → Util}/exec.ts +0 -0
package/src/Agent/llm/error.ts
DELETED
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
import * as AISDKProvider from "@ai-sdk/provider";
|
|
2
|
-
import { DownloadError as AISDKDownloadError } from "ai";
|
|
3
|
-
import * as Data from "effect/Data";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Base AI SDK error - wraps generic AI SDK errors
|
|
7
|
-
*/
|
|
8
|
-
export class AISDKError extends Data.TaggedError("AISDKError")<{
|
|
9
|
-
readonly message: string;
|
|
10
|
-
readonly cause?: unknown;
|
|
11
|
-
}> {}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* API call error - wraps errors from API calls to AI providers
|
|
15
|
-
*/
|
|
16
|
-
export class APICallError extends Data.TaggedError("APICallError")<{
|
|
17
|
-
readonly message: string;
|
|
18
|
-
readonly url: string;
|
|
19
|
-
readonly requestBodyValues: unknown;
|
|
20
|
-
readonly statusCode?: number;
|
|
21
|
-
readonly responseHeaders?: Record<string, string>;
|
|
22
|
-
readonly responseBody?: string;
|
|
23
|
-
readonly isRetryable: boolean;
|
|
24
|
-
readonly data?: unknown;
|
|
25
|
-
readonly cause?: unknown;
|
|
26
|
-
}> {}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Empty response body error - thrown when the API returns an empty response
|
|
30
|
-
*/
|
|
31
|
-
export class EmptyResponseBodyError extends Data.TaggedError(
|
|
32
|
-
"EmptyResponseBodyError",
|
|
33
|
-
)<{
|
|
34
|
-
readonly message: string;
|
|
35
|
-
readonly cause?: unknown;
|
|
36
|
-
}> {}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Invalid argument error - thrown when a function argument is invalid
|
|
40
|
-
*/
|
|
41
|
-
export class InvalidArgumentError extends Data.TaggedError(
|
|
42
|
-
"InvalidArgumentError",
|
|
43
|
-
)<{
|
|
44
|
-
readonly message: string;
|
|
45
|
-
readonly argument: string;
|
|
46
|
-
readonly cause?: unknown;
|
|
47
|
-
}> {}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Invalid prompt error - thrown when a prompt cannot be processed
|
|
51
|
-
*/
|
|
52
|
-
export class InvalidPromptError extends Data.TaggedError("InvalidPromptError")<{
|
|
53
|
-
readonly message: string;
|
|
54
|
-
readonly prompt: unknown;
|
|
55
|
-
readonly cause?: unknown;
|
|
56
|
-
}> {}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Invalid response data error - thrown when response data cannot be parsed
|
|
60
|
-
*/
|
|
61
|
-
export class InvalidResponseDataError extends Data.TaggedError(
|
|
62
|
-
"InvalidResponseDataError",
|
|
63
|
-
)<{
|
|
64
|
-
readonly message: string;
|
|
65
|
-
readonly data: unknown;
|
|
66
|
-
readonly cause?: unknown;
|
|
67
|
-
}> {}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* JSON parse error - thrown when JSON parsing fails
|
|
71
|
-
*/
|
|
72
|
-
export class JSONParseError extends Data.TaggedError("JSONParseError")<{
|
|
73
|
-
readonly message: string;
|
|
74
|
-
readonly text: string;
|
|
75
|
-
readonly cause?: unknown;
|
|
76
|
-
}> {}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Load API key error - thrown when API key cannot be loaded
|
|
80
|
-
*/
|
|
81
|
-
export class LoadAPIKeyError extends Data.TaggedError("LoadAPIKeyError")<{
|
|
82
|
-
readonly message: string;
|
|
83
|
-
readonly cause?: unknown;
|
|
84
|
-
}> {}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Load setting error - thrown when a setting cannot be loaded
|
|
88
|
-
*/
|
|
89
|
-
export class LoadSettingError extends Data.TaggedError("LoadSettingError")<{
|
|
90
|
-
readonly message: string;
|
|
91
|
-
readonly cause?: unknown;
|
|
92
|
-
}> {}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* No content generated error - thrown when the AI provider fails to generate content
|
|
96
|
-
*/
|
|
97
|
-
export class NoContentGeneratedError extends Data.TaggedError(
|
|
98
|
-
"NoContentGeneratedError",
|
|
99
|
-
)<{
|
|
100
|
-
readonly message: string;
|
|
101
|
-
readonly cause?: unknown;
|
|
102
|
-
}> {}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* No such model error - thrown when a model cannot be found
|
|
106
|
-
*/
|
|
107
|
-
export class NoSuchModelError extends Data.TaggedError("NoSuchModelError")<{
|
|
108
|
-
readonly message: string;
|
|
109
|
-
readonly modelId: string;
|
|
110
|
-
readonly modelType: string;
|
|
111
|
-
readonly cause?: unknown;
|
|
112
|
-
}> {}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Too many embedding values error - thrown when too many values are passed to an embedding call
|
|
116
|
-
*/
|
|
117
|
-
export class TooManyEmbeddingValuesForCallError extends Data.TaggedError(
|
|
118
|
-
"TooManyEmbeddingValuesForCallError",
|
|
119
|
-
)<{
|
|
120
|
-
readonly message: string;
|
|
121
|
-
readonly provider: string;
|
|
122
|
-
readonly modelId: string;
|
|
123
|
-
readonly maxEmbeddingsPerCall: number;
|
|
124
|
-
readonly values: Array<unknown>;
|
|
125
|
-
readonly cause?: unknown;
|
|
126
|
-
}> {}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Type validation error - thrown when type validation fails
|
|
130
|
-
*/
|
|
131
|
-
export class TypeValidationError extends Data.TaggedError(
|
|
132
|
-
"TypeValidationError",
|
|
133
|
-
)<{
|
|
134
|
-
readonly message: string;
|
|
135
|
-
readonly value: unknown;
|
|
136
|
-
readonly cause?: unknown;
|
|
137
|
-
}> {}
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Unsupported functionality error - thrown when a feature is not supported
|
|
141
|
-
*/
|
|
142
|
-
export class UnsupportedFunctionalityError extends Data.TaggedError(
|
|
143
|
-
"UnsupportedFunctionalityError",
|
|
144
|
-
)<{
|
|
145
|
-
readonly message: string;
|
|
146
|
-
readonly functionality: string;
|
|
147
|
-
readonly cause?: unknown;
|
|
148
|
-
}> {}
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Download error - thrown when a file download fails
|
|
152
|
-
*/
|
|
153
|
-
export class DownloadError extends Data.TaggedError("DownloadError")<{
|
|
154
|
-
readonly message: string;
|
|
155
|
-
readonly url: string;
|
|
156
|
-
readonly statusCode?: number;
|
|
157
|
-
readonly statusText?: string;
|
|
158
|
-
readonly cause?: unknown;
|
|
159
|
-
}> {}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Unknown error - fallback for unrecognized errors
|
|
163
|
-
*/
|
|
164
|
-
export class UnknownAISDKError extends Data.TaggedError("UnknownAISDKError")<{
|
|
165
|
-
readonly message: string;
|
|
166
|
-
readonly cause?: unknown;
|
|
167
|
-
}> {}
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Union type of all AI SDK errors
|
|
171
|
-
*/
|
|
172
|
-
export type LLMError =
|
|
173
|
-
| AISDKError
|
|
174
|
-
| APICallError
|
|
175
|
-
| EmptyResponseBodyError
|
|
176
|
-
| InvalidArgumentError
|
|
177
|
-
| InvalidPromptError
|
|
178
|
-
| InvalidResponseDataError
|
|
179
|
-
| JSONParseError
|
|
180
|
-
| LoadAPIKeyError
|
|
181
|
-
| LoadSettingError
|
|
182
|
-
| NoContentGeneratedError
|
|
183
|
-
| NoSuchModelError
|
|
184
|
-
| TooManyEmbeddingValuesForCallError
|
|
185
|
-
| TypeValidationError
|
|
186
|
-
| UnsupportedFunctionalityError
|
|
187
|
-
| DownloadError
|
|
188
|
-
| UnknownAISDKError;
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Converts any error to a typed LLMError
|
|
192
|
-
*/
|
|
193
|
-
export const fromAnyError = (e: unknown): LLMError => {
|
|
194
|
-
if (AISDKDownloadError.isInstance(e)) {
|
|
195
|
-
return new DownloadError({
|
|
196
|
-
message: e.message,
|
|
197
|
-
url: e.url,
|
|
198
|
-
statusCode: e.statusCode,
|
|
199
|
-
statusText: e.statusText,
|
|
200
|
-
cause: e,
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
if (AISDKProvider.APICallError.isInstance(e)) {
|
|
205
|
-
return new APICallError({
|
|
206
|
-
message: e.message,
|
|
207
|
-
url: e.url,
|
|
208
|
-
requestBodyValues: e.requestBodyValues,
|
|
209
|
-
statusCode: e.statusCode,
|
|
210
|
-
responseHeaders: e.responseHeaders,
|
|
211
|
-
responseBody: e.responseBody,
|
|
212
|
-
isRetryable: e.isRetryable,
|
|
213
|
-
data: e.data,
|
|
214
|
-
cause: e,
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if (AISDKProvider.EmptyResponseBodyError.isInstance(e)) {
|
|
219
|
-
return new EmptyResponseBodyError({
|
|
220
|
-
message: e.message,
|
|
221
|
-
cause: e,
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
if (AISDKProvider.InvalidArgumentError.isInstance(e)) {
|
|
226
|
-
return new InvalidArgumentError({
|
|
227
|
-
message: e.message,
|
|
228
|
-
argument: e.argument,
|
|
229
|
-
cause: e,
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
if (AISDKProvider.InvalidPromptError.isInstance(e)) {
|
|
234
|
-
return new InvalidPromptError({
|
|
235
|
-
message: e.message,
|
|
236
|
-
prompt: e.prompt,
|
|
237
|
-
cause: e,
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
if (AISDKProvider.InvalidResponseDataError.isInstance(e)) {
|
|
242
|
-
return new InvalidResponseDataError({
|
|
243
|
-
message: e.message,
|
|
244
|
-
data: e.data,
|
|
245
|
-
cause: e,
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
if (AISDKProvider.JSONParseError.isInstance(e)) {
|
|
250
|
-
return new JSONParseError({
|
|
251
|
-
message: e.message,
|
|
252
|
-
text: e.text,
|
|
253
|
-
cause: e,
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
if (AISDKProvider.LoadAPIKeyError.isInstance(e)) {
|
|
258
|
-
return new LoadAPIKeyError({
|
|
259
|
-
message: e.message,
|
|
260
|
-
cause: e,
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
if (AISDKProvider.LoadSettingError.isInstance(e)) {
|
|
265
|
-
return new LoadSettingError({
|
|
266
|
-
message: e.message,
|
|
267
|
-
cause: e,
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
if (AISDKProvider.NoContentGeneratedError.isInstance(e)) {
|
|
272
|
-
return new NoContentGeneratedError({
|
|
273
|
-
message: e.message,
|
|
274
|
-
cause: e,
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
if (AISDKProvider.NoSuchModelError.isInstance(e)) {
|
|
279
|
-
return new NoSuchModelError({
|
|
280
|
-
message: e.message,
|
|
281
|
-
modelId: e.modelId,
|
|
282
|
-
modelType: e.modelType,
|
|
283
|
-
cause: e,
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
if (AISDKProvider.TooManyEmbeddingValuesForCallError.isInstance(e)) {
|
|
288
|
-
return new TooManyEmbeddingValuesForCallError({
|
|
289
|
-
message: e.message,
|
|
290
|
-
provider: e.provider,
|
|
291
|
-
modelId: e.modelId,
|
|
292
|
-
maxEmbeddingsPerCall: e.maxEmbeddingsPerCall,
|
|
293
|
-
values: e.values,
|
|
294
|
-
cause: e,
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
if (AISDKProvider.TypeValidationError.isInstance(e)) {
|
|
299
|
-
return new TypeValidationError({
|
|
300
|
-
message: e.message,
|
|
301
|
-
value: e.value,
|
|
302
|
-
cause: e,
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
if (AISDKProvider.UnsupportedFunctionalityError.isInstance(e)) {
|
|
307
|
-
return new UnsupportedFunctionalityError({
|
|
308
|
-
message: e.message,
|
|
309
|
-
functionality: e.functionality,
|
|
310
|
-
cause: e,
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
// Generic AISDKError check (should be last since it's the base class)
|
|
315
|
-
if (AISDKProvider.AISDKError.isInstance(e)) {
|
|
316
|
-
return new AISDKError({
|
|
317
|
-
message: e.message,
|
|
318
|
-
cause: e,
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
// Fallback for unknown errors
|
|
323
|
-
const message =
|
|
324
|
-
e instanceof Error
|
|
325
|
-
? e.message
|
|
326
|
-
: typeof e === "string"
|
|
327
|
-
? e
|
|
328
|
-
: "Unknown error";
|
|
329
|
-
return new UnknownAISDKError({ message, cause: e });
|
|
330
|
-
};
|
package/src/Agent/llm/index.ts
DELETED
package/src/Agent/llm/llm.ts
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createAnthropic,
|
|
3
|
-
type AnthropicProviderOptions,
|
|
4
|
-
} from "@ai-sdk/anthropic";
|
|
5
|
-
import {
|
|
6
|
-
createOpenAI,
|
|
7
|
-
type OpenAIResponsesProviderOptions,
|
|
8
|
-
} from "@ai-sdk/openai";
|
|
9
|
-
import { jsonSchema, tool, ToolLoopAgent, type ModelMessage } from "ai";
|
|
10
|
-
import * as Context from "effect/Context";
|
|
11
|
-
import * as Effect from "effect/Effect";
|
|
12
|
-
import * as Layer from "effect/Layer";
|
|
13
|
-
import * as Redacted from "effect/Redacted";
|
|
14
|
-
import * as S from "effect/Schema";
|
|
15
|
-
import * as Stream from "effect/Stream";
|
|
16
|
-
import type { IsUnknown } from "../../Util/unknown.ts";
|
|
17
|
-
import type { Tool } from "../tool/tool.ts";
|
|
18
|
-
import { fromAnyError, type LLMError } from "./error.ts";
|
|
19
|
-
import type { StreamTextPart } from "./stream-text-part.ts";
|
|
20
|
-
|
|
21
|
-
export class LLM extends Context.Service<LLM, LLMService>()("LLM") {}
|
|
22
|
-
|
|
23
|
-
export type StreamTextOptions<T extends Tool = Tool> = {
|
|
24
|
-
messages: ModelMessage[];
|
|
25
|
-
model?: string;
|
|
26
|
-
system: string;
|
|
27
|
-
tools: T[];
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export interface LLMService {
|
|
31
|
-
stream: <Tools extends Tool>(
|
|
32
|
-
input: StreamTextOptions<Tools>,
|
|
33
|
-
) => Stream.Stream<
|
|
34
|
-
StreamTextPart,
|
|
35
|
-
IsUnknown<Tool.Error<Tools>> extends true
|
|
36
|
-
? LLMError
|
|
37
|
-
: LLMError | Tool.Error<Tools>,
|
|
38
|
-
Exclude<Tool.Context<Tools>, unknown>
|
|
39
|
-
>;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface LLMConfig {
|
|
43
|
-
anthropic?: {
|
|
44
|
-
apiKey: Redacted.Redacted<string>;
|
|
45
|
-
};
|
|
46
|
-
openai?: {
|
|
47
|
-
apiKey: Redacted.Redacted<string>;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export const llm = (config: LLMConfig) =>
|
|
52
|
-
Layer.sync(LLM, () => {
|
|
53
|
-
const anthropic = config.anthropic?.apiKey
|
|
54
|
-
? createAnthropic({
|
|
55
|
-
apiKey: Redacted.value(config.anthropic?.apiKey),
|
|
56
|
-
})
|
|
57
|
-
: undefined;
|
|
58
|
-
const openai = config.openai?.apiKey
|
|
59
|
-
? createOpenAI({ apiKey: Redacted.value(config.openai?.apiKey) })
|
|
60
|
-
: undefined;
|
|
61
|
-
|
|
62
|
-
return {
|
|
63
|
-
stream: <T extends Tool>(input: StreamTextOptions<T>) => {
|
|
64
|
-
const modelId = input.model ?? "anthropic/claude-opus-4.5";
|
|
65
|
-
const modelProvider = modelId.split("/")[0];
|
|
66
|
-
const model = modelId.includes("anthropic")
|
|
67
|
-
? anthropic?.(modelId)
|
|
68
|
-
: openai?.(modelId);
|
|
69
|
-
|
|
70
|
-
if (!model) {
|
|
71
|
-
return Stream.die(`No model found for ${modelId}`);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return Stream.fromEffect(
|
|
75
|
-
Effect.gen(function* () {
|
|
76
|
-
// we need to get the caller's context so we can construct async functions
|
|
77
|
-
const context = yield* Effect.context<never>();
|
|
78
|
-
const tools: any = {};
|
|
79
|
-
for (const t of input.tools) {
|
|
80
|
-
const decode = S.decodeEffect(t.schema);
|
|
81
|
-
tools[t.props.alias?.(modelId) ?? t.id] = tool({
|
|
82
|
-
inputSchema: jsonSchema(S.toJsonSchemaDocument(t.schema)),
|
|
83
|
-
description: "TODO",
|
|
84
|
-
execute: (params) =>
|
|
85
|
-
Effect.runPromise(
|
|
86
|
-
decode(params as any).pipe(
|
|
87
|
-
Effect.flatMap(t.handle),
|
|
88
|
-
// provide the caller's context so the tool can access it
|
|
89
|
-
Effect.provide(context),
|
|
90
|
-
) as Effect.Effect<any>,
|
|
91
|
-
),
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
return tools;
|
|
95
|
-
}).pipe(
|
|
96
|
-
Effect.flatMap((tools) =>
|
|
97
|
-
Effect.promise((abortSignal) =>
|
|
98
|
-
new ToolLoopAgent({
|
|
99
|
-
model,
|
|
100
|
-
instructions: input.system,
|
|
101
|
-
// never stop, build the world!!!
|
|
102
|
-
stopWhen: () => false,
|
|
103
|
-
tools,
|
|
104
|
-
providerOptions:
|
|
105
|
-
modelProvider === "anthropic"
|
|
106
|
-
? {
|
|
107
|
-
anthropic: {
|
|
108
|
-
effort: "high",
|
|
109
|
-
thinking: { type: "enabled", budgetTokens: 12000 },
|
|
110
|
-
} satisfies AnthropicProviderOptions,
|
|
111
|
-
}
|
|
112
|
-
: {
|
|
113
|
-
openai: {
|
|
114
|
-
reasoningEffort: "high",
|
|
115
|
-
} satisfies OpenAIResponsesProviderOptions,
|
|
116
|
-
},
|
|
117
|
-
})
|
|
118
|
-
.stream({
|
|
119
|
-
messages: input.messages,
|
|
120
|
-
abortSignal,
|
|
121
|
-
})
|
|
122
|
-
.then((s) => s.fullStream),
|
|
123
|
-
),
|
|
124
|
-
),
|
|
125
|
-
),
|
|
126
|
-
).pipe(
|
|
127
|
-
Stream.flatMap((it) => Stream.fromAsyncIterable(it, fromAnyError)),
|
|
128
|
-
);
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
});
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import * as Sink from "effect/Sink";
|
|
2
|
-
import type { StreamTextPart } from "./stream-text-part.ts";
|
|
3
|
-
|
|
4
|
-
// Extract specific part types from the StreamTextPart union
|
|
5
|
-
export type TextDeltaPart = Extract<StreamTextPart, { type: "text-delta" }>;
|
|
6
|
-
export type TextStartPart = Extract<StreamTextPart, { type: "text-start" }>;
|
|
7
|
-
export type TextEndPart = Extract<StreamTextPart, { type: "text-end" }>;
|
|
8
|
-
export type ReasoningDeltaPart = Extract<
|
|
9
|
-
StreamTextPart,
|
|
10
|
-
{ type: "reasoning-delta" }
|
|
11
|
-
>;
|
|
12
|
-
export type ReasoningStartPart = Extract<
|
|
13
|
-
StreamTextPart,
|
|
14
|
-
{ type: "reasoning-start" }
|
|
15
|
-
>;
|
|
16
|
-
export type ReasoningEndPart = Extract<
|
|
17
|
-
StreamTextPart,
|
|
18
|
-
{ type: "reasoning-end" }
|
|
19
|
-
>;
|
|
20
|
-
export type ToolCallPart = Extract<StreamTextPart, { type: "tool-call" }>;
|
|
21
|
-
export type ToolResultPart = Extract<StreamTextPart, { type: "tool-result" }>;
|
|
22
|
-
export type ToolErrorPart = Extract<StreamTextPart, { type: "tool-error" }>;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Creates a sink that collects the text from the last complete text message.
|
|
26
|
-
* A complete message is one that has received a text-end event.
|
|
27
|
-
* Returns undefined if no complete text messages are present.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* const lastText = yield* llm.stream({ ... }).pipe(
|
|
32
|
-
* Stream.run(collectLastText())
|
|
33
|
-
* );
|
|
34
|
-
* if (lastText) {
|
|
35
|
-
* yield* Console.log(`Last message: ${lastText}`);
|
|
36
|
-
* }
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
export const lastMessageText: Sink.Sink<string | undefined, StreamTextPart> =
|
|
40
|
-
Sink.reduce(
|
|
41
|
-
() => ({
|
|
42
|
-
currentId: undefined as string | undefined,
|
|
43
|
-
text: "",
|
|
44
|
-
lastComplete: undefined as string | undefined,
|
|
45
|
-
}),
|
|
46
|
-
(acc, part: StreamTextPart) => {
|
|
47
|
-
if (part.type === "text-start") {
|
|
48
|
-
return { currentId: part.id, text: "", lastComplete: acc.lastComplete };
|
|
49
|
-
}
|
|
50
|
-
if (part.type === "text-delta" && acc.currentId === part.id) {
|
|
51
|
-
return { ...acc, text: acc.text + part.text };
|
|
52
|
-
}
|
|
53
|
-
if (part.type === "text-end" && acc.currentId === part.id) {
|
|
54
|
-
return { ...acc, lastComplete: acc.text };
|
|
55
|
-
}
|
|
56
|
-
return acc;
|
|
57
|
-
},
|
|
58
|
-
).pipe(Sink.map((acc) => acc.lastComplete));
|