alchemy 2.0.0-beta.62 → 2.0.0-beta.63
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/README.md +12 -12
- package/bin/exec.js +1959 -70
- package/bin/exec.js.map +1 -1
- package/lib/AWS/AuthProvider.js +1 -1
- package/lib/AWS/AuthProvider.js.map +1 -1
- package/lib/AWS/EC2/hosted.d.ts.map +1 -1
- package/lib/AWS/EC2/hosted.js +2 -1
- package/lib/AWS/EC2/hosted.js.map +1 -1
- package/lib/AWS/ECS/Task.d.ts.map +1 -1
- package/lib/AWS/ECS/Task.js +2 -1
- package/lib/AWS/ECS/Task.js.map +1 -1
- package/lib/AWS/Lambda/Function.d.ts.map +1 -1
- package/lib/AWS/Lambda/Function.js +13 -40
- package/lib/AWS/Lambda/Function.js.map +1 -1
- package/lib/AWS/Lambda/MicrovmRuntimeContext.d.ts.map +1 -1
- package/lib/AWS/Lambda/MicrovmRuntimeContext.js +9 -21
- package/lib/AWS/Lambda/MicrovmRuntimeContext.js.map +1 -1
- package/lib/Action.d.ts +8 -0
- package/lib/Action.d.ts.map +1 -1
- package/lib/Action.js +16 -5
- package/lib/Action.js.map +1 -1
- package/lib/ActionRuntimeContext.d.ts +14 -0
- package/lib/ActionRuntimeContext.d.ts.map +1 -0
- package/lib/ActionRuntimeContext.js +56 -0
- package/lib/ActionRuntimeContext.js.map +1 -0
- package/lib/Apply.d.ts.map +1 -1
- package/lib/Apply.js +40 -6
- package/lib/Apply.js.map +1 -1
- package/lib/Auth/AuthProvider.d.ts +3 -3
- package/lib/Auth/AuthProvider.d.ts.map +1 -1
- package/lib/Auth/AuthProvider.js +1 -1
- package/lib/Auth/AuthProvider.js.map +1 -1
- package/lib/Auth/Lock.d.ts.map +1 -1
- package/lib/Auth/Lock.js +5 -2
- package/lib/Auth/Lock.js.map +1 -1
- package/lib/Bundle/PurePlugin.d.ts.map +1 -1
- package/lib/Bundle/PurePlugin.js +26 -1
- package/lib/Bundle/PurePlugin.js.map +1 -1
- package/lib/Bundle/Vite.d.ts +2 -0
- package/lib/Bundle/Vite.d.ts.map +1 -1
- package/lib/Bundle/Vite.js +24 -1
- package/lib/Bundle/Vite.js.map +1 -1
- package/lib/Cli/LoggingCli.d.ts.map +1 -1
- package/lib/Cli/LoggingCli.js +7 -4
- package/lib/Cli/LoggingCli.js.map +1 -1
- package/lib/Cli/commands/_shared.d.ts +19 -0
- package/lib/Cli/commands/_shared.d.ts.map +1 -1
- package/lib/Cli/commands/_shared.js +22 -0
- package/lib/Cli/commands/_shared.js.map +1 -1
- package/lib/Cli/commands/login.d.ts +7 -3
- package/lib/Cli/commands/login.d.ts.map +1 -1
- package/lib/Cli/commands/login.js +70 -12
- package/lib/Cli/commands/login.js.map +1 -1
- package/lib/Cli/commands/profile.d.ts.map +1 -1
- package/lib/Cli/commands/profile.js +7 -20
- package/lib/Cli/commands/profile.js.map +1 -1
- package/lib/Cloudflare/AI/LanguageModel.js +21 -4
- package/lib/Cloudflare/AI/LanguageModel.js.map +1 -1
- package/lib/Cloudflare/AI/QuerySearchLocal.d.ts +37 -0
- package/lib/Cloudflare/AI/QuerySearchLocal.d.ts.map +1 -0
- package/lib/Cloudflare/AI/QuerySearchLocal.js +53 -0
- package/lib/Cloudflare/AI/QuerySearchLocal.js.map +1 -0
- package/lib/Cloudflare/AI/QuerySearchNamespaceLocal.d.ts +35 -0
- package/lib/Cloudflare/AI/QuerySearchNamespaceLocal.d.ts.map +1 -0
- package/lib/Cloudflare/AI/QuerySearchNamespaceLocal.js +47 -0
- package/lib/Cloudflare/AI/QuerySearchNamespaceLocal.js.map +1 -0
- package/lib/Cloudflare/AI/SearchHttpClient.d.ts +34 -0
- package/lib/Cloudflare/AI/SearchHttpClient.d.ts.map +1 -0
- package/lib/Cloudflare/AI/SearchHttpClient.js +262 -0
- package/lib/Cloudflare/AI/SearchHttpClient.js.map +1 -0
- package/lib/Cloudflare/AI/index.d.ts +2 -0
- package/lib/Cloudflare/AI/index.d.ts.map +1 -1
- package/lib/Cloudflare/AI/index.js +2 -0
- package/lib/Cloudflare/AI/index.js.map +1 -1
- package/lib/Cloudflare/Auth/AuthProvider.js +1 -1
- package/lib/Cloudflare/Auth/AuthProvider.js.map +1 -1
- package/lib/Cloudflare/Containers/ContainerBundle.d.ts.map +1 -1
- package/lib/Cloudflare/Containers/ContainerBundle.js +11 -1
- package/lib/Cloudflare/Containers/ContainerBundle.js.map +1 -1
- package/lib/Cloudflare/Containers/ContainerPlatform.d.ts.map +1 -1
- package/lib/Cloudflare/Containers/ContainerPlatform.js +12 -33
- package/lib/Cloudflare/Containers/ContainerPlatform.js.map +1 -1
- package/lib/Cloudflare/D1/QueryDatabaseHttpClient.d.ts +24 -0
- package/lib/Cloudflare/D1/QueryDatabaseHttpClient.d.ts.map +1 -0
- package/lib/Cloudflare/D1/QueryDatabaseHttpClient.js +106 -0
- package/lib/Cloudflare/D1/QueryDatabaseHttpClient.js.map +1 -0
- package/lib/Cloudflare/D1/QueryDatabaseLocal.d.ts +38 -0
- package/lib/Cloudflare/D1/QueryDatabaseLocal.d.ts.map +1 -0
- package/lib/Cloudflare/D1/QueryDatabaseLocal.js +54 -0
- package/lib/Cloudflare/D1/QueryDatabaseLocal.js.map +1 -0
- package/lib/Cloudflare/D1/index.d.ts +1 -0
- package/lib/Cloudflare/D1/index.d.ts.map +1 -1
- package/lib/Cloudflare/D1/index.js +1 -0
- package/lib/Cloudflare/D1/index.js.map +1 -1
- package/lib/Cloudflare/DNS/DnsHttp.d.ts +16 -1
- package/lib/Cloudflare/DNS/DnsHttp.d.ts.map +1 -1
- package/lib/Cloudflare/DNS/DnsHttp.js +6 -1
- package/lib/Cloudflare/DNS/DnsHttp.js.map +1 -1
- package/lib/Cloudflare/DNS/DnsLocal.d.ts +22 -0
- package/lib/Cloudflare/DNS/DnsLocal.d.ts.map +1 -0
- package/lib/Cloudflare/DNS/DnsLocal.js +31 -0
- package/lib/Cloudflare/DNS/DnsLocal.js.map +1 -0
- package/lib/Cloudflare/DNS/ReadDnsHttp.d.ts +3 -3
- package/lib/Cloudflare/DNS/ReadDnsHttp.d.ts.map +1 -1
- package/lib/Cloudflare/DNS/ReadDnsHttp.js +3 -4
- package/lib/Cloudflare/DNS/ReadDnsHttp.js.map +1 -1
- package/lib/Cloudflare/DNS/ReadDnsLocal.d.ts +32 -0
- package/lib/Cloudflare/DNS/ReadDnsLocal.d.ts.map +1 -0
- package/lib/Cloudflare/DNS/ReadDnsLocal.js +35 -0
- package/lib/Cloudflare/DNS/ReadDnsLocal.js.map +1 -0
- package/lib/Cloudflare/DNS/ReadWriteDnsHttp.d.ts +3 -3
- package/lib/Cloudflare/DNS/ReadWriteDnsHttp.d.ts.map +1 -1
- package/lib/Cloudflare/DNS/ReadWriteDnsHttp.js +4 -4
- package/lib/Cloudflare/DNS/ReadWriteDnsHttp.js.map +1 -1
- package/lib/Cloudflare/DNS/ReadWriteDnsLocal.d.ts +40 -0
- package/lib/Cloudflare/DNS/ReadWriteDnsLocal.d.ts.map +1 -0
- package/lib/Cloudflare/DNS/ReadWriteDnsLocal.js +43 -0
- package/lib/Cloudflare/DNS/ReadWriteDnsLocal.js.map +1 -0
- package/lib/Cloudflare/DNS/WriteDnsHttp.d.ts +3 -3
- package/lib/Cloudflare/DNS/WriteDnsHttp.d.ts.map +1 -1
- package/lib/Cloudflare/DNS/WriteDnsHttp.js +3 -4
- package/lib/Cloudflare/DNS/WriteDnsHttp.js.map +1 -1
- package/lib/Cloudflare/DNS/WriteDnsLocal.d.ts +38 -0
- package/lib/Cloudflare/DNS/WriteDnsLocal.d.ts.map +1 -0
- package/lib/Cloudflare/DNS/WriteDnsLocal.js +41 -0
- package/lib/Cloudflare/DNS/WriteDnsLocal.js.map +1 -0
- package/lib/Cloudflare/DNS/index.d.ts +3 -0
- package/lib/Cloudflare/DNS/index.d.ts.map +1 -1
- package/lib/Cloudflare/DNS/index.js +3 -0
- package/lib/Cloudflare/DNS/index.js.map +1 -1
- package/lib/Cloudflare/Flagship/ReadFlagsHttpClient.d.ts +27 -0
- package/lib/Cloudflare/Flagship/ReadFlagsHttpClient.d.ts.map +1 -0
- package/lib/Cloudflare/Flagship/ReadFlagsHttpClient.js +86 -0
- package/lib/Cloudflare/Flagship/ReadFlagsHttpClient.js.map +1 -0
- package/lib/Cloudflare/Flagship/ReadFlagsLocal.d.ts +41 -0
- package/lib/Cloudflare/Flagship/ReadFlagsLocal.d.ts.map +1 -0
- package/lib/Cloudflare/Flagship/ReadFlagsLocal.js +57 -0
- package/lib/Cloudflare/Flagship/ReadFlagsLocal.js.map +1 -0
- package/lib/Cloudflare/Flagship/index.d.ts +1 -0
- package/lib/Cloudflare/Flagship/index.d.ts.map +1 -1
- package/lib/Cloudflare/Flagship/index.js +1 -0
- package/lib/Cloudflare/Flagship/index.js.map +1 -1
- package/lib/Cloudflare/KV/NamespaceHttp.d.ts +16 -1
- package/lib/Cloudflare/KV/NamespaceHttp.d.ts.map +1 -1
- package/lib/Cloudflare/KV/NamespaceHttp.js +8 -2
- package/lib/Cloudflare/KV/NamespaceHttp.js.map +1 -1
- package/lib/Cloudflare/KV/NamespaceLocal.d.ts +22 -0
- package/lib/Cloudflare/KV/NamespaceLocal.d.ts.map +1 -0
- package/lib/Cloudflare/KV/NamespaceLocal.js +32 -0
- package/lib/Cloudflare/KV/NamespaceLocal.js.map +1 -0
- package/lib/Cloudflare/KV/ReadNamespaceHttp.d.ts +2 -2
- package/lib/Cloudflare/KV/ReadNamespaceHttp.d.ts.map +1 -1
- package/lib/Cloudflare/KV/ReadNamespaceHttp.js +5 -6
- package/lib/Cloudflare/KV/ReadNamespaceHttp.js.map +1 -1
- package/lib/Cloudflare/KV/ReadNamespaceLocal.d.ts +27 -0
- package/lib/Cloudflare/KV/ReadNamespaceLocal.d.ts.map +1 -0
- package/lib/Cloudflare/KV/ReadNamespaceLocal.js +30 -0
- package/lib/Cloudflare/KV/ReadNamespaceLocal.js.map +1 -0
- package/lib/Cloudflare/KV/ReadWriteNamespaceHttp.d.ts +3 -3
- package/lib/Cloudflare/KV/ReadWriteNamespaceHttp.d.ts.map +1 -1
- package/lib/Cloudflare/KV/ReadWriteNamespaceHttp.js +6 -6
- package/lib/Cloudflare/KV/ReadWriteNamespaceHttp.js.map +1 -1
- package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.d.ts +34 -0
- package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.d.ts.map +1 -0
- package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.js +37 -0
- package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.js.map +1 -0
- package/lib/Cloudflare/KV/WriteNamespaceHttp.d.ts +2 -2
- package/lib/Cloudflare/KV/WriteNamespaceHttp.d.ts.map +1 -1
- package/lib/Cloudflare/KV/WriteNamespaceHttp.js +5 -6
- package/lib/Cloudflare/KV/WriteNamespaceHttp.js.map +1 -1
- package/lib/Cloudflare/KV/WriteNamespaceLocal.d.ts +27 -0
- package/lib/Cloudflare/KV/WriteNamespaceLocal.d.ts.map +1 -0
- package/lib/Cloudflare/KV/WriteNamespaceLocal.js +30 -0
- package/lib/Cloudflare/KV/WriteNamespaceLocal.js.map +1 -0
- package/lib/Cloudflare/KV/index.d.ts +3 -0
- package/lib/Cloudflare/KV/index.d.ts.map +1 -1
- package/lib/Cloudflare/KV/index.js +3 -0
- package/lib/Cloudflare/KV/index.js.map +1 -1
- package/lib/Cloudflare/Queues/QueueHttp.d.ts +20 -1
- package/lib/Cloudflare/Queues/QueueHttp.d.ts.map +1 -1
- package/lib/Cloudflare/Queues/QueueHttp.js +2 -2
- package/lib/Cloudflare/Queues/QueueHttp.js.map +1 -1
- package/lib/Cloudflare/Queues/WriteQueueHttp.d.ts +9 -3
- package/lib/Cloudflare/Queues/WriteQueueHttp.d.ts.map +1 -1
- package/lib/Cloudflare/Queues/WriteQueueHttp.js +11 -6
- package/lib/Cloudflare/Queues/WriteQueueHttp.js.map +1 -1
- package/lib/Cloudflare/Queues/WriteQueueLocal.d.ts +36 -0
- package/lib/Cloudflare/Queues/WriteQueueLocal.d.ts.map +1 -0
- package/lib/Cloudflare/Queues/WriteQueueLocal.js +51 -0
- package/lib/Cloudflare/Queues/WriteQueueLocal.js.map +1 -0
- package/lib/Cloudflare/Queues/index.d.ts +1 -0
- package/lib/Cloudflare/Queues/index.d.ts.map +1 -1
- package/lib/Cloudflare/Queues/index.js +1 -0
- package/lib/Cloudflare/Queues/index.js.map +1 -1
- package/lib/Cloudflare/R2/BucketHttp.d.ts +15 -1
- package/lib/Cloudflare/R2/BucketHttp.d.ts.map +1 -1
- package/lib/Cloudflare/R2/BucketHttp.js +3 -3
- package/lib/Cloudflare/R2/BucketHttp.js.map +1 -1
- package/lib/Cloudflare/R2/BucketLocal.d.ts +21 -0
- package/lib/Cloudflare/R2/BucketLocal.d.ts.map +1 -0
- package/lib/Cloudflare/R2/BucketLocal.js +32 -0
- package/lib/Cloudflare/R2/BucketLocal.js.map +1 -0
- package/lib/Cloudflare/R2/ReadBucketHttp.d.ts +2 -2
- package/lib/Cloudflare/R2/ReadBucketHttp.d.ts.map +1 -1
- package/lib/Cloudflare/R2/ReadBucketHttp.js +4 -4
- package/lib/Cloudflare/R2/ReadBucketHttp.js.map +1 -1
- package/lib/Cloudflare/R2/ReadBucketLocal.d.ts +27 -0
- package/lib/Cloudflare/R2/ReadBucketLocal.d.ts.map +1 -0
- package/lib/Cloudflare/R2/ReadBucketLocal.js +30 -0
- package/lib/Cloudflare/R2/ReadBucketLocal.js.map +1 -0
- package/lib/Cloudflare/R2/ReadWriteBucketHttp.d.ts +2 -2
- package/lib/Cloudflare/R2/ReadWriteBucketHttp.d.ts.map +1 -1
- package/lib/Cloudflare/R2/ReadWriteBucketHttp.js +5 -4
- package/lib/Cloudflare/R2/ReadWriteBucketHttp.js.map +1 -1
- package/lib/Cloudflare/R2/ReadWriteBucketLocal.d.ts +30 -0
- package/lib/Cloudflare/R2/ReadWriteBucketLocal.d.ts.map +1 -0
- package/lib/Cloudflare/R2/ReadWriteBucketLocal.js +33 -0
- package/lib/Cloudflare/R2/ReadWriteBucketLocal.js.map +1 -0
- package/lib/Cloudflare/R2/WriteBucketHttp.d.ts +2 -2
- package/lib/Cloudflare/R2/WriteBucketHttp.d.ts.map +1 -1
- package/lib/Cloudflare/R2/WriteBucketHttp.js +4 -4
- package/lib/Cloudflare/R2/WriteBucketHttp.js.map +1 -1
- package/lib/Cloudflare/R2/WriteBucketLocal.d.ts +27 -0
- package/lib/Cloudflare/R2/WriteBucketLocal.d.ts.map +1 -0
- package/lib/Cloudflare/R2/WriteBucketLocal.js +30 -0
- package/lib/Cloudflare/R2/WriteBucketLocal.js.map +1 -0
- package/lib/Cloudflare/R2/index.d.ts +3 -0
- package/lib/Cloudflare/R2/index.d.ts.map +1 -1
- package/lib/Cloudflare/R2/index.js +3 -0
- package/lib/Cloudflare/R2/index.js.map +1 -1
- package/lib/Cloudflare/StateStore/Api.d.ts +2 -0
- package/lib/Cloudflare/Tunnel/ReadTunnel.d.ts +3 -3
- package/lib/Cloudflare/Tunnel/ReadTunnel.d.ts.map +1 -1
- package/lib/Cloudflare/Tunnel/ReadTunnel.js +7 -8
- package/lib/Cloudflare/Tunnel/ReadTunnel.js.map +1 -1
- package/lib/Cloudflare/Tunnel/ReadTunnelLocal.d.ts +29 -0
- package/lib/Cloudflare/Tunnel/ReadTunnelLocal.d.ts.map +1 -0
- package/lib/Cloudflare/Tunnel/ReadTunnelLocal.js +30 -0
- package/lib/Cloudflare/Tunnel/ReadTunnelLocal.js.map +1 -0
- package/lib/Cloudflare/Tunnel/ReadWriteTunnel.d.ts +3 -3
- package/lib/Cloudflare/Tunnel/ReadWriteTunnel.d.ts.map +1 -1
- package/lib/Cloudflare/Tunnel/ReadWriteTunnel.js +4 -4
- package/lib/Cloudflare/Tunnel/ReadWriteTunnel.js.map +1 -1
- package/lib/Cloudflare/Tunnel/ReadWriteTunnelLocal.d.ts +35 -0
- package/lib/Cloudflare/Tunnel/ReadWriteTunnelLocal.d.ts.map +1 -0
- package/lib/Cloudflare/Tunnel/ReadWriteTunnelLocal.js +36 -0
- package/lib/Cloudflare/Tunnel/ReadWriteTunnelLocal.js.map +1 -0
- package/lib/Cloudflare/Tunnel/TunnelBinding.d.ts +17 -1
- package/lib/Cloudflare/Tunnel/TunnelBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Tunnel/TunnelBinding.js +7 -1
- package/lib/Cloudflare/Tunnel/TunnelBinding.js.map +1 -1
- package/lib/Cloudflare/Tunnel/TunnelLocalBinding.d.ts +19 -0
- package/lib/Cloudflare/Tunnel/TunnelLocalBinding.d.ts.map +1 -0
- package/lib/Cloudflare/Tunnel/TunnelLocalBinding.js +29 -0
- package/lib/Cloudflare/Tunnel/TunnelLocalBinding.js.map +1 -0
- package/lib/Cloudflare/Tunnel/WarpConnector.d.ts +3 -3
- package/lib/Cloudflare/Tunnel/WarpConnector.d.ts.map +1 -1
- package/lib/Cloudflare/Tunnel/WarpConnector.js +7 -4
- package/lib/Cloudflare/Tunnel/WarpConnector.js.map +1 -1
- package/lib/Cloudflare/Tunnel/WriteTunnel.d.ts +3 -3
- package/lib/Cloudflare/Tunnel/WriteTunnel.d.ts.map +1 -1
- package/lib/Cloudflare/Tunnel/WriteTunnel.js +7 -8
- package/lib/Cloudflare/Tunnel/WriteTunnel.js.map +1 -1
- package/lib/Cloudflare/Tunnel/WriteTunnelLocal.d.ts +29 -0
- package/lib/Cloudflare/Tunnel/WriteTunnelLocal.d.ts.map +1 -0
- package/lib/Cloudflare/Tunnel/WriteTunnelLocal.js +30 -0
- package/lib/Cloudflare/Tunnel/WriteTunnelLocal.js.map +1 -0
- package/lib/Cloudflare/Tunnel/index.d.ts +3 -0
- package/lib/Cloudflare/Tunnel/index.d.ts.map +1 -1
- package/lib/Cloudflare/Tunnel/index.js +3 -0
- package/lib/Cloudflare/Tunnel/index.js.map +1 -1
- package/lib/Cloudflare/Vectorize/SearchIndexHttpClient.d.ts +30 -0
- package/lib/Cloudflare/Vectorize/SearchIndexHttpClient.d.ts.map +1 -0
- package/lib/Cloudflare/Vectorize/SearchIndexHttpClient.js +100 -0
- package/lib/Cloudflare/Vectorize/SearchIndexHttpClient.js.map +1 -0
- package/lib/Cloudflare/Vectorize/SearchIndexLocal.d.ts +42 -0
- package/lib/Cloudflare/Vectorize/SearchIndexLocal.d.ts.map +1 -0
- package/lib/Cloudflare/Vectorize/SearchIndexLocal.js +58 -0
- package/lib/Cloudflare/Vectorize/SearchIndexLocal.js.map +1 -0
- package/lib/Cloudflare/Vectorize/index.d.ts +1 -0
- package/lib/Cloudflare/Vectorize/index.d.ts.map +1 -1
- package/lib/Cloudflare/Vectorize/index.js +1 -0
- package/lib/Cloudflare/Vectorize/index.js.map +1 -1
- package/lib/Cloudflare/Workers/BrowserHttpClient.d.ts +32 -0
- package/lib/Cloudflare/Workers/BrowserHttpClient.d.ts.map +1 -0
- package/lib/Cloudflare/Workers/BrowserHttpClient.js +100 -0
- package/lib/Cloudflare/Workers/BrowserHttpClient.js.map +1 -0
- package/lib/Cloudflare/Workers/BrowserLocal.d.ts +37 -0
- package/lib/Cloudflare/Workers/BrowserLocal.d.ts.map +1 -0
- package/lib/Cloudflare/Workers/BrowserLocal.js +53 -0
- package/lib/Cloudflare/Workers/BrowserLocal.js.map +1 -0
- package/lib/Cloudflare/Workers/ConfigProvider.d.ts +8 -0
- package/lib/Cloudflare/Workers/ConfigProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/ConfigProvider.js +10 -1
- package/lib/Cloudflare/Workers/ConfigProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObject.d.ts +137 -3
- package/lib/Cloudflare/Workers/DurableObject.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObject.js +141 -6
- package/lib/Cloudflare/Workers/DurableObject.js.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts +2 -185
- package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Vite.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Vite.js +81 -2
- package/lib/Cloudflare/Workers/Vite.js.map +1 -1
- package/lib/Cloudflare/Workers/Worker.d.ts +15 -1
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.js +2 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBinding.d.ts +22 -1
- package/lib/Cloudflare/Workers/WorkerBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBinding.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBridge.js +7 -2
- package/lib/Cloudflare/Workers/WorkerBridge.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerProvider.d.ts +81 -0
- package/lib/Cloudflare/Workers/WorkerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerProvider.js +450 -61
- package/lib/Cloudflare/Workers/WorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerRuntimeContext.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerRuntimeContext.js +11 -37
- package/lib/Cloudflare/Workers/WorkerRuntimeContext.js.map +1 -1
- package/lib/Cloudflare/Workers/index.d.ts +1 -0
- package/lib/Cloudflare/Workers/index.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/index.js +1 -0
- package/lib/Cloudflare/Workers/index.js.map +1 -1
- package/lib/Diff.d.ts +16 -0
- package/lib/Diff.d.ts.map +1 -1
- package/lib/Diff.js +33 -0
- package/lib/Diff.js.map +1 -1
- package/lib/GitHub/Secrets.d.ts +1 -1
- package/lib/GitHub/Secrets.js +1 -1
- package/lib/GitHub/Variables.d.ts +1 -1
- package/lib/GitHub/Variables.js +1 -1
- package/lib/Local/RpcSerialization.d.ts.map +1 -1
- package/lib/Local/RpcSerialization.js +6 -2
- package/lib/Local/RpcSerialization.js.map +1 -1
- package/lib/Local/RpcSpawner.d.ts.map +1 -1
- package/lib/Local/RpcSpawner.js +14 -8
- package/lib/Local/RpcSpawner.js.map +1 -1
- package/lib/Neon/AuthProvider.js +1 -1
- package/lib/Neon/AuthProvider.js.map +1 -1
- package/lib/Plan.d.ts.map +1 -1
- package/lib/Plan.js +11 -4
- package/lib/Plan.js.map +1 -1
- package/lib/Planetscale/Database.d.ts +2 -1
- package/lib/Planetscale/Database.d.ts.map +1 -1
- package/lib/Planetscale/MySQL/MySQLClusterSize.d.ts +41 -3
- package/lib/Planetscale/MySQL/MySQLClusterSize.d.ts.map +1 -1
- package/lib/Planetscale/MySQL/MySQLClusterSize.js +88 -11
- package/lib/Planetscale/MySQL/MySQLClusterSize.js.map +1 -1
- package/lib/Planetscale/MySQL/MySQLDatabase.d.ts +14 -0
- package/lib/Planetscale/MySQL/MySQLDatabase.d.ts.map +1 -1
- package/lib/Planetscale/MySQL/MySQLDatabase.js +24 -11
- package/lib/Planetscale/MySQL/MySQLDatabase.js.map +1 -1
- package/lib/Platform.d.ts.map +1 -1
- package/lib/Platform.js +11 -1
- package/lib/Platform.js.map +1 -1
- package/lib/Runtime.d.ts +23 -0
- package/lib/Runtime.d.ts.map +1 -1
- package/lib/Runtime.js +83 -0
- package/lib/Runtime.js.map +1 -1
- package/lib/RuntimeContext.d.ts +46 -0
- package/lib/RuntimeContext.d.ts.map +1 -1
- package/lib/RuntimeContext.js +60 -0
- package/lib/RuntimeContext.js.map +1 -1
- package/lib/Server/Process.d.ts +1 -1
- package/lib/Server/Process.d.ts.map +1 -1
- package/lib/Server/Process.js +8 -8
- package/lib/Server/Process.js.map +1 -1
- package/lib/Stack.js +1 -1
- package/lib/Stack.js.map +1 -1
- package/lib/State/HttpStateApi.d.ts +10 -10
- package/lib/Test/Alchemy.d.ts +74 -0
- package/lib/Test/Alchemy.d.ts.map +1 -0
- package/lib/Test/Alchemy.js +143 -0
- package/lib/Test/Alchemy.js.map +1 -0
- package/lib/Util/cached-function.d.ts +1 -1
- package/lib/Util/cached-function.d.ts.map +1 -1
- package/lib/Util/cached-function.js +2 -2
- package/lib/Util/cached-function.js.map +1 -1
- package/lib/Util/proxy-chain.js +3 -0
- package/lib/Util/proxy-chain.js.map +1 -1
- package/package.json +10 -10
- package/src/AWS/AuthProvider.ts +1 -1
- package/src/AWS/EC2/hosted.ts +2 -1
- package/src/AWS/ECS/Task.ts +2 -1
- package/src/AWS/Lambda/Function.ts +13 -47
- package/src/AWS/Lambda/MicrovmRuntimeContext.ts +11 -38
- package/src/Action.ts +39 -6
- package/src/ActionRuntimeContext.ts +68 -0
- package/src/Apply.ts +46 -8
- package/src/Auth/AuthProvider.ts +1 -1
- package/src/Auth/Lock.ts +5 -2
- package/src/Bundle/PurePlugin.ts +34 -1
- package/src/Bundle/Vite.ts +51 -1
- package/src/Cli/LoggingCli.ts +7 -4
- package/src/Cli/commands/_shared.ts +52 -0
- package/src/Cli/commands/login.ts +90 -14
- package/src/Cli/commands/profile.ts +7 -41
- package/src/Cloudflare/AI/LanguageModel.ts +25 -5
- package/src/Cloudflare/AI/QuerySearchLocal.ts +66 -0
- package/src/Cloudflare/AI/QuerySearchNamespaceLocal.ts +60 -0
- package/src/Cloudflare/AI/SearchHttpClient.ts +423 -0
- package/src/Cloudflare/AI/index.ts +2 -0
- package/src/Cloudflare/Auth/AuthProvider.ts +1 -1
- package/src/Cloudflare/Containers/ContainerBundle.ts +11 -1
- package/src/Cloudflare/Containers/ContainerPlatform.ts +14 -52
- package/src/Cloudflare/D1/QueryDatabaseHttpClient.ts +176 -0
- package/src/Cloudflare/D1/QueryDatabaseLocal.ts +66 -0
- package/src/Cloudflare/D1/index.ts +1 -0
- package/src/Cloudflare/DNS/DnsHttp.ts +24 -2
- package/src/Cloudflare/DNS/DnsLocal.ts +41 -0
- package/src/Cloudflare/DNS/ReadDnsHttp.ts +4 -5
- package/src/Cloudflare/DNS/ReadDnsLocal.ts +38 -0
- package/src/Cloudflare/DNS/ReadWriteDnsHttp.ts +5 -5
- package/src/Cloudflare/DNS/ReadWriteDnsLocal.ts +46 -0
- package/src/Cloudflare/DNS/WriteDnsHttp.ts +4 -5
- package/src/Cloudflare/DNS/WriteDnsLocal.ts +44 -0
- package/src/Cloudflare/DNS/index.ts +3 -0
- package/src/Cloudflare/Flagship/ReadFlagsHttpClient.ts +183 -0
- package/src/Cloudflare/Flagship/ReadFlagsLocal.ts +69 -0
- package/src/Cloudflare/Flagship/index.ts +1 -0
- package/src/Cloudflare/KV/NamespaceHttp.ts +25 -2
- package/src/Cloudflare/KV/NamespaceLocal.ts +42 -0
- package/src/Cloudflare/KV/ReadNamespaceHttp.ts +7 -6
- package/src/Cloudflare/KV/ReadNamespaceLocal.ts +35 -0
- package/src/Cloudflare/KV/ReadWriteNamespaceHttp.ts +11 -6
- package/src/Cloudflare/KV/ReadWriteNamespaceLocal.ts +42 -0
- package/src/Cloudflare/KV/WriteNamespaceHttp.ts +7 -6
- package/src/Cloudflare/KV/WriteNamespaceLocal.ts +35 -0
- package/src/Cloudflare/KV/index.ts +3 -0
- package/src/Cloudflare/Queues/QueueHttp.ts +24 -2
- package/src/Cloudflare/Queues/WriteQueueHttp.ts +16 -7
- package/src/Cloudflare/Queues/WriteQueueLocal.ts +64 -0
- package/src/Cloudflare/Queues/index.ts +1 -0
- package/src/Cloudflare/R2/BucketHttp.ts +20 -3
- package/src/Cloudflare/R2/BucketLocal.ts +47 -0
- package/src/Cloudflare/R2/ReadBucketHttp.ts +10 -5
- package/src/Cloudflare/R2/ReadBucketLocal.ts +33 -0
- package/src/Cloudflare/R2/ReadWriteBucketHttp.ts +11 -5
- package/src/Cloudflare/R2/ReadWriteBucketLocal.ts +36 -0
- package/src/Cloudflare/R2/WriteBucketHttp.ts +10 -5
- package/src/Cloudflare/R2/WriteBucketLocal.ts +33 -0
- package/src/Cloudflare/R2/index.ts +3 -0
- package/src/Cloudflare/Tunnel/ReadTunnel.ts +8 -9
- package/src/Cloudflare/Tunnel/ReadTunnelLocal.ts +33 -0
- package/src/Cloudflare/Tunnel/ReadWriteTunnel.ts +5 -5
- package/src/Cloudflare/Tunnel/ReadWriteTunnelLocal.ts +39 -0
- package/src/Cloudflare/Tunnel/TunnelBinding.ts +26 -2
- package/src/Cloudflare/Tunnel/TunnelLocalBinding.ts +38 -0
- package/src/Cloudflare/Tunnel/WarpConnector.ts +8 -5
- package/src/Cloudflare/Tunnel/WriteTunnel.ts +8 -9
- package/src/Cloudflare/Tunnel/WriteTunnelLocal.ts +33 -0
- package/src/Cloudflare/Tunnel/index.ts +3 -0
- package/src/Cloudflare/Vectorize/SearchIndexHttpClient.ts +183 -0
- package/src/Cloudflare/Vectorize/SearchIndexLocal.ts +70 -0
- package/src/Cloudflare/Vectorize/index.ts +1 -0
- package/src/Cloudflare/Workers/BrowserHttpClient.ts +201 -0
- package/src/Cloudflare/Workers/BrowserLocal.ts +65 -0
- package/src/Cloudflare/Workers/ConfigProvider.ts +15 -1
- package/src/Cloudflare/Workers/DurableObject.ts +227 -6
- package/src/Cloudflare/Workers/Vite.ts +93 -11
- package/src/Cloudflare/Workers/Worker.ts +19 -1
- package/src/Cloudflare/Workers/WorkerAsyncBindings.ts +6 -5
- package/src/Cloudflare/Workers/WorkerBinding.ts +20 -1
- package/src/Cloudflare/Workers/WorkerBridge.ts +12 -2
- package/src/Cloudflare/Workers/WorkerProvider.ts +664 -117
- package/src/Cloudflare/Workers/WorkerRuntimeContext.ts +14 -45
- package/src/Cloudflare/Workers/index.ts +1 -0
- package/src/Diff.ts +33 -0
- package/src/GitHub/Secrets.ts +1 -1
- package/src/GitHub/Variables.ts +1 -1
- package/src/Local/RpcSerialization.ts +6 -2
- package/src/Local/RpcSpawner.ts +21 -8
- package/src/Neon/AuthProvider.ts +1 -1
- package/src/Plan.ts +17 -4
- package/src/Planetscale/Database.ts +2 -1
- package/src/Planetscale/MySQL/MySQLClusterSize.ts +120 -21
- package/src/Planetscale/MySQL/MySQLDatabase.ts +84 -44
- package/src/Platform.ts +12 -3
- package/src/Runtime.ts +92 -0
- package/src/RuntimeContext.ts +79 -0
- package/src/Server/Process.ts +11 -18
- package/src/Stack.ts +1 -1
- package/src/Test/Alchemy.ts +282 -0
- package/src/Util/cached-function.ts +5 -5
- package/src/Util/proxy-chain.ts +3 -0
package/src/Bundle/Vite.ts
CHANGED
|
@@ -3,7 +3,9 @@ import * as Cause from "effect/Cause";
|
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import * as FileSystem from "effect/FileSystem";
|
|
5
5
|
import * as Path from "effect/Path";
|
|
6
|
+
import type { PlatformError } from "effect/PlatformError";
|
|
6
7
|
import type * as vite from "vite";
|
|
8
|
+
import { cachedFunction } from "../Util/cached-function.ts";
|
|
7
9
|
import { sha256 } from "../Util/index.ts";
|
|
8
10
|
import {
|
|
9
11
|
BundleError,
|
|
@@ -17,6 +19,7 @@ export interface ViteBuildOutput {
|
|
|
17
19
|
readonly clientDirectory: string | undefined;
|
|
18
20
|
// This is emitted as an Effect instead of a value so we can process it in parallel with reading the client assets.
|
|
19
21
|
readonly serverBundle: Effect.Effect<BundleOutput | undefined, BundleError>;
|
|
22
|
+
readonly externalWorkspaces: Effect.Effect<Set<string>, PlatformError>;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
// `@vitejs/plugin-rsc` writes these modules separately after build completes instead of emitting them as chunks.
|
|
@@ -44,7 +47,42 @@ export const viteBuildOutputPlugin = Effect.fn(function* ({
|
|
|
44
47
|
string,
|
|
45
48
|
Effect.Effect<BundleFile, BundleError>
|
|
46
49
|
>();
|
|
50
|
+
const maybeExternalWorkspaces = new Set<string>();
|
|
47
51
|
|
|
52
|
+
const findUp = yield* cachedFunction(
|
|
53
|
+
(
|
|
54
|
+
dir: string,
|
|
55
|
+
filenames: Array<string>,
|
|
56
|
+
): Effect.Effect<string | undefined, PlatformError> =>
|
|
57
|
+
Effect.filter(
|
|
58
|
+
filenames.map((filename) => path.join(dir, filename)),
|
|
59
|
+
fs.exists,
|
|
60
|
+
{ concurrency: "unbounded" },
|
|
61
|
+
).pipe(
|
|
62
|
+
Effect.flatMap(([match]) => {
|
|
63
|
+
if (match) {
|
|
64
|
+
return Effect.succeed(match);
|
|
65
|
+
}
|
|
66
|
+
const parent = path.dirname(dir);
|
|
67
|
+
if (parent === dir) {
|
|
68
|
+
return Effect.undefined;
|
|
69
|
+
}
|
|
70
|
+
return findUp(parent, filenames);
|
|
71
|
+
}),
|
|
72
|
+
),
|
|
73
|
+
);
|
|
74
|
+
const collectExternalWorkspaces = (): Effect.Effect<
|
|
75
|
+
Set<string>,
|
|
76
|
+
PlatformError
|
|
77
|
+
> =>
|
|
78
|
+
Effect.forEach(maybeExternalWorkspaces, (directory) =>
|
|
79
|
+
findUp(directory, ["package.json"]),
|
|
80
|
+
).pipe(
|
|
81
|
+
Effect.map(
|
|
82
|
+
(paths) =>
|
|
83
|
+
new Set(paths.filter((file) => file !== undefined).map(path.dirname)),
|
|
84
|
+
),
|
|
85
|
+
);
|
|
48
86
|
const plugin: vite.Plugin = {
|
|
49
87
|
name: "alchemy:build-output",
|
|
50
88
|
sharedDuringBuild: true,
|
|
@@ -57,9 +95,20 @@ export const viteBuildOutputPlugin = Effect.fn(function* ({
|
|
|
57
95
|
// `viteBuild` reads `output` *after* `builder.buildApp()` resolves — by
|
|
58
96
|
// which point every environment that actually built has run `writeBundle`.
|
|
59
97
|
async writeBundle(_, bundle) {
|
|
98
|
+
const root = path.resolve(this.environment.config.root);
|
|
99
|
+
for (const id of this.getModuleIds()) {
|
|
100
|
+
if (
|
|
101
|
+
!path.isAbsolute(id) ||
|
|
102
|
+
id.includes("node_modules") ||
|
|
103
|
+
id.startsWith(root)
|
|
104
|
+
) {
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
maybeExternalWorkspaces.add(path.dirname(id));
|
|
108
|
+
}
|
|
60
109
|
if (this.environment.name === "client") {
|
|
61
110
|
clientDirectory = path.resolve(
|
|
62
|
-
|
|
111
|
+
root,
|
|
63
112
|
this.environment.config.build.outDir,
|
|
64
113
|
);
|
|
65
114
|
return;
|
|
@@ -199,6 +248,7 @@ export const viteBuildOutputPlugin = Effect.fn(function* ({
|
|
|
199
248
|
(): ViteBuildOutput => ({
|
|
200
249
|
clientDirectory,
|
|
201
250
|
serverBundle: makeServerBundle(),
|
|
251
|
+
externalWorkspaces: collectExternalWorkspaces(),
|
|
202
252
|
}),
|
|
203
253
|
),
|
|
204
254
|
};
|
package/src/Cli/LoggingCli.ts
CHANGED
|
@@ -113,22 +113,25 @@ export const LoggingCli = Layer.succeed(
|
|
|
113
113
|
|
|
114
114
|
const counts = { ok: 0, fail: 0 };
|
|
115
115
|
return {
|
|
116
|
+
// Write through the Effect Console SERVICE (not the global
|
|
117
|
+
// `console`) so environments that override it — e.g. the
|
|
118
|
+
// alchemy-test runner's per-test buffering console — capture
|
|
119
|
+
// apply progress instead of having it leak to stdout.
|
|
116
120
|
emit: (event: ApplyEvent) =>
|
|
117
|
-
Effect.
|
|
121
|
+
Effect.suspend(() => {
|
|
118
122
|
if (event.kind === "annotate") {
|
|
119
|
-
|
|
120
|
-
return;
|
|
123
|
+
return Console.log(`${tag(event.id)} ${blue(event.message)}`);
|
|
121
124
|
}
|
|
122
125
|
const id = event.bindingId
|
|
123
126
|
? `${event.id}/${event.bindingId}`
|
|
124
127
|
: event.id;
|
|
125
128
|
const status = statusColor(event.status)(event.status);
|
|
126
129
|
const msg = event.message ? ` ${dim("—")} ${event.message}` : "";
|
|
127
|
-
console.log(`${tag(id)} ${status}${msg}`);
|
|
128
130
|
if (isTerminal(event.status)) {
|
|
129
131
|
if (event.status === "fail") counts.fail++;
|
|
130
132
|
else counts.ok++;
|
|
131
133
|
}
|
|
134
|
+
return Console.log(`${tag(id)} ${status}${msg}`);
|
|
132
135
|
}),
|
|
133
136
|
done: () =>
|
|
134
137
|
Console.log(
|
|
@@ -23,6 +23,12 @@ import {
|
|
|
23
23
|
ALCHEMY_PROFILE,
|
|
24
24
|
withProfileOverride,
|
|
25
25
|
} from "../../Auth/Profile.ts";
|
|
26
|
+
import { AwsAuth } from "../../AWS/AuthProvider.ts";
|
|
27
|
+
import { AxiomAuth } from "../../Axiom/AuthProvider.ts";
|
|
28
|
+
import { CloudflareAuth } from "../../Cloudflare/Auth/AuthProvider.ts";
|
|
29
|
+
import { GitHubAuth } from "../../GitHub/AuthProvider.ts";
|
|
30
|
+
import { NeonAuth } from "../../Neon/AuthProvider.ts";
|
|
31
|
+
import { PlanetscaleAuth } from "../../Planetscale/AuthProvider.ts";
|
|
26
32
|
import * as Stack from "../../Stack.ts";
|
|
27
33
|
import { Stage } from "../../Stage.ts";
|
|
28
34
|
import { recordCli } from "../../Telemetry/Metrics.ts";
|
|
@@ -440,3 +446,49 @@ export const buildStackProviders = Effect.fn("buildStackProviders")(function* (
|
|
|
440
446
|
);
|
|
441
447
|
return { authProviders, context, stackEffect };
|
|
442
448
|
});
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* The auth providers Alchemy ships with. Used as the baseline registry so
|
|
452
|
+
* `alchemy login` works from any folder (no `alchemy.run.ts` required) and
|
|
453
|
+
* `alchemy profile show` can pretty-print any provider a profile mentions,
|
|
454
|
+
* even one the current stack doesn't wire up.
|
|
455
|
+
*/
|
|
456
|
+
export const builtinAuth = Layer.mergeAll(
|
|
457
|
+
AwsAuth,
|
|
458
|
+
AxiomAuth,
|
|
459
|
+
CloudflareAuth,
|
|
460
|
+
GitHubAuth,
|
|
461
|
+
NeonAuth,
|
|
462
|
+
PlanetscaleAuth,
|
|
463
|
+
);
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Build {@link builtinAuth} against `registry` so every built-in auth
|
|
467
|
+
* provider registers itself, without importing any stack entrypoint.
|
|
468
|
+
*/
|
|
469
|
+
export const buildBuiltinAuthProviders = Effect.fn("buildBuiltinAuthProviders")(
|
|
470
|
+
function* (options: {
|
|
471
|
+
envFile: Option.Option<string>;
|
|
472
|
+
profile: string;
|
|
473
|
+
/** Registry to populate. Defaults to a fresh empty registry. */
|
|
474
|
+
registry?: AuthProviders["Service"];
|
|
475
|
+
}) {
|
|
476
|
+
const authProviders = options.registry ?? {};
|
|
477
|
+
yield* Layer.build(
|
|
478
|
+
Layer.provide(
|
|
479
|
+
builtinAuth,
|
|
480
|
+
Layer.mergeAll(
|
|
481
|
+
Layer.succeed(AuthProviders, authProviders),
|
|
482
|
+
ConfigProvider.layer(
|
|
483
|
+
withProfileOverride(
|
|
484
|
+
yield* loadConfigProvider(options.envFile),
|
|
485
|
+
options.profile,
|
|
486
|
+
),
|
|
487
|
+
),
|
|
488
|
+
Logger.layer([fileLogger("out")], { mergeWithExisting: true }),
|
|
489
|
+
),
|
|
490
|
+
),
|
|
491
|
+
);
|
|
492
|
+
return authProviders;
|
|
493
|
+
},
|
|
494
|
+
);
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import * as Config from "effect/Config";
|
|
2
2
|
import * as Console from "effect/Console";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as FileSystem from "effect/FileSystem";
|
|
5
|
+
import * as Option from "effect/Option";
|
|
4
6
|
import { Command, Flag } from "effect/unstable/cli";
|
|
7
|
+
import * as Argument from "effect/unstable/cli/Argument";
|
|
8
|
+
import * as CliError from "effect/unstable/cli/CliError";
|
|
5
9
|
|
|
10
|
+
import type { AuthProviders } from "../../Auth/AuthProvider.ts";
|
|
6
11
|
import { AlchemyProfile } from "../../Auth/Profile.ts";
|
|
12
|
+
import * as Clank from "../../Util/Clank.ts";
|
|
7
13
|
|
|
8
14
|
import {
|
|
15
|
+
buildBuiltinAuthProviders,
|
|
9
16
|
buildStackProviders,
|
|
10
17
|
envFile,
|
|
11
18
|
instrumentCommand,
|
|
12
19
|
printProfile,
|
|
13
20
|
profile,
|
|
14
|
-
script,
|
|
15
21
|
} from "./_shared.ts";
|
|
16
22
|
|
|
17
23
|
const loginConfigure = Flag.boolean("configure").pipe(
|
|
@@ -21,39 +27,109 @@ const loginConfigure = Flag.boolean("configure").pipe(
|
|
|
21
27
|
Flag.withDefault(false),
|
|
22
28
|
);
|
|
23
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Stack entrypoint whose `providers()` layer selects which auth providers
|
|
32
|
+
* to log in with. Optional: when omitted and no `alchemy.run.ts` exists in
|
|
33
|
+
* the current folder, `alchemy login` falls back to every built-in auth
|
|
34
|
+
* provider, so logging in (and refreshing credentials) works from any
|
|
35
|
+
* folder.
|
|
36
|
+
*/
|
|
37
|
+
const loginMain = Argument.file("main").pipe(
|
|
38
|
+
Argument.withDescription(
|
|
39
|
+
"Stack entrypoint whose providers() to log in with, defaults to alchemy.run.ts (falls back to all built-in providers when absent)",
|
|
40
|
+
),
|
|
41
|
+
Argument.optional,
|
|
42
|
+
);
|
|
43
|
+
|
|
24
44
|
export const loginCommand = Command.make(
|
|
25
45
|
"login",
|
|
26
46
|
{
|
|
27
|
-
main:
|
|
47
|
+
main: loginMain,
|
|
28
48
|
envFile,
|
|
29
49
|
profile,
|
|
30
50
|
configure: loginConfigure,
|
|
31
51
|
},
|
|
32
52
|
instrumentCommand(
|
|
33
53
|
"login",
|
|
34
|
-
(a: {
|
|
54
|
+
(a: {
|
|
55
|
+
main: Option.Option<string>;
|
|
56
|
+
profile: string;
|
|
57
|
+
configure: boolean;
|
|
58
|
+
}) => ({
|
|
35
59
|
"alchemy.profile": a.profile,
|
|
36
|
-
"alchemy.main": a.main,
|
|
60
|
+
"alchemy.main": Option.getOrElse(a.main, () => "alchemy.run.ts"),
|
|
37
61
|
"alchemy.configure": a.configure,
|
|
38
62
|
}),
|
|
39
63
|
)(
|
|
40
64
|
Effect.fn(function* ({ main, envFile, profile, configure }) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
});
|
|
65
|
+
const fs = yield* FileSystem.FileSystem;
|
|
66
|
+
const explicitMain = Option.getOrUndefined(main);
|
|
67
|
+
const mainPath = explicitMain ?? "alchemy.run.ts";
|
|
68
|
+
const mainExists = yield* fs
|
|
69
|
+
.exists(mainPath)
|
|
70
|
+
.pipe(Effect.catch(() => Effect.succeed(false)));
|
|
48
71
|
|
|
49
|
-
|
|
72
|
+
// An explicitly-passed entrypoint must exist; only the default may
|
|
73
|
+
// fall back to the built-in providers.
|
|
74
|
+
if (explicitMain != null && !mainExists) {
|
|
75
|
+
return yield* Effect.fail(
|
|
76
|
+
new CliError.InvalidValue({
|
|
77
|
+
option: "main",
|
|
78
|
+
value: explicitMain,
|
|
79
|
+
expected: "an existing stack entrypoint file",
|
|
80
|
+
kind: "argument",
|
|
81
|
+
}),
|
|
82
|
+
);
|
|
83
|
+
}
|
|
50
84
|
|
|
85
|
+
const profiles = yield* AlchemyProfile;
|
|
51
86
|
const ci = yield* Config.boolean("CI").pipe(Config.withDefault(false));
|
|
52
|
-
|
|
87
|
+
|
|
88
|
+
let authProviders: AuthProviders["Service"];
|
|
89
|
+
// Providers to actually log in with; `undefined` means all registered.
|
|
90
|
+
let selected: string[] | undefined;
|
|
91
|
+
if (mainExists) {
|
|
92
|
+
// Build the user's providers() (+ state) layer to capture the auth
|
|
93
|
+
// providers their stack wires up.
|
|
94
|
+
({ authProviders } = yield* buildStackProviders({
|
|
95
|
+
main: mainPath,
|
|
96
|
+
envFile,
|
|
97
|
+
profile,
|
|
98
|
+
}));
|
|
99
|
+
} else {
|
|
100
|
+
// No stack entrypoint — register every built-in auth provider so
|
|
101
|
+
// `alchemy login` works from any folder. Interactively, let the
|
|
102
|
+
// user pick which ones to log in with; in CI, take them all.
|
|
103
|
+
yield* Console.log(
|
|
104
|
+
"No alchemy.run.ts found — using Alchemy's built-in providers.",
|
|
105
|
+
);
|
|
106
|
+
authProviders = yield* buildBuiltinAuthProviders({ envFile, profile });
|
|
107
|
+
if (!ci) {
|
|
108
|
+
const existing = yield* profiles.getProfile(profile);
|
|
109
|
+
const names = Object.keys(authProviders).sort();
|
|
110
|
+
selected = yield* Clank.multiselect({
|
|
111
|
+
message: "Select providers to log in with",
|
|
112
|
+
options: names.map((name) => ({
|
|
113
|
+
value: name,
|
|
114
|
+
label: name,
|
|
115
|
+
hint: existing?.[name] != null ? "configured" : undefined,
|
|
116
|
+
})),
|
|
117
|
+
// Pre-select providers already in the profile so re-running
|
|
118
|
+
// login naturally refreshes/re-prints what's set up.
|
|
119
|
+
initialValues: names.filter((name) => existing?.[name] != null),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const providers = Object.values(authProviders).filter(
|
|
125
|
+
(provider) => selected == null || selected.includes(provider.name),
|
|
126
|
+
);
|
|
53
127
|
|
|
54
128
|
if (providers.length === 0) {
|
|
55
129
|
yield* Console.log(
|
|
56
|
-
|
|
130
|
+
selected != null
|
|
131
|
+
? "No providers selected."
|
|
132
|
+
: "No AuthProviders registered. Make sure the stack's providers() layer includes AuthProviderLayer entries.",
|
|
57
133
|
);
|
|
58
134
|
return;
|
|
59
135
|
}
|
|
@@ -1,25 +1,15 @@
|
|
|
1
|
-
import * as ConfigProvider from "effect/ConfigProvider";
|
|
2
1
|
import * as Console from "effect/Console";
|
|
3
2
|
import * as Effect from "effect/Effect";
|
|
4
|
-
import * as Layer from "effect/Layer";
|
|
5
|
-
import * as Logger from "effect/Logger";
|
|
6
3
|
import * as Option from "effect/Option";
|
|
7
4
|
import { Command } from "effect/unstable/cli";
|
|
8
5
|
import * as Argument from "effect/unstable/cli/Argument";
|
|
9
6
|
|
|
10
7
|
import { AuthProviders } from "../../Auth/AuthProvider.ts";
|
|
11
8
|
import { CredentialsStore } from "../../Auth/Credentials.ts";
|
|
12
|
-
import { AlchemyProfile
|
|
13
|
-
import { AwsAuth } from "../../AWS/AuthProvider.ts";
|
|
14
|
-
import { AxiomAuth } from "../../Axiom/AuthProvider.ts";
|
|
15
|
-
import { CloudflareAuth } from "../../Cloudflare/Auth/AuthProvider.ts";
|
|
16
|
-
import { GitHubAuth } from "../../GitHub/AuthProvider.ts";
|
|
17
|
-
import { NeonAuth } from "../../Neon/AuthProvider.ts";
|
|
18
|
-
import { PlanetscaleAuth } from "../../Planetscale/AuthProvider.ts";
|
|
19
|
-
import { loadConfigProvider } from "../../Util/ConfigProvider.ts";
|
|
20
|
-
import { fileLogger } from "../../Util/FileLogger.ts";
|
|
9
|
+
import { AlchemyProfile } from "../../Auth/Profile.ts";
|
|
21
10
|
|
|
22
11
|
import {
|
|
12
|
+
buildBuiltinAuthProviders,
|
|
23
13
|
buildStackProviders,
|
|
24
14
|
envFile,
|
|
25
15
|
instrumentCommand,
|
|
@@ -27,20 +17,6 @@ import {
|
|
|
27
17
|
profile,
|
|
28
18
|
} from "./_shared.ts";
|
|
29
19
|
|
|
30
|
-
/**
|
|
31
|
-
* The auth providers Alchemy ships with. Built into the registry as a
|
|
32
|
-
* baseline so `profile show` can pretty-print any provider a profile
|
|
33
|
-
* mentions, even one the current stack doesn't wire up.
|
|
34
|
-
*/
|
|
35
|
-
const builtinAuth = Layer.mergeAll(
|
|
36
|
-
AwsAuth,
|
|
37
|
-
AxiomAuth,
|
|
38
|
-
CloudflareAuth,
|
|
39
|
-
GitHubAuth,
|
|
40
|
-
NeonAuth,
|
|
41
|
-
PlanetscaleAuth,
|
|
42
|
-
);
|
|
43
|
-
|
|
44
20
|
/**
|
|
45
21
|
* Entrypoint whose `providers()` layer contributes the user's own auth
|
|
46
22
|
* providers. Optional and best-effort — if it's missing or fails to load,
|
|
@@ -73,21 +49,11 @@ export const collectAuthProviders = Effect.fn("collectAuthProviders")(
|
|
|
73
49
|
const authProviders: AuthProviders["Service"] = {};
|
|
74
50
|
|
|
75
51
|
// 1. Built-in providers first (baseline).
|
|
76
|
-
yield*
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
ConfigProvider.layer(
|
|
82
|
-
withProfileOverride(
|
|
83
|
-
yield* loadConfigProvider(options.envFile),
|
|
84
|
-
options.profile,
|
|
85
|
-
),
|
|
86
|
-
),
|
|
87
|
-
Logger.layer([fileLogger("out")], { mergeWithExisting: true }),
|
|
88
|
-
),
|
|
89
|
-
),
|
|
90
|
-
);
|
|
52
|
+
yield* buildBuiltinAuthProviders({
|
|
53
|
+
envFile: options.envFile,
|
|
54
|
+
profile: options.profile,
|
|
55
|
+
registry: authProviders,
|
|
56
|
+
});
|
|
91
57
|
|
|
92
58
|
// 2. The user's own providers() layer on top — building into the same
|
|
93
59
|
// registry overrides the built-ins by name. Best-effort: swallow
|
|
@@ -560,7 +560,7 @@ interface StreamState {
|
|
|
560
560
|
readonly reasoningId: string | undefined;
|
|
561
561
|
readonly toolCalls: ReadonlyMap<
|
|
562
562
|
number,
|
|
563
|
-
{ readonly id: string; readonly name: string }
|
|
563
|
+
{ readonly id: string; readonly name: string; readonly arguments: string }
|
|
564
564
|
>;
|
|
565
565
|
readonly lastToolIndex: number | undefined;
|
|
566
566
|
readonly closedToolIndices: ReadonlySet<number>;
|
|
@@ -699,7 +699,7 @@ const handleToolDeltas = (
|
|
|
699
699
|
s = closeToolCall(s, s.lastToolIndex, parts);
|
|
700
700
|
}
|
|
701
701
|
const id = rawId || (yield* idGen.generateId());
|
|
702
|
-
const entry = { id, name };
|
|
702
|
+
const entry = { id, name, arguments: args };
|
|
703
703
|
const next = new Map(s.toolCalls);
|
|
704
704
|
next.set(idx, entry);
|
|
705
705
|
s = { ...s, toolCalls: next, lastToolIndex: idx };
|
|
@@ -708,12 +708,23 @@ const handleToolDeltas = (
|
|
|
708
708
|
parts.push({ type: "tool-params-delta", id, delta: args });
|
|
709
709
|
}
|
|
710
710
|
} else {
|
|
711
|
-
|
|
712
|
-
|
|
711
|
+
// OpenAI-compatible providers stream argument fragments, while
|
|
712
|
+
// Workers AI can resend the complete accumulated JSON on every
|
|
713
|
+
// chunk. Normalize both shapes to incremental deltas.
|
|
714
|
+
const delta = args.startsWith(existing.arguments)
|
|
715
|
+
? args.slice(existing.arguments.length)
|
|
716
|
+
: args;
|
|
717
|
+
const accumulated = args.startsWith(existing.arguments)
|
|
718
|
+
? args
|
|
719
|
+
: existing.arguments + args;
|
|
720
|
+
const next = new Map(s.toolCalls);
|
|
721
|
+
next.set(idx, { ...existing, arguments: accumulated });
|
|
722
|
+
s = { ...s, toolCalls: next, lastToolIndex: idx };
|
|
723
|
+
if (delta.length > 0) {
|
|
713
724
|
parts.push({
|
|
714
725
|
type: "tool-params-delta",
|
|
715
726
|
id: existing.id,
|
|
716
|
-
delta
|
|
727
|
+
delta,
|
|
717
728
|
});
|
|
718
729
|
}
|
|
719
730
|
}
|
|
@@ -785,6 +796,15 @@ const handleNativeToolCalls = (
|
|
|
785
796
|
parts: StreamParts,
|
|
786
797
|
idGen: IdGenerator.Service,
|
|
787
798
|
): Effect.Effect<StreamState> => {
|
|
799
|
+
const openAiToolCalls = (
|
|
800
|
+
chunk.choices as
|
|
801
|
+
| Array<{ delta?: { tool_calls?: ReadonlyArray<unknown> } }>
|
|
802
|
+
| undefined
|
|
803
|
+
)?.[0]?.delta?.tool_calls;
|
|
804
|
+
// Workers AI can mirror the same fragments in both its top-level native
|
|
805
|
+
// field and the OpenAI-compatible delta. Prefer the latter so every
|
|
806
|
+
// fragment is emitted exactly once.
|
|
807
|
+
if (Array.isArray(openAiToolCalls)) return Effect.succeed(state);
|
|
788
808
|
if (!Array.isArray(chunk.tool_calls)) return Effect.succeed(state);
|
|
789
809
|
return Effect.gen(function* () {
|
|
790
810
|
const s = closeReasoning(state, parts);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Layer from "effect/Layer";
|
|
3
|
+
import type * as HttpClient from "effect/unstable/http/HttpClient";
|
|
4
|
+
import { CloudflareEnvironment } from "../CloudflareEnvironment.ts";
|
|
5
|
+
import type { Credentials } from "../Credentials.ts";
|
|
6
|
+
import { QuerySearch } from "./QuerySearch.ts";
|
|
7
|
+
import { makeLocalSearchClient, type SearchAuth } from "./SearchHttpClient.ts";
|
|
8
|
+
import type { SearchInstance } from "./SearchInstance.ts";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Local implementation of the {@link QuerySearch} binding — queries an AI
|
|
12
|
+
* Search instance over the Cloudflare HTTP API using the **current
|
|
13
|
+
* credentials** instead of a native Worker binding (`QuerySearchBinding`).
|
|
14
|
+
*
|
|
15
|
+
* Provide it on an {@link Action} (or any deploy-time Effect) to run
|
|
16
|
+
* `search` / `chatCompletions` / `info` / `stats` against an instance with the
|
|
17
|
+
* same client you'd use inside a Worker. The instance id and namespace are
|
|
18
|
+
* resolved at apply time through the ambient RuntimeContext, so
|
|
19
|
+
* `QuerySearch(instance)` works even when the instance is created in the same
|
|
20
|
+
* deploy.
|
|
21
|
+
*
|
|
22
|
+
* `raw` (the native `AiSearchInstance` runtime handle) is unavailable outside a
|
|
23
|
+
* deployed Worker and dies if forced.
|
|
24
|
+
*
|
|
25
|
+
* @example Read an instance's status from an Action
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const Probe = Alchemy.Action(
|
|
28
|
+
* "Probe",
|
|
29
|
+
* Effect.gen(function* () {
|
|
30
|
+
* const search = yield* Cloudflare.AI.QuerySearch(instance);
|
|
31
|
+
* return Effect.fn(function* () {
|
|
32
|
+
* const info = yield* search.info();
|
|
33
|
+
* const stats = yield* search.stats();
|
|
34
|
+
* return { status: info.status, indexed: stats.completed };
|
|
35
|
+
* });
|
|
36
|
+
* }).pipe(Effect.provide(Cloudflare.AI.QuerySearchLocal)),
|
|
37
|
+
* );
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export const QuerySearchLocal = Layer.effect(
|
|
41
|
+
QuerySearch,
|
|
42
|
+
Effect.gen(function* () {
|
|
43
|
+
// Account + credentials are ambient during stack-eval (the stack's
|
|
44
|
+
// providers layer). Capture the full context so each HTTP op can be run
|
|
45
|
+
// with the current credentials; no `host.bind`, no minted token.
|
|
46
|
+
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
47
|
+
const context = yield* Effect.context<
|
|
48
|
+
Credentials | HttpClient.HttpClient
|
|
49
|
+
>();
|
|
50
|
+
|
|
51
|
+
const auth: SearchAuth = {
|
|
52
|
+
authorize: (eff) => eff.pipe(Effect.provideContext(context)),
|
|
53
|
+
accountId,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return Effect.fn(function* (instance: SearchInstance) {
|
|
57
|
+
// Deferred accessors — resolved against the tracker at apply time.
|
|
58
|
+
const instanceId = yield* instance.instanceId;
|
|
59
|
+
const namespace = yield* instance.namespace;
|
|
60
|
+
return makeLocalSearchClient(
|
|
61
|
+
auth,
|
|
62
|
+
Effect.all({ id: instanceId, name: namespace }),
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
}),
|
|
66
|
+
);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Layer from "effect/Layer";
|
|
3
|
+
import type * as HttpClient from "effect/unstable/http/HttpClient";
|
|
4
|
+
import { CloudflareEnvironment } from "../CloudflareEnvironment.ts";
|
|
5
|
+
import type { Credentials } from "../Credentials.ts";
|
|
6
|
+
import { QuerySearchNamespace } from "./QuerySearchNamespace.ts";
|
|
7
|
+
import {
|
|
8
|
+
makeLocalSearchNamespaceClient,
|
|
9
|
+
type SearchAuth,
|
|
10
|
+
} from "./SearchHttpClient.ts";
|
|
11
|
+
import type { SearchNamespace } from "./SearchNamespace.ts";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Local implementation of the {@link QuerySearchNamespace} binding — queries an
|
|
15
|
+
* AI Search namespace over the Cloudflare HTTP API using the **current
|
|
16
|
+
* credentials** instead of a native Worker binding
|
|
17
|
+
* (`QuerySearchNamespaceBinding`).
|
|
18
|
+
*
|
|
19
|
+
* Provide it on an {@link Action} (or any deploy-time Effect) to `list`
|
|
20
|
+
* instances, run a multi-instance `search`, or `.get(instanceName)` a
|
|
21
|
+
* single-instance client — the same client you'd use inside a Worker. The
|
|
22
|
+
* namespace name is resolved at apply time through the ambient RuntimeContext.
|
|
23
|
+
*
|
|
24
|
+
* `raw` (the native `AiSearchNamespace` runtime handle) is unavailable outside a
|
|
25
|
+
* deployed Worker and dies if forced.
|
|
26
|
+
*
|
|
27
|
+
* @example List a namespace's instances from an Action
|
|
28
|
+
* ```typescript
|
|
29
|
+
* const Probe = Alchemy.Action(
|
|
30
|
+
* "Probe",
|
|
31
|
+
* Effect.gen(function* () {
|
|
32
|
+
* const ns = yield* Cloudflare.AI.QuerySearchNamespace(namespace);
|
|
33
|
+
* return Effect.fn(function* () {
|
|
34
|
+
* const { result } = yield* ns.list();
|
|
35
|
+
* return result.map((i) => i.id);
|
|
36
|
+
* });
|
|
37
|
+
* }).pipe(Effect.provide(Cloudflare.AI.QuerySearchNamespaceLocal)),
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export const QuerySearchNamespaceLocal = Layer.effect(
|
|
42
|
+
QuerySearchNamespace,
|
|
43
|
+
Effect.gen(function* () {
|
|
44
|
+
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
45
|
+
const context = yield* Effect.context<
|
|
46
|
+
Credentials | HttpClient.HttpClient
|
|
47
|
+
>();
|
|
48
|
+
|
|
49
|
+
const auth: SearchAuth = {
|
|
50
|
+
authorize: (eff) => eff.pipe(Effect.provideContext(context)),
|
|
51
|
+
accountId,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
return Effect.fn(function* (namespace: SearchNamespace) {
|
|
55
|
+
// Deferred accessor — resolved against the tracker at apply time.
|
|
56
|
+
const name = yield* namespace.name;
|
|
57
|
+
return makeLocalSearchNamespaceClient(auth, name);
|
|
58
|
+
});
|
|
59
|
+
}),
|
|
60
|
+
);
|