@alchemy.run/modal 0.0.0 → 2.0.0-beta.86
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/LICENSE +201 -0
- package/README.md +96 -4
- package/lib/App.d.ts +143 -0
- package/lib/App.d.ts.map +1 -0
- package/lib/App.js +198 -0
- package/lib/App.js.map +1 -0
- package/lib/AuthProvider.d.ts +53 -0
- package/lib/AuthProvider.d.ts.map +1 -0
- package/lib/AuthProvider.js +209 -0
- package/lib/AuthProvider.js.map +1 -0
- package/lib/BindingHttp.d.ts +56 -0
- package/lib/BindingHttp.d.ts.map +1 -0
- package/lib/BindingHttp.js +50 -0
- package/lib/BindingHttp.js.map +1 -0
- package/lib/Blob.d.ts +34 -0
- package/lib/Blob.d.ts.map +1 -0
- package/lib/Blob.js +59 -0
- package/lib/Blob.js.map +1 -0
- package/lib/Bootstrap.d.ts +8 -0
- package/lib/Bootstrap.d.ts.map +1 -0
- package/lib/Bootstrap.js +26 -0
- package/lib/Bootstrap.js.map +1 -0
- package/lib/Cbor.d.ts +10 -0
- package/lib/Cbor.d.ts.map +1 -0
- package/lib/Cbor.js +177 -0
- package/lib/Cbor.js.map +1 -0
- package/lib/ConnectSandbox.d.ts +64 -0
- package/lib/ConnectSandbox.d.ts.map +1 -0
- package/lib/ConnectSandbox.js +33 -0
- package/lib/ConnectSandbox.js.map +1 -0
- package/lib/Container.d.ts +124 -0
- package/lib/Container.d.ts.map +1 -0
- package/lib/Container.js +1 -0
- package/lib/Container.js.map +1 -0
- package/lib/Contributions.d.ts +7 -0
- package/lib/Contributions.d.ts.map +1 -0
- package/lib/Contributions.js +6 -0
- package/lib/Contributions.js.map +1 -0
- package/lib/CreateDict.d.ts +83 -0
- package/lib/CreateDict.d.ts.map +1 -0
- package/lib/CreateDict.js +3 -0
- package/lib/CreateDict.js.map +1 -0
- package/lib/CreateDictHttp.d.ts +33 -0
- package/lib/CreateDictHttp.d.ts.map +1 -0
- package/lib/CreateDictHttp.js +67 -0
- package/lib/CreateDictHttp.js.map +1 -0
- package/lib/CreateImage.d.ts +98 -0
- package/lib/CreateImage.d.ts.map +1 -0
- package/lib/CreateImage.js +3 -0
- package/lib/CreateImage.js.map +1 -0
- package/lib/CreateImageHttp.d.ts +51 -0
- package/lib/CreateImageHttp.d.ts.map +1 -0
- package/lib/CreateImageHttp.js +87 -0
- package/lib/CreateImageHttp.js.map +1 -0
- package/lib/CreateQueue.d.ts +83 -0
- package/lib/CreateQueue.d.ts.map +1 -0
- package/lib/CreateQueue.js +3 -0
- package/lib/CreateQueue.js.map +1 -0
- package/lib/CreateQueueHttp.d.ts +31 -0
- package/lib/CreateQueueHttp.d.ts.map +1 -0
- package/lib/CreateQueueHttp.js +67 -0
- package/lib/CreateQueueHttp.js.map +1 -0
- package/lib/CreateSandbox.d.ts +186 -0
- package/lib/CreateSandbox.d.ts.map +1 -0
- package/lib/CreateSandbox.js +3 -0
- package/lib/CreateSandbox.js.map +1 -0
- package/lib/CreateSandboxHttp.d.ts +17 -0
- package/lib/CreateSandboxHttp.d.ts.map +1 -0
- package/lib/CreateSandboxHttp.js +117 -0
- package/lib/CreateSandboxHttp.js.map +1 -0
- package/lib/CreateSecret.d.ts +95 -0
- package/lib/CreateSecret.d.ts.map +1 -0
- package/lib/CreateSecret.js +3 -0
- package/lib/CreateSecret.js.map +1 -0
- package/lib/CreateSecretHttp.d.ts +24 -0
- package/lib/CreateSecretHttp.d.ts.map +1 -0
- package/lib/CreateSecretHttp.js +60 -0
- package/lib/CreateSecretHttp.js.map +1 -0
- package/lib/CreateVolume.d.ts +84 -0
- package/lib/CreateVolume.d.ts.map +1 -0
- package/lib/CreateVolume.js +3 -0
- package/lib/CreateVolume.js.map +1 -0
- package/lib/CreateVolumeHttp.d.ts +32 -0
- package/lib/CreateVolumeHttp.d.ts.map +1 -0
- package/lib/CreateVolumeHttp.js +69 -0
- package/lib/CreateVolumeHttp.js.map +1 -0
- package/lib/Credentials.d.ts +32 -0
- package/lib/Credentials.d.ts.map +1 -0
- package/lib/Credentials.js +44 -0
- package/lib/Credentials.js.map +1 -0
- package/lib/Dict.d.ts +147 -0
- package/lib/Dict.d.ts.map +1 -0
- package/lib/Dict.js +175 -0
- package/lib/Dict.js.map +1 -0
- package/lib/DictClient.d.ts +55 -0
- package/lib/DictClient.d.ts.map +1 -0
- package/lib/DictClient.js +89 -0
- package/lib/DictClient.js.map +1 -0
- package/lib/Domain.d.ts +86 -0
- package/lib/Domain.d.ts.map +1 -0
- package/lib/Domain.js +113 -0
- package/lib/Domain.js.map +1 -0
- package/lib/Endpoint.d.ts +181 -0
- package/lib/Endpoint.d.ts.map +1 -0
- package/lib/Endpoint.js +283 -0
- package/lib/Endpoint.js.map +1 -0
- package/lib/Environment.d.ts +174 -0
- package/lib/Environment.d.ts.map +1 -0
- package/lib/Environment.js +244 -0
- package/lib/Environment.js.map +1 -0
- package/lib/FetchServer.d.ts +105 -0
- package/lib/FetchServer.d.ts.map +1 -0
- package/lib/FetchServer.js +3 -0
- package/lib/FetchServer.js.map +1 -0
- package/lib/FetchServerHttp.d.ts +21 -0
- package/lib/FetchServerHttp.d.ts.map +1 -0
- package/lib/FetchServerHttp.js +84 -0
- package/lib/FetchServerHttp.js.map +1 -0
- package/lib/Function.d.ts +236 -0
- package/lib/Function.d.ts.map +1 -0
- package/lib/Function.js +273 -0
- package/lib/Function.js.map +1 -0
- package/lib/FunctionAutoscaler.d.ts +99 -0
- package/lib/FunctionAutoscaler.d.ts.map +1 -0
- package/lib/FunctionAutoscaler.js +136 -0
- package/lib/FunctionAutoscaler.js.map +1 -0
- package/lib/FunctionTarget.d.ts +61 -0
- package/lib/FunctionTarget.d.ts.map +1 -0
- package/lib/FunctionTarget.js +136 -0
- package/lib/FunctionTarget.js.map +1 -0
- package/lib/Image.d.ts +159 -0
- package/lib/Image.d.ts.map +1 -0
- package/lib/Image.js +203 -0
- package/lib/Image.js.map +1 -0
- package/lib/ImageBuild.d.ts +108 -0
- package/lib/ImageBuild.d.ts.map +1 -0
- package/lib/ImageBuild.js +157 -0
- package/lib/ImageBuild.js.map +1 -0
- package/lib/ImagePlan.d.ts +31 -0
- package/lib/ImagePlan.d.ts.map +1 -0
- package/lib/ImagePlan.js +70 -0
- package/lib/ImagePlan.js.map +1 -0
- package/lib/InferEnv.d.ts +26 -0
- package/lib/InferEnv.d.ts.map +1 -0
- package/lib/InferEnv.js +1 -0
- package/lib/InferEnv.js.map +1 -0
- package/lib/InvokeFunction.d.ts +186 -0
- package/lib/InvokeFunction.d.ts.map +1 -0
- package/lib/InvokeFunction.js +10 -0
- package/lib/InvokeFunction.js.map +1 -0
- package/lib/InvokeFunctionHttp.d.ts +39 -0
- package/lib/InvokeFunctionHttp.d.ts.map +1 -0
- package/lib/InvokeFunctionHttp.js +210 -0
- package/lib/InvokeFunctionHttp.js.map +1 -0
- package/lib/ModalBindings.d.ts +138 -0
- package/lib/ModalBindings.d.ts.map +1 -0
- package/lib/ModalBindings.js +223 -0
- package/lib/ModalBindings.js.map +1 -0
- package/lib/MountBucket.d.ts +80 -0
- package/lib/MountBucket.d.ts.map +1 -0
- package/lib/MountBucket.js +44 -0
- package/lib/MountBucket.js.map +1 -0
- package/lib/MountVolume.d.ts +77 -0
- package/lib/MountVolume.d.ts.map +1 -0
- package/lib/MountVolume.js +41 -0
- package/lib/MountVolume.js.map +1 -0
- package/lib/Mounts.d.ts +134 -0
- package/lib/Mounts.d.ts.map +1 -0
- package/lib/Mounts.js +87 -0
- package/lib/Mounts.js.map +1 -0
- package/lib/PersistentSandbox.d.ts +75 -0
- package/lib/PersistentSandbox.d.ts.map +1 -0
- package/lib/PersistentSandbox.js +93 -0
- package/lib/PersistentSandbox.js.map +1 -0
- package/lib/Providers.d.ts +23 -0
- package/lib/Providers.d.ts.map +1 -0
- package/lib/Providers.js +64 -0
- package/lib/Providers.js.map +1 -0
- package/lib/Proxy.d.ts +94 -0
- package/lib/Proxy.d.ts.map +1 -0
- package/lib/Proxy.js +132 -0
- package/lib/Proxy.js.map +1 -0
- package/lib/Queue.d.ts +147 -0
- package/lib/Queue.d.ts.map +1 -0
- package/lib/Queue.js +177 -0
- package/lib/Queue.js.map +1 -0
- package/lib/QueueClient.d.ts +64 -0
- package/lib/QueueClient.d.ts.map +1 -0
- package/lib/QueueClient.js +73 -0
- package/lib/QueueClient.js.map +1 -0
- package/lib/ReadApp.d.ts +85 -0
- package/lib/ReadApp.d.ts.map +1 -0
- package/lib/ReadApp.js +3 -0
- package/lib/ReadApp.js.map +1 -0
- package/lib/ReadAppHttp.d.ts +26 -0
- package/lib/ReadAppHttp.d.ts.map +1 -0
- package/lib/ReadAppHttp.js +106 -0
- package/lib/ReadAppHttp.js.map +1 -0
- package/lib/ReadDict.d.ts +39 -0
- package/lib/ReadDict.d.ts.map +1 -0
- package/lib/ReadDict.js +3 -0
- package/lib/ReadDict.js.map +1 -0
- package/lib/ReadDictHttp.d.ts +12 -0
- package/lib/ReadDictHttp.d.ts.map +1 -0
- package/lib/ReadDictHttp.js +23 -0
- package/lib/ReadDictHttp.js.map +1 -0
- package/lib/ReadFunction.d.ts +73 -0
- package/lib/ReadFunction.d.ts.map +1 -0
- package/lib/ReadFunction.js +3 -0
- package/lib/ReadFunction.js.map +1 -0
- package/lib/ReadFunctionHttp.d.ts +25 -0
- package/lib/ReadFunctionHttp.d.ts.map +1 -0
- package/lib/ReadFunctionHttp.js +63 -0
- package/lib/ReadFunctionHttp.js.map +1 -0
- package/lib/ReadQueue.d.ts +39 -0
- package/lib/ReadQueue.d.ts.map +1 -0
- package/lib/ReadQueue.js +3 -0
- package/lib/ReadQueue.js.map +1 -0
- package/lib/ReadQueueHttp.d.ts +12 -0
- package/lib/ReadQueueHttp.d.ts.map +1 -0
- package/lib/ReadQueueHttp.js +23 -0
- package/lib/ReadQueueHttp.js.map +1 -0
- package/lib/ReadServer.d.ts +72 -0
- package/lib/ReadServer.d.ts.map +1 -0
- package/lib/ReadServer.js +3 -0
- package/lib/ReadServer.js.map +1 -0
- package/lib/ReadServerHttp.d.ts +25 -0
- package/lib/ReadServerHttp.d.ts.map +1 -0
- package/lib/ReadServerHttp.js +70 -0
- package/lib/ReadServerHttp.js.map +1 -0
- package/lib/ReadVolume.d.ts +40 -0
- package/lib/ReadVolume.d.ts.map +1 -0
- package/lib/ReadVolume.js +3 -0
- package/lib/ReadVolume.js.map +1 -0
- package/lib/ReadVolumeHttp.d.ts +12 -0
- package/lib/ReadVolumeHttp.d.ts.map +1 -0
- package/lib/ReadVolumeHttp.js +24 -0
- package/lib/ReadVolumeHttp.js.map +1 -0
- package/lib/ReadWriteDict.d.ts +39 -0
- package/lib/ReadWriteDict.d.ts.map +1 -0
- package/lib/ReadWriteDict.js +3 -0
- package/lib/ReadWriteDict.js.map +1 -0
- package/lib/ReadWriteDictHttp.d.ts +12 -0
- package/lib/ReadWriteDictHttp.d.ts.map +1 -0
- package/lib/ReadWriteDictHttp.js +23 -0
- package/lib/ReadWriteDictHttp.js.map +1 -0
- package/lib/ReadWriteQueue.d.ts +40 -0
- package/lib/ReadWriteQueue.d.ts.map +1 -0
- package/lib/ReadWriteQueue.js +3 -0
- package/lib/ReadWriteQueue.js.map +1 -0
- package/lib/ReadWriteQueueHttp.d.ts +12 -0
- package/lib/ReadWriteQueueHttp.d.ts.map +1 -0
- package/lib/ReadWriteQueueHttp.js +23 -0
- package/lib/ReadWriteQueueHttp.js.map +1 -0
- package/lib/ReadWriteVolume.d.ts +40 -0
- package/lib/ReadWriteVolume.d.ts.map +1 -0
- package/lib/ReadWriteVolume.js +3 -0
- package/lib/ReadWriteVolume.js.map +1 -0
- package/lib/ReadWriteVolumeHttp.d.ts +12 -0
- package/lib/ReadWriteVolumeHttp.d.ts.map +1 -0
- package/lib/ReadWriteVolumeHttp.js +24 -0
- package/lib/ReadWriteVolumeHttp.js.map +1 -0
- package/lib/RuntimeOwner.d.ts +39 -0
- package/lib/RuntimeOwner.d.ts.map +1 -0
- package/lib/RuntimeOwner.js +85 -0
- package/lib/RuntimeOwner.js.map +1 -0
- package/lib/Sandbox.d.ts +215 -0
- package/lib/Sandbox.d.ts.map +1 -0
- package/lib/Sandbox.js +278 -0
- package/lib/Sandbox.js.map +1 -0
- package/lib/SandboxClient.d.ts +748 -0
- package/lib/SandboxClient.d.ts.map +1 -0
- package/lib/SandboxClient.js +710 -0
- package/lib/SandboxClient.js.map +1 -0
- package/lib/ScaleFunction.d.ts +54 -0
- package/lib/ScaleFunction.d.ts.map +1 -0
- package/lib/ScaleFunction.js +3 -0
- package/lib/ScaleFunction.js.map +1 -0
- package/lib/ScaleFunctionHttp.d.ts +21 -0
- package/lib/ScaleFunctionHttp.d.ts.map +1 -0
- package/lib/ScaleFunctionHttp.js +39 -0
- package/lib/ScaleFunctionHttp.js.map +1 -0
- package/lib/Secret.d.ts +170 -0
- package/lib/Secret.d.ts.map +1 -0
- package/lib/Secret.js +196 -0
- package/lib/Secret.js.map +1 -0
- package/lib/Server.d.ts +155 -0
- package/lib/Server.d.ts.map +1 -0
- package/lib/Server.js +184 -0
- package/lib/Server.js.map +1 -0
- package/lib/ServiceUser.d.ts +139 -0
- package/lib/ServiceUser.d.ts.map +1 -0
- package/lib/ServiceUser.js +210 -0
- package/lib/ServiceUser.js.map +1 -0
- package/lib/Volume.d.ts +170 -0
- package/lib/Volume.d.ts.map +1 -0
- package/lib/Volume.js +220 -0
- package/lib/Volume.js.map +1 -0
- package/lib/VolumeClient.d.ts +53 -0
- package/lib/VolumeClient.d.ts.map +1 -0
- package/lib/VolumeClient.js +22 -0
- package/lib/VolumeClient.js.map +1 -0
- package/lib/VolumeFiles.d.ts +94 -0
- package/lib/VolumeFiles.d.ts.map +1 -0
- package/lib/VolumeFiles.js +139 -0
- package/lib/VolumeFiles.js.map +1 -0
- package/lib/WebhookToken.d.ts +102 -0
- package/lib/WebhookToken.d.ts.map +1 -0
- package/lib/WebhookToken.js +176 -0
- package/lib/WebhookToken.js.map +1 -0
- package/lib/WorkspaceSettings.d.ts +70 -0
- package/lib/WorkspaceSettings.d.ts.map +1 -0
- package/lib/WorkspaceSettings.js +105 -0
- package/lib/WorkspaceSettings.js.map +1 -0
- package/lib/WriteApp.d.ts +38 -0
- package/lib/WriteApp.d.ts.map +1 -0
- package/lib/WriteApp.js +3 -0
- package/lib/WriteApp.js.map +1 -0
- package/lib/WriteAppHttp.d.ts +23 -0
- package/lib/WriteAppHttp.d.ts.map +1 -0
- package/lib/WriteAppHttp.js +36 -0
- package/lib/WriteAppHttp.js.map +1 -0
- package/lib/WriteDict.d.ts +39 -0
- package/lib/WriteDict.d.ts.map +1 -0
- package/lib/WriteDict.js +3 -0
- package/lib/WriteDict.js.map +1 -0
- package/lib/WriteDictHttp.d.ts +12 -0
- package/lib/WriteDictHttp.d.ts.map +1 -0
- package/lib/WriteDictHttp.js +23 -0
- package/lib/WriteDictHttp.js.map +1 -0
- package/lib/WriteQueue.d.ts +39 -0
- package/lib/WriteQueue.d.ts.map +1 -0
- package/lib/WriteQueue.js +3 -0
- package/lib/WriteQueue.js.map +1 -0
- package/lib/WriteQueueHttp.d.ts +12 -0
- package/lib/WriteQueueHttp.d.ts.map +1 -0
- package/lib/WriteQueueHttp.js +23 -0
- package/lib/WriteQueueHttp.js.map +1 -0
- package/lib/WriteSecret.d.ts +53 -0
- package/lib/WriteSecret.d.ts.map +1 -0
- package/lib/WriteSecret.js +3 -0
- package/lib/WriteSecret.js.map +1 -0
- package/lib/WriteSecretHttp.d.ts +23 -0
- package/lib/WriteSecretHttp.d.ts.map +1 -0
- package/lib/WriteSecretHttp.js +44 -0
- package/lib/WriteSecretHttp.js.map +1 -0
- package/lib/WriteVolume.d.ts +39 -0
- package/lib/WriteVolume.d.ts.map +1 -0
- package/lib/WriteVolume.js +3 -0
- package/lib/WriteVolume.js.map +1 -0
- package/lib/WriteVolumeHttp.d.ts +12 -0
- package/lib/WriteVolumeHttp.d.ts.map +1 -0
- package/lib/WriteVolumeHttp.js +24 -0
- package/lib/WriteVolumeHttp.js.map +1 -0
- package/lib/index.d.ts +80 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +78 -0
- package/lib/index.js.map +1 -0
- package/lib/internal/Declared.d.ts +29 -0
- package/lib/internal/Declared.d.ts.map +1 -0
- package/lib/internal/Declared.js +31 -0
- package/lib/internal/Declared.js.map +1 -0
- package/lib/internal/Deploy.d.ts +110 -0
- package/lib/internal/Deploy.d.ts.map +1 -0
- package/lib/internal/Deploy.js +230 -0
- package/lib/internal/Deploy.js.map +1 -0
- package/lib/internal/Entrypoint.d.ts +52 -0
- package/lib/internal/Entrypoint.d.ts.map +1 -0
- package/lib/internal/Entrypoint.js +193 -0
- package/lib/internal/Entrypoint.js.map +1 -0
- package/lib/internal/Rpc.d.ts +17 -0
- package/lib/internal/Rpc.d.ts.map +1 -0
- package/lib/internal/Rpc.js +49 -0
- package/lib/internal/Rpc.js.map +1 -0
- package/lib/internal/RpcAuth.d.ts +41 -0
- package/lib/internal/RpcAuth.d.ts.map +1 -0
- package/lib/internal/RpcAuth.js +100 -0
- package/lib/internal/RpcAuth.js.map +1 -0
- package/lib/internal/Runtime.d.ts +127 -0
- package/lib/internal/Runtime.d.ts.map +1 -0
- package/lib/internal/Runtime.js +246 -0
- package/lib/internal/Runtime.js.map +1 -0
- package/lib/internal/Tags.d.ts +19 -0
- package/lib/internal/Tags.d.ts.map +1 -0
- package/lib/internal/Tags.js +33 -0
- package/lib/internal/Tags.js.map +1 -0
- package/lib/internal/TcpConnect.d.ts +12 -0
- package/lib/internal/TcpConnect.d.ts.map +1 -0
- package/lib/internal/TcpConnect.js +46 -0
- package/lib/internal/TcpConnect.js.map +1 -0
- package/lib/internal/Transport.d.ts +13 -0
- package/lib/internal/Transport.d.ts.map +1 -0
- package/lib/internal/Transport.js +16 -0
- package/lib/internal/Transport.js.map +1 -0
- package/lib/internal.d.ts +71 -0
- package/lib/internal.d.ts.map +1 -0
- package/lib/internal.js +102 -0
- package/lib/internal.js.map +1 -0
- package/package.json +59 -3
- package/src/App.ts +262 -0
- package/src/AuthProvider.ts +295 -0
- package/src/BindingHttp.ts +112 -0
- package/src/Blob.ts +71 -0
- package/src/Bootstrap.ts +52 -0
- package/src/Cbor.ts +158 -0
- package/src/ConnectSandbox.ts +99 -0
- package/src/Container.ts +121 -0
- package/src/Contributions.ts +9 -0
- package/src/CreateDict.ts +95 -0
- package/src/CreateDictHttp.ts +91 -0
- package/src/CreateImage.ts +105 -0
- package/src/CreateImageHttp.ts +117 -0
- package/src/CreateQueue.ts +95 -0
- package/src/CreateQueueHttp.ts +91 -0
- package/src/CreateSandbox.ts +228 -0
- package/src/CreateSandboxHttp.ts +160 -0
- package/src/CreateSecret.ts +109 -0
- package/src/CreateSecretHttp.ts +83 -0
- package/src/CreateVolume.ts +96 -0
- package/src/CreateVolumeHttp.ts +93 -0
- package/src/Credentials.ts +74 -0
- package/src/Dict.ts +245 -0
- package/src/DictClient.ts +166 -0
- package/src/Domain.ts +147 -0
- package/src/Endpoint.ts +406 -0
- package/src/Environment.ts +373 -0
- package/src/FetchServer.ts +126 -0
- package/src/FetchServerHttp.ts +110 -0
- package/src/Function.ts +397 -0
- package/src/FunctionAutoscaler.ts +210 -0
- package/src/FunctionTarget.ts +181 -0
- package/src/Image.ts +281 -0
- package/src/ImageBuild.ts +228 -0
- package/src/ImagePlan.ts +78 -0
- package/src/InferEnv.ts +27 -0
- package/src/InvokeFunction.ts +211 -0
- package/src/InvokeFunctionHttp.ts +316 -0
- package/src/ModalBindings.ts +310 -0
- package/src/MountBucket.ts +137 -0
- package/src/MountVolume.ts +113 -0
- package/src/Mounts.ts +230 -0
- package/src/PersistentSandbox.ts +142 -0
- package/src/Providers.ts +100 -0
- package/src/Proxy.ts +191 -0
- package/src/Queue.ts +258 -0
- package/src/QueueClient.ts +149 -0
- package/src/ReadApp.ts +101 -0
- package/src/ReadAppHttp.ts +142 -0
- package/src/ReadDict.ts +44 -0
- package/src/ReadDictHttp.ts +27 -0
- package/src/ReadFunction.ts +107 -0
- package/src/ReadFunctionHttp.ts +91 -0
- package/src/ReadQueue.ts +44 -0
- package/src/ReadQueueHttp.ts +27 -0
- package/src/ReadServer.ts +98 -0
- package/src/ReadServerHttp.ts +101 -0
- package/src/ReadVolume.ts +45 -0
- package/src/ReadVolumeHttp.ts +28 -0
- package/src/ReadWriteDict.ts +44 -0
- package/src/ReadWriteDictHttp.ts +27 -0
- package/src/ReadWriteQueue.ts +45 -0
- package/src/ReadWriteQueueHttp.ts +27 -0
- package/src/ReadWriteVolume.ts +45 -0
- package/src/ReadWriteVolumeHttp.ts +28 -0
- package/src/RuntimeOwner.ts +111 -0
- package/src/Sandbox.ts +402 -0
- package/src/SandboxClient.ts +1404 -0
- package/src/ScaleFunction.ts +70 -0
- package/src/ScaleFunctionHttp.ts +54 -0
- package/src/Secret.ts +296 -0
- package/src/Server.ts +285 -0
- package/src/ServiceUser.ts +295 -0
- package/src/Volume.ts +320 -0
- package/src/VolumeClient.ts +108 -0
- package/src/VolumeFiles.ts +194 -0
- package/src/WebhookToken.ts +230 -0
- package/src/WorkspaceSettings.ts +160 -0
- package/src/WriteApp.ts +43 -0
- package/src/WriteAppHttp.ts +51 -0
- package/src/WriteDict.ts +44 -0
- package/src/WriteDictHttp.ts +27 -0
- package/src/WriteQueue.ts +44 -0
- package/src/WriteQueueHttp.ts +27 -0
- package/src/WriteSecret.ts +60 -0
- package/src/WriteSecretHttp.ts +56 -0
- package/src/WriteVolume.ts +44 -0
- package/src/WriteVolumeHttp.ts +28 -0
- package/src/globals.d.ts +2 -0
- package/src/index.ts +85 -0
- package/src/internal/Declared.ts +80 -0
- package/src/internal/Deploy.ts +309 -0
- package/src/internal/Entrypoint.ts +198 -0
- package/src/internal/Rpc.ts +59 -0
- package/src/internal/RpcAuth.ts +132 -0
- package/src/internal/Runtime.ts +386 -0
- package/src/internal/Tags.ts +44 -0
- package/src/internal/TcpConnect.ts +78 -0
- package/src/internal/Transport.ts +25 -0
- package/src/internal.ts +147 -0
|
@@ -0,0 +1,748 @@
|
|
|
1
|
+
import * as persistent from "@distilled.cloud/modal/persistent";
|
|
2
|
+
import * as sandbox from "@distilled.cloud/modal/sandbox";
|
|
3
|
+
import * as router from "@distilled.cloud/modal/task_command_router";
|
|
4
|
+
import type { RuntimeContext } from "alchemy/RuntimeContext";
|
|
5
|
+
import * as Sandbox from "alchemy/Sandbox";
|
|
6
|
+
import * as DateTime from "effect/DateTime";
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import * as HttpClient from "effect/http/HttpClient";
|
|
9
|
+
import type * as HttpClientError from "effect/http/HttpClientError";
|
|
10
|
+
import * as HttpClientRequest from "effect/http/HttpClientRequest";
|
|
11
|
+
import type * as HttpClientResponse from "effect/http/HttpClientResponse";
|
|
12
|
+
import type * as HttpServerRequest from "effect/http/HttpServerRequest";
|
|
13
|
+
import type * as HttpServerResponse from "effect/http/HttpServerResponse";
|
|
14
|
+
import type * as Scope from "effect/Scope";
|
|
15
|
+
import type * as Socket from "effect/socket/Socket";
|
|
16
|
+
import * as Stream from "effect/Stream";
|
|
17
|
+
import { type ErrorOf } from "./internal.ts";
|
|
18
|
+
import { type ModalMounts, type SandboxMount } from "./Mounts.ts";
|
|
19
|
+
declare const SandboxNotRunning_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
20
|
+
readonly _tag: "Modal.SandboxNotRunning";
|
|
21
|
+
} & Readonly<A>;
|
|
22
|
+
/** A sandbox ended (or never became ready) before the call could finish. */
|
|
23
|
+
export declare class SandboxNotRunning extends SandboxNotRunning_base<{
|
|
24
|
+
readonly sandboxId: string;
|
|
25
|
+
readonly message: string;
|
|
26
|
+
}> {
|
|
27
|
+
}
|
|
28
|
+
declare const SandboxUnexpectedResponse_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
29
|
+
readonly _tag: "Modal.SandboxUnexpectedResponse";
|
|
30
|
+
} & Readonly<A>;
|
|
31
|
+
/** A Modal call returned without the field the client needs. */
|
|
32
|
+
export declare class SandboxUnexpectedResponse extends SandboxUnexpectedResponse_base<{
|
|
33
|
+
readonly message: string;
|
|
34
|
+
}> {
|
|
35
|
+
}
|
|
36
|
+
declare const SandboxFilesystemError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
37
|
+
readonly _tag: "Modal.SandboxFilesystemError";
|
|
38
|
+
} & Readonly<A>;
|
|
39
|
+
/** A filesystem operation inside the sandbox failed (missing path, permissions). */
|
|
40
|
+
export declare class SandboxFilesystemError extends SandboxFilesystemError_base<{
|
|
41
|
+
readonly path: string;
|
|
42
|
+
readonly message: string;
|
|
43
|
+
}> {
|
|
44
|
+
}
|
|
45
|
+
/** A Modal duration: seconds, or a string like `"10 minutes"`. */
|
|
46
|
+
export type DurationInput = number | string;
|
|
47
|
+
/** An image a sandbox boots from: a registry ref, or a `Modal.Image` (resolved). */
|
|
48
|
+
export type SandboxImage = string | {
|
|
49
|
+
readonly imageId: string;
|
|
50
|
+
};
|
|
51
|
+
/** Where a route sends matching traffic: blocked, through a `Modal.Proxy`, or to a sidecar. */
|
|
52
|
+
export type OutboundRedirect = "block" | {
|
|
53
|
+
readonly proxy: {
|
|
54
|
+
readonly proxyId: string;
|
|
55
|
+
};
|
|
56
|
+
} | {
|
|
57
|
+
readonly sidecar: string;
|
|
58
|
+
};
|
|
59
|
+
/** An inclusive port range, or one port. */
|
|
60
|
+
export type OutboundPorts = ReadonlyArray<number | {
|
|
61
|
+
readonly start: number;
|
|
62
|
+
readonly end: number;
|
|
63
|
+
}>;
|
|
64
|
+
/** Set headers on decrypted HTTPS requests, with values from a secret. */
|
|
65
|
+
export interface HeaderReplacement {
|
|
66
|
+
/** The secret whose keys the header values reference. Omit for static values. */
|
|
67
|
+
readonly secret?: {
|
|
68
|
+
readonly secretId: string;
|
|
69
|
+
};
|
|
70
|
+
/** Header name to value; `$KEY` is replaced with the secret's `KEY`, `$$` is a literal `$`. */
|
|
71
|
+
readonly headers: Record<string, string>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* One route of an {@link OutboundPolicy}. Routes match in order; traffic a
|
|
75
|
+
* route matches without a `redirect` goes to its destination.
|
|
76
|
+
*/
|
|
77
|
+
export type OutboundRoute = {
|
|
78
|
+
/** Traffic to these CIDR ranges. */
|
|
79
|
+
readonly ip: {
|
|
80
|
+
readonly cidrs: ReadonlyArray<string>;
|
|
81
|
+
/** @default every port */
|
|
82
|
+
readonly ports?: OutboundPorts;
|
|
83
|
+
readonly transport?: "tcp" | "udp" | "any";
|
|
84
|
+
readonly redirect?: OutboundRedirect;
|
|
85
|
+
};
|
|
86
|
+
} | {
|
|
87
|
+
/** TLS connections to these domains (`*.` wildcards allowed), never decrypted. */
|
|
88
|
+
readonly tls: {
|
|
89
|
+
readonly domains: ReadonlyArray<string>;
|
|
90
|
+
/** @default 443 */
|
|
91
|
+
readonly ports?: OutboundPorts;
|
|
92
|
+
readonly redirect?: OutboundRedirect;
|
|
93
|
+
};
|
|
94
|
+
} | {
|
|
95
|
+
/** HTTPS requests to these domains, decrypted so headers can be replaced. */
|
|
96
|
+
readonly https: {
|
|
97
|
+
readonly domains: ReadonlyArray<string>;
|
|
98
|
+
/** @default 443 */
|
|
99
|
+
readonly ports?: OutboundPorts;
|
|
100
|
+
readonly headerReplacements?: ReadonlyArray<HeaderReplacement>;
|
|
101
|
+
readonly redirect?: OutboundRedirect;
|
|
102
|
+
};
|
|
103
|
+
} | {
|
|
104
|
+
/** Everything no earlier route matched. Must be the last route. */
|
|
105
|
+
readonly any: {
|
|
106
|
+
readonly redirect?: OutboundRedirect;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* A sandbox's outbound traffic rules, enforced by Modal outside the
|
|
111
|
+
* sandbox. HTTPS routes decrypt traffic with a certificate authority the
|
|
112
|
+
* sandbox trusts, so Modal can add credentials the sandbox never sees.
|
|
113
|
+
*/
|
|
114
|
+
export interface OutboundPolicy {
|
|
115
|
+
readonly routes: ReadonlyArray<OutboundRoute>;
|
|
116
|
+
/**
|
|
117
|
+
* Let HTTPS routes decrypt traffic. Fixed at creation.
|
|
118
|
+
* @default true when a route is `https`
|
|
119
|
+
*/
|
|
120
|
+
readonly tlsDecryption?: boolean;
|
|
121
|
+
}
|
|
122
|
+
/** Options for creating a sandbox: Modal's own sandbox parameters. */
|
|
123
|
+
export interface SandboxCreateOptions {
|
|
124
|
+
/** Image to boot. Defaults to the binding's image, else `debian:bookworm-slim`. */
|
|
125
|
+
readonly image?: SandboxImage;
|
|
126
|
+
/**
|
|
127
|
+
* The sandbox's main process. Without one the sandbox idles (`sleep`) and
|
|
128
|
+
* you drive it with {@link SandboxHandle.exec}.
|
|
129
|
+
*/
|
|
130
|
+
readonly command?: ReadonlyArray<string>;
|
|
131
|
+
/** Working directory of the main process and of exec'd commands. */
|
|
132
|
+
readonly workdir?: string;
|
|
133
|
+
/** Environment variables for the main process. */
|
|
134
|
+
readonly env?: Record<string, string>;
|
|
135
|
+
/** Secrets whose variables the sandbox sees as environment variables. */
|
|
136
|
+
readonly secrets?: ReadonlyArray<{
|
|
137
|
+
readonly secretId: string;
|
|
138
|
+
}>;
|
|
139
|
+
/**
|
|
140
|
+
* Volumes and cloud buckets to mount: volume handles, bucket names, or
|
|
141
|
+
* the references `Modal.MountVolume` / `Modal.MountBucket` return.
|
|
142
|
+
*/
|
|
143
|
+
readonly mounts?: ReadonlyArray<SandboxMount>;
|
|
144
|
+
/** CPU cores (fractional allowed). */
|
|
145
|
+
readonly cpu?: number;
|
|
146
|
+
/** Memory in MiB. */
|
|
147
|
+
readonly memory?: number;
|
|
148
|
+
/** GPU: `"T4"`, `"A10G"`, `"A100-80GB"`, `"H100"`, with an optional `":<count>"`. */
|
|
149
|
+
readonly gpu?: string;
|
|
150
|
+
/** Ephemeral disk in MiB. */
|
|
151
|
+
readonly ephemeralDisk?: number;
|
|
152
|
+
/** Most time the sandbox lives. @default 5 minutes (Modal's default); at most 24 hours */
|
|
153
|
+
readonly timeout?: DurationInput;
|
|
154
|
+
/** Terminate after this long without exec'd commands or connections. */
|
|
155
|
+
readonly idleTimeout?: DurationInput;
|
|
156
|
+
/** Name, unique among the app's running sandboxes; find it again with `fromName`. */
|
|
157
|
+
readonly name?: string;
|
|
158
|
+
/** Tags, for `list({ tags })`. */
|
|
159
|
+
readonly tags?: Record<string, string>;
|
|
160
|
+
/** Regions to run in (`"us-east"`, `"eu"`, ...). */
|
|
161
|
+
readonly regions?: ReadonlyArray<string>;
|
|
162
|
+
/** Block all network access. */
|
|
163
|
+
readonly blockNetwork?: boolean;
|
|
164
|
+
/** Allow outbound traffic only to these CIDR ranges (and {@link allowedDomains}). */
|
|
165
|
+
readonly cidrAllowlist?: ReadonlyArray<string>;
|
|
166
|
+
/** Allow outbound traffic only to these domains (and {@link cidrAllowlist}). */
|
|
167
|
+
readonly allowedDomains?: ReadonlyArray<string>;
|
|
168
|
+
/** Allow inbound connections (tunnels) only from these CIDR ranges. */
|
|
169
|
+
readonly inboundCidrAllowlist?: ReadonlyArray<string>;
|
|
170
|
+
/** Outbound header injection: secrets the sandbox never sees. */
|
|
171
|
+
readonly outboundPolicy?: OutboundPolicy;
|
|
172
|
+
/** Route outbound traffic through a `Modal.Proxy`'s static IPs. */
|
|
173
|
+
readonly proxy?: {
|
|
174
|
+
readonly proxyId: string;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Give the sandbox a `MODAL_IDENTITY_TOKEN` environment variable: an OIDC
|
|
178
|
+
* token Modal signs, naming the workspace, environment, app and sandbox.
|
|
179
|
+
* A cloud that trusts Modal's issuer (`https://oidc.modal.com`) exchanges
|
|
180
|
+
* it for short-lived credentials, so no long-lived key enters the sandbox.
|
|
181
|
+
*/
|
|
182
|
+
readonly includeOidcIdentityToken?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Serve the sandbox an X.509 certificate that names it (an X.509-SVID),
|
|
185
|
+
* over the SPIFFE Workload API socket at `SPIFFE_ENDPOINT_SOCKET`. A
|
|
186
|
+
* cloud that trusts Modal's certificate authority (AWS IAM Roles
|
|
187
|
+
* Anywhere) exchanges it for short-lived credentials.
|
|
188
|
+
*/
|
|
189
|
+
readonly includeX509Svid?: boolean;
|
|
190
|
+
/** Ports reachable through TLS tunnels (`sandbox.getTcpPort(port)`). */
|
|
191
|
+
readonly encryptedPorts?: ReadonlyArray<number>;
|
|
192
|
+
/** Ports reachable through plain TCP tunnels. */
|
|
193
|
+
readonly unencryptedPorts?: ReadonlyArray<number>;
|
|
194
|
+
/** Ports reachable through HTTP/2 tunnels. */
|
|
195
|
+
readonly h2Ports?: ReadonlyArray<number>;
|
|
196
|
+
/** Allow memory snapshots of this sandbox (`snapshotMemory`). */
|
|
197
|
+
readonly enableSnapshot?: boolean;
|
|
198
|
+
/** Serve tunnels on a custom domain registered with Modal. */
|
|
199
|
+
readonly customDomain?: string;
|
|
200
|
+
}
|
|
201
|
+
/** What a finished command printed, and its exit code. */
|
|
202
|
+
export interface ExecResult {
|
|
203
|
+
readonly exitCode: number;
|
|
204
|
+
readonly stdout: string;
|
|
205
|
+
readonly stderr: string;
|
|
206
|
+
}
|
|
207
|
+
/** A command: a shell string (run with `sh -c`), or an argument vector (no shell). */
|
|
208
|
+
export type Command = Sandbox.Command;
|
|
209
|
+
/** Options for {@link SandboxHandleOf.exec}. */
|
|
210
|
+
export interface ExecOptions {
|
|
211
|
+
/** Working directory. @default the sandbox's `workdir` */
|
|
212
|
+
readonly cwd?: string;
|
|
213
|
+
/** Extra environment variables for this command. */
|
|
214
|
+
readonly env?: Record<string, string>;
|
|
215
|
+
/** Secrets whose variables this command sees. */
|
|
216
|
+
readonly secrets?: ReadonlyArray<{
|
|
217
|
+
readonly secretId: string;
|
|
218
|
+
}>;
|
|
219
|
+
/** Kill the command after this long. */
|
|
220
|
+
readonly timeout?: DurationInput;
|
|
221
|
+
/** Bytes (or text) written to the command's stdin, then closed. */
|
|
222
|
+
readonly stdin?: string | Uint8Array;
|
|
223
|
+
}
|
|
224
|
+
/** A filesystem entry inside a sandbox. */
|
|
225
|
+
export interface SandboxFileEntry {
|
|
226
|
+
readonly path: string;
|
|
227
|
+
readonly type: "file" | "directory" | "symlink" | "other";
|
|
228
|
+
}
|
|
229
|
+
/** What `files.stat` reports about a path. */
|
|
230
|
+
export interface SandboxFileStat extends SandboxFileEntry {
|
|
231
|
+
/** Size in bytes. */
|
|
232
|
+
readonly size: number;
|
|
233
|
+
/** Last modification time. */
|
|
234
|
+
readonly modifiedAt: DateTime.Utc;
|
|
235
|
+
}
|
|
236
|
+
/** A tunnel to a port inside the sandbox. */
|
|
237
|
+
export interface SandboxTunnel {
|
|
238
|
+
/** `https://…` (or `tcp://…` for unencrypted tunnels). */
|
|
239
|
+
readonly url: string;
|
|
240
|
+
readonly host: string;
|
|
241
|
+
readonly port: number;
|
|
242
|
+
}
|
|
243
|
+
/** The error of one of {@link SandboxOps}. */
|
|
244
|
+
export type SandboxOpError<K extends keyof SandboxOps> = ErrorOf<SandboxOps[K]>;
|
|
245
|
+
type RouterOpError<K extends keyof typeof routerOps> = Effect.Success<ReturnType<(typeof routerOps)[K]>> extends (...args: any[]) => infer Out ? Out extends Effect.Effect<any, infer E, any> ? E : Out extends Stream.Stream<any, infer E, any> ? E : never : never;
|
|
246
|
+
/** Reaching a sandbox's task: it ended, or Modal's task lookup failed. */
|
|
247
|
+
export type SandboxTaskError = SandboxNotRunning | SandboxUnexpectedResponse | SandboxOpError<"getTaskId"> | SandboxOpError<"getCommandRouterAccess">;
|
|
248
|
+
/** Running a command in a sandbox. */
|
|
249
|
+
export type SandboxExecError = SandboxTaskError | RouterOpError<"execStart" | "execStdinWrite" | "execStdioRead" | "execWait">;
|
|
250
|
+
/** A started process: running it, following its output, writing its stdin, signalling it. */
|
|
251
|
+
export type SandboxProcessError = SandboxExecError | RouterOpError<"execStdioFollow">;
|
|
252
|
+
declare const SandboxPtyResizeUnsupported_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
253
|
+
readonly _tag: "Modal.SandboxPtyResizeUnsupported";
|
|
254
|
+
} & Readonly<A>;
|
|
255
|
+
/** Modal's task command router has no call to resize a running PTY. */
|
|
256
|
+
export declare class SandboxPtyResizeUnsupported extends SandboxPtyResizeUnsupported_base<{
|
|
257
|
+
readonly message: string;
|
|
258
|
+
}> {
|
|
259
|
+
}
|
|
260
|
+
/** A terminal session's errors. */
|
|
261
|
+
export type SandboxPtyError = SandboxProcessError | SandboxPtyResizeUnsupported;
|
|
262
|
+
/** Options for `pty.open`: the terminal size, and what runs in it. */
|
|
263
|
+
export interface SandboxPtyOptions extends Sandbox.PtyOptions {
|
|
264
|
+
/** Secrets whose variables the session sees. */
|
|
265
|
+
readonly secrets?: ReadonlyArray<{
|
|
266
|
+
readonly secretId: string;
|
|
267
|
+
}>;
|
|
268
|
+
}
|
|
269
|
+
/** A file operation inside a sandbox (it runs as a command). */
|
|
270
|
+
export type SandboxFilesError = SandboxExecError | SandboxFilesystemError;
|
|
271
|
+
/** Taking a snapshot or changing a running sandbox through its command router. */
|
|
272
|
+
export type SandboxRouterError<K extends keyof typeof routerOps> = SandboxTaskError | RouterOpError<K>;
|
|
273
|
+
/** The files inside a sandbox, read and written with commands its image has (`sh`, `base64`, `stat`). */
|
|
274
|
+
export interface SandboxFilesOf<R> {
|
|
275
|
+
/** Read a file. */
|
|
276
|
+
read(path: string): Effect.Effect<Uint8Array, SandboxFilesError, R>;
|
|
277
|
+
/** Read a UTF-8 file. */
|
|
278
|
+
readText(path: string): Effect.Effect<string, SandboxFilesError, R>;
|
|
279
|
+
/** Write (create or truncate) a file, creating its directory. */
|
|
280
|
+
write(path: string, data: string | Uint8Array): Effect.Effect<void, SandboxFilesError, R>;
|
|
281
|
+
/** List a directory. */
|
|
282
|
+
list(path: string): Effect.Effect<ReadonlyArray<SandboxFileEntry>, SandboxFilesError, R>;
|
|
283
|
+
/** A path's type, size and modification time. */
|
|
284
|
+
stat(path: string): Effect.Effect<SandboxFileStat, SandboxFilesError, R>;
|
|
285
|
+
/** Remove a file, or a directory with `recursive`. */
|
|
286
|
+
remove(path: string, options?: {
|
|
287
|
+
readonly recursive?: boolean;
|
|
288
|
+
}): Effect.Effect<void, SandboxFilesError, R>;
|
|
289
|
+
/** Create a directory and its parents. */
|
|
290
|
+
makeDir(path: string): Effect.Effect<void, SandboxFilesError, R>;
|
|
291
|
+
}
|
|
292
|
+
/** A running (or finished) Modal sandbox. Every method calls Modal's API. */
|
|
293
|
+
export interface SandboxHandleOf<R> {
|
|
294
|
+
readonly sandboxId: string;
|
|
295
|
+
/**
|
|
296
|
+
* Run a command and wait for it. A string runs with `sh -c`; an argument
|
|
297
|
+
* vector runs without a shell. A non-zero exit code is returned, not failed.
|
|
298
|
+
*/
|
|
299
|
+
exec(command: Command, options?: ExecOptions): Effect.Effect<ExecResult, SandboxExecError, R>;
|
|
300
|
+
/**
|
|
301
|
+
* Start a command and follow it: its output streams as it runs, `write`
|
|
302
|
+
* feeds its stdin, `kill` signals it. Closing the scope detaches; the
|
|
303
|
+
* command keeps running.
|
|
304
|
+
*/
|
|
305
|
+
start(command: Command, options?: ExecOptions): Effect.Effect<Sandbox.Process<SandboxProcessError>, SandboxProcessError, R | Scope.Scope>;
|
|
306
|
+
/**
|
|
307
|
+
* Terminals: `open` starts a login shell (or `command`) on a PTY of the
|
|
308
|
+
* given size. Modal can't resize a running PTY, so `resize` fails with
|
|
309
|
+
* {@link SandboxPtyResizeUnsupported}.
|
|
310
|
+
*/
|
|
311
|
+
readonly pty: Sandbox.Pty<SandboxPtyError, SandboxPtyOptions>;
|
|
312
|
+
/** The sandbox's files. */
|
|
313
|
+
readonly files: SandboxFilesOf<R>;
|
|
314
|
+
/** Tunnels to the sandbox's open ports, by container port. */
|
|
315
|
+
tunnels(timeout?: DurationInput): Effect.Effect<Record<number, SandboxTunnel>, SandboxOpError<"getTunnels">, R>;
|
|
316
|
+
/**
|
|
317
|
+
* A token-authenticated URL for one port, for a browser or client that
|
|
318
|
+
* shouldn't hold Modal credentials.
|
|
319
|
+
*/
|
|
320
|
+
connectToken(options?: {
|
|
321
|
+
readonly port?: number;
|
|
322
|
+
readonly userMetadata?: string;
|
|
323
|
+
}): Effect.Effect<{
|
|
324
|
+
readonly url: string;
|
|
325
|
+
readonly token: string;
|
|
326
|
+
}, SandboxOpError<"createConnectToken"> | SandboxUnexpectedResponse, R>;
|
|
327
|
+
/** Capture the filesystem as a new image (usable as `image` later). */
|
|
328
|
+
snapshotFilesystem(timeout?: DurationInput): Effect.Effect<{
|
|
329
|
+
readonly imageId: string;
|
|
330
|
+
}, SandboxRouterError<"snapshotFilesystem">, R>;
|
|
331
|
+
/** Capture memory and filesystem (needs `enableSnapshot`); restore with `restore`. */
|
|
332
|
+
snapshotMemory(): Effect.Effect<{
|
|
333
|
+
readonly snapshotId: string;
|
|
334
|
+
}, SandboxRouterError<"snapshotMemory">, R>;
|
|
335
|
+
/** Capture one directory as an image (mount it into another sandbox with `mountDirectory`). */
|
|
336
|
+
snapshotDirectory(path: string): Effect.Effect<{
|
|
337
|
+
readonly imageId: string;
|
|
338
|
+
}, SandboxRouterError<"snapshotDirectory">, R>;
|
|
339
|
+
/** Mount a directory snapshot at `path`. */
|
|
340
|
+
mountDirectory(path: string, snapshot: {
|
|
341
|
+
readonly imageId: string;
|
|
342
|
+
}): Effect.Effect<void, SandboxRouterError<"mountDirectory">, R>;
|
|
343
|
+
/**
|
|
344
|
+
* Replace the sandbox's outbound network policy while it runs. Connections
|
|
345
|
+
* the new policy no longer allows are closed. `{}` opens the network.
|
|
346
|
+
*/
|
|
347
|
+
setNetworkAccess(access: {
|
|
348
|
+
readonly blockNetwork?: boolean;
|
|
349
|
+
readonly cidrAllowlist?: ReadonlyArray<string>;
|
|
350
|
+
readonly allowedDomains?: ReadonlyArray<string>;
|
|
351
|
+
}): Effect.Effect<void, SandboxRouterError<"setNetworkAccess">, R>;
|
|
352
|
+
/** Replace the outbound header injection rules while it runs. */
|
|
353
|
+
setOutboundPolicy(policy: OutboundPolicy): Effect.Effect<void, SandboxOpError<"setOutboundPolicy">, R>;
|
|
354
|
+
/** Replace the sandbox's tags. */
|
|
355
|
+
setTags(tags: Record<string, string>): Effect.Effect<void, SandboxOpError<"setTags">, R>;
|
|
356
|
+
/** The sandbox's tags. */
|
|
357
|
+
getTags(): Effect.Effect<Record<string, string>, SandboxOpError<"getTags">, R>;
|
|
358
|
+
/** Name the sandbox (unique among its app's running sandboxes) so `fromName` finds it. */
|
|
359
|
+
setName(name: string): Effect.Effect<void, SandboxOpError<"setName">, R>;
|
|
360
|
+
/** CPU, memory and GPU used so far (core-seconds, GiB-seconds, GPU-seconds). */
|
|
361
|
+
resourceUsage(): Effect.Effect<{
|
|
362
|
+
readonly cpuSeconds: number;
|
|
363
|
+
readonly memoryGibSeconds: number;
|
|
364
|
+
readonly gpuSeconds: number;
|
|
365
|
+
}, SandboxOpError<"getResourceUsage">, R>;
|
|
366
|
+
/**
|
|
367
|
+
* The main process's stdout so far: what the sandbox's command router sends
|
|
368
|
+
* within `timeout` (default 5 seconds), or all of it once the program has
|
|
369
|
+
* exited.
|
|
370
|
+
*/
|
|
371
|
+
logs(options?: {
|
|
372
|
+
readonly timeout?: DurationInput;
|
|
373
|
+
}): Effect.Effect<string, SandboxRouterError<"mainStdio">, R>;
|
|
374
|
+
/** Wait for the sandbox to finish; `undefined` exit code while still running. */
|
|
375
|
+
wait(timeout?: DurationInput): Effect.Effect<{
|
|
376
|
+
readonly exitCode?: number;
|
|
377
|
+
readonly status: string;
|
|
378
|
+
}, SandboxOpError<"wait">, R>;
|
|
379
|
+
/** Terminate the sandbox (no-op when it already finished). */
|
|
380
|
+
terminate(): Effect.Effect<void, Exclude<SandboxOpError<"terminate">, {
|
|
381
|
+
readonly _tag: "SandboxNotFound";
|
|
382
|
+
}>, R>;
|
|
383
|
+
/**
|
|
384
|
+
* A port inside the sandbox, reached through its tunnel: `fetch` sends a
|
|
385
|
+
* client request there, or proxies a server request a handler received;
|
|
386
|
+
* `connect` opens a TCP socket to it. The port needs a tunnel
|
|
387
|
+
* (`encryptedPorts`, `unencryptedPorts` or `h2Ports`); without a port
|
|
388
|
+
* number, the `Modal.Sandbox` program's.
|
|
389
|
+
*/
|
|
390
|
+
getTcpPort(port?: number): Effect.Effect<SandboxPortOf<R>, SandboxPortError, R>;
|
|
391
|
+
}
|
|
392
|
+
/** Looking up a sandbox port's tunnel. */
|
|
393
|
+
export type SandboxPortError = SandboxOpError<"getTunnels"> | SandboxUnexpectedResponse;
|
|
394
|
+
/**
|
|
395
|
+
* A port inside a sandbox, with the tunnel Modal opened to it. `fetch` keeps
|
|
396
|
+
* the request's method, path, query, headers and body, and sends it to the
|
|
397
|
+
* tunnel; given the server request a handler received, it proxies it and
|
|
398
|
+
* returns the server response.
|
|
399
|
+
*/
|
|
400
|
+
export interface SandboxPortOf<R> extends SandboxTunnel {
|
|
401
|
+
fetch(request: HttpClientRequest.HttpClientRequest): Effect.Effect<HttpClientResponse.HttpClientResponse, SandboxPortError | HttpClientError.HttpClientError, R>;
|
|
402
|
+
fetch(request: HttpServerRequest.HttpServerRequest): Effect.Effect<HttpServerResponse.HttpServerResponse, SandboxPortError | HttpClientError.HttpClientError, R>;
|
|
403
|
+
/**
|
|
404
|
+
* A TCP socket to the port through its tunnel: TLS for an encrypted tunnel
|
|
405
|
+
* (`encryptedPorts`), plain TCP for an unencrypted one (`unencryptedPorts`).
|
|
406
|
+
* It connects when run.
|
|
407
|
+
*/
|
|
408
|
+
connect(): Effect.Effect<Socket.Socket>;
|
|
409
|
+
}
|
|
410
|
+
/** A sandbox port as bindings return it. */
|
|
411
|
+
export type SandboxPort = SandboxPortOf<RuntimeContext>;
|
|
412
|
+
/**
|
|
413
|
+
* A sandbox handle as bindings return it: calls run inside a deployed
|
|
414
|
+
* runtime. It has the shared `alchemy/Sandbox` shape plus Modal's own calls.
|
|
415
|
+
*/
|
|
416
|
+
export interface SandboxHandle extends SandboxHandleOf<RuntimeContext>, Sandbox.SandboxExec<SandboxExecError, ExecResult, ExecOptions>, Sandbox.SandboxProcesses<SandboxProcessError, ExecOptions>, Sandbox.SandboxFiles<SandboxFilesError, SandboxFileEntry>, Sandbox.SandboxPty<SandboxPtyError, SandboxPtyOptions>, Sandbox.SandboxPorts<SandboxPortError, SandboxPort> {
|
|
417
|
+
readonly files: SandboxFilesOf<RuntimeContext>;
|
|
418
|
+
getTcpPort(port?: number): Effect.Effect<SandboxPort, SandboxPortError, RuntimeContext>;
|
|
419
|
+
}
|
|
420
|
+
/** A sandbox handle whose calls need Modal credentials and an HTTP client. */
|
|
421
|
+
export type RawSandboxHandle = SandboxHandleOf<never>;
|
|
422
|
+
/** Where a sandbox client creates sandboxes. */
|
|
423
|
+
export interface SandboxTarget {
|
|
424
|
+
readonly appId: string;
|
|
425
|
+
/** Environment of the app (for name lookups and tag updates). */
|
|
426
|
+
readonly environment?: string;
|
|
427
|
+
/** Name of the app (for name lookups). */
|
|
428
|
+
readonly appName?: string;
|
|
429
|
+
/** Image used when `create` names none. */
|
|
430
|
+
readonly imageId?: string;
|
|
431
|
+
/** A `Modal.Sandbox` program: the secret holding its env, its command, its port and mounts. */
|
|
432
|
+
readonly program?: {
|
|
433
|
+
readonly secretId: string;
|
|
434
|
+
readonly command: ReadonlyArray<string>;
|
|
435
|
+
readonly port: number;
|
|
436
|
+
readonly mounts?: ModalMounts;
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* The operations sandbox clients call, resolved once by
|
|
441
|
+
* `ModalBindings.withCredentials` (or at deploy, with the deployer's).
|
|
442
|
+
*/
|
|
443
|
+
export declare const SandboxOps: Effect.Effect<{
|
|
444
|
+
readonly create: (input: sandbox.SandboxCreateV2Request) => Effect.Effect<sandbox.SandboxCreateV2Response, sandbox.SandboxCreateV2Error, never>;
|
|
445
|
+
readonly getFromName: (input: sandbox.SandboxGetFromNameV2Request) => Effect.Effect<sandbox.SandboxGetFromNameV2Response, sandbox.SandboxGetFromNameV2Error, never>;
|
|
446
|
+
readonly list: (input: sandbox.SandboxListV2Request) => Effect.Effect<sandbox.SandboxListV2Response, persistent.ModalOpError, never>;
|
|
447
|
+
readonly restore: (input: sandbox.SandboxRestoreV2Request) => Effect.Effect<sandbox.SandboxRestoreV2Response, sandbox.SandboxRestoreV2Error, never>;
|
|
448
|
+
readonly getTaskId: (input: sandbox.SandboxGetTaskIdV2Request) => Effect.Effect<sandbox.SandboxGetTaskIdV2Response, sandbox.SandboxGetTaskIdV2Error, never>;
|
|
449
|
+
readonly getCommandRouterAccess: (input: sandbox.SandboxGetCommandRouterAccessRequest) => Effect.Effect<sandbox.SandboxGetCommandRouterAccessResponse, sandbox.SandboxGetCommandRouterAccessError, never>;
|
|
450
|
+
readonly getTunnels: (input: sandbox.SandboxGetTunnelsV2Request) => Effect.Effect<sandbox.SandboxGetTunnelsV2Response, sandbox.SandboxGetTunnelsV2Error, never>;
|
|
451
|
+
readonly createConnectToken: (input: sandbox.SandboxCreateConnectTokenV2Request) => Effect.Effect<sandbox.SandboxCreateConnectTokenV2Response, sandbox.SandboxCreateConnectTokenV2Error, never>;
|
|
452
|
+
readonly setOutboundPolicy: (input: sandbox.SandboxSetOutboundPolicyV2Request) => Effect.Effect<sandbox.SandboxSetOutboundPolicyV2Response, persistent.ModalOpError, never>;
|
|
453
|
+
readonly setTags: (input: sandbox.SandboxTagsSetV2Request) => Effect.Effect<sandbox.SandboxTagsSetV2Response, sandbox.SandboxTagsSetV2Error, never>;
|
|
454
|
+
readonly getTags: (input: sandbox.SandboxTagsGetV2Request) => Effect.Effect<sandbox.SandboxTagsGetV2Response, sandbox.SandboxTagsGetV2Error, never>;
|
|
455
|
+
readonly setName: (input: sandbox.SandboxSetNameRequest) => Effect.Effect<sandbox.SandboxSetNameResponse, sandbox.SandboxSetNameError, never>;
|
|
456
|
+
readonly getResourceUsage: (input: sandbox.SandboxGetResourceUsageRequest) => Effect.Effect<sandbox.SandboxGetResourceUsageResponse, sandbox.SandboxGetResourceUsageError, never>;
|
|
457
|
+
readonly wait: (input: sandbox.SandboxWaitV2Request) => Effect.Effect<sandbox.SandboxWaitV2Response, sandbox.SandboxWaitV2Error, never>;
|
|
458
|
+
readonly terminate: (input: sandbox.SandboxTerminateV2Request) => Effect.Effect<sandbox.SandboxTerminateV2Response, sandbox.SandboxTerminateV2Error, never>;
|
|
459
|
+
readonly usage: import("@distilled.cloud/core/api").PaginatedCall<sandbox.SandboxGetTimeRangeStatsRequest, sandbox.SandboxGetTimeRangeStatsResponse, persistent.ModalOpError, never, sandbox.SandboxStatsGroup>;
|
|
460
|
+
readonly createPersistent: (input: persistent.CreatePersistentSandboxRequest) => Effect.Effect<persistent.CreatePersistentSandboxResponse, persistent.CreatePersistentSandboxError, never>;
|
|
461
|
+
readonly getPersistent: (input: persistent.GetPersistentSandboxRequest) => Effect.Effect<persistent.GetPersistentSandboxResponse, persistent.GetPersistentSandboxError, never>;
|
|
462
|
+
readonly resumePersistent: (input: persistent.ResumePersistentSandboxRequest) => Effect.Effect<persistent.ResumePersistentSandboxResponse, persistent.ResumePersistentSandboxError, never>;
|
|
463
|
+
readonly terminatePersistent: (input: persistent.TerminatePersistentSandboxRequest) => Effect.Effect<persistent.TerminatePersistentSandboxResponse, persistent.TerminatePersistentSandboxError, never>;
|
|
464
|
+
readonly images: {
|
|
465
|
+
readonly getOrCreate: (input: import("@distilled.cloud/modal/image").ImageGetOrCreateRequest) => Effect.Effect<import("@distilled.cloud/modal/image").ImageGetOrCreateResponse, persistent.ModalOpError, never>;
|
|
466
|
+
readonly joinStreaming: import("@distilled.cloud/core/api").StreamingCall<import("@distilled.cloud/modal/image").ImageJoinStreamingRequest, import("@distilled.cloud/modal/image").ImageJoinStreamingStream, import("@distilled.cloud/modal/image").ImageJoinStreamingError, never, import("@distilled.cloud/modal/image").ImageJoinStreamingResponse>;
|
|
467
|
+
readonly putFile: (input: import("@distilled.cloud/modal/mount").MountPutFileRequest) => Effect.Effect<import("@distilled.cloud/modal/mount").MountPutFileResponse, persistent.ModalOpError, never>;
|
|
468
|
+
readonly getOrCreateMount: (input: import("@distilled.cloud/modal/mount").MountGetOrCreateRequest) => Effect.Effect<import("@distilled.cloud/modal/mount").MountGetOrCreateResponse, import("@distilled.cloud/modal/mount").MountGetOrCreateError, never>;
|
|
469
|
+
readonly blobs: {
|
|
470
|
+
readonly create: (input: import("@distilled.cloud/modal/blob").CreateBlobRequest) => Effect.Effect<import("@distilled.cloud/modal/blob").CreateBlobResponse, persistent.ModalOpError, never>;
|
|
471
|
+
readonly get: (input: import("@distilled.cloud/modal/blob").GetBlobRequest) => Effect.Effect<import("@distilled.cloud/modal/blob").GetBlobResponse, persistent.ModalOpError, never>;
|
|
472
|
+
readonly http: HttpClient.HttpClient;
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
readonly http: HttpClient.HttpClient;
|
|
476
|
+
}, never, import("./internal.ts").OperationServices>;
|
|
477
|
+
export type SandboxOps = Effect.Success<typeof SandboxOps>;
|
|
478
|
+
/** Task command router operations, resolved per sandbox with its router access. */
|
|
479
|
+
declare const routerOps: {
|
|
480
|
+
execStart: (access: import("./ModalBindings.ts").RouterAccess) => Effect.Effect<(input: router.TaskExecStartRequest) => Effect.Effect<router.TaskExecStartResponse, persistent.ModalOpError, never>, never, never>;
|
|
481
|
+
execStdinWrite: (access: import("./ModalBindings.ts").RouterAccess) => Effect.Effect<(input: router.TaskExecStdinWriteRequest) => Effect.Effect<router.TaskExecStdinWriteResponse, persistent.ModalOpError, never>, never, never>;
|
|
482
|
+
execStdioRead: (access: import("./ModalBindings.ts").RouterAccess) => Effect.Effect<(input: router.TaskExecStdioReadRequest) => Effect.Effect<router.TaskExecStdioReadStream, persistent.ModalOpError, never>, never, never>;
|
|
483
|
+
execWait: (access: import("./ModalBindings.ts").RouterAccess) => Effect.Effect<(input: router.TaskExecWaitRequest) => Effect.Effect<router.TaskExecWaitResponse, persistent.ModalOpError, never>, never, never>;
|
|
484
|
+
execStdioFollow: (access: import("./ModalBindings.ts").RouterAccess) => Effect.Effect<(input: router.TaskExecStdioReadRequest) => Stream.Stream<router.TaskExecStdioReadResponse, persistent.ModalOpError, never>, never, never>;
|
|
485
|
+
snapshotFilesystem: (access: import("./ModalBindings.ts").RouterAccess) => Effect.Effect<(input: router.TaskSnapshotFilesystemRequest) => Effect.Effect<router.TaskSnapshotFilesystemResponse, persistent.ModalOpError, never>, never, never>;
|
|
486
|
+
snapshotMemory: (access: import("./ModalBindings.ts").RouterAccess) => Effect.Effect<(input: router.TaskSnapshotMemoryRequest) => Effect.Effect<router.TaskSnapshotMemoryResponse, persistent.ModalOpError, never>, never, never>;
|
|
487
|
+
snapshotDirectory: (access: import("./ModalBindings.ts").RouterAccess) => Effect.Effect<(input: router.TaskSnapshotDirectoryRequest) => Effect.Effect<router.TaskSnapshotDirectoryResponse, persistent.ModalOpError, never>, never, never>;
|
|
488
|
+
mountDirectory: (access: import("./ModalBindings.ts").RouterAccess) => Effect.Effect<(input: router.TaskMountDirectoryRequest) => Effect.Effect<router.TaskMountDirectoryResponse, persistent.ModalOpError, never>, never, never>;
|
|
489
|
+
setNetworkAccess: (access: import("./ModalBindings.ts").RouterAccess) => Effect.Effect<(input: router.TaskSetNetworkAccessRequest) => Effect.Effect<router.TaskSetNetworkAccessResponse, persistent.ModalOpError, never>, never, never>;
|
|
490
|
+
mainStdio: (access: import("./ModalBindings.ts").RouterAccess) => Effect.Effect<(input: router.SandboxStdioReadV2Request) => Stream.Stream<router.SandboxStdioReadV2Response, persistent.ModalOpError, never>, never, never>;
|
|
491
|
+
};
|
|
492
|
+
/**
|
|
493
|
+
* The image to boot: a `Modal.Image`'s id, or a registry ref built (and
|
|
494
|
+
* cached by Modal) into an image in the target app.
|
|
495
|
+
*/
|
|
496
|
+
export declare const resolveSandboxImage: (ops: {
|
|
497
|
+
readonly create: (input: sandbox.SandboxCreateV2Request) => Effect.Effect<sandbox.SandboxCreateV2Response, sandbox.SandboxCreateV2Error, never>;
|
|
498
|
+
readonly getFromName: (input: sandbox.SandboxGetFromNameV2Request) => Effect.Effect<sandbox.SandboxGetFromNameV2Response, sandbox.SandboxGetFromNameV2Error, never>;
|
|
499
|
+
readonly list: (input: sandbox.SandboxListV2Request) => Effect.Effect<sandbox.SandboxListV2Response, persistent.ModalOpError, never>;
|
|
500
|
+
readonly restore: (input: sandbox.SandboxRestoreV2Request) => Effect.Effect<sandbox.SandboxRestoreV2Response, sandbox.SandboxRestoreV2Error, never>;
|
|
501
|
+
readonly getTaskId: (input: sandbox.SandboxGetTaskIdV2Request) => Effect.Effect<sandbox.SandboxGetTaskIdV2Response, sandbox.SandboxGetTaskIdV2Error, never>;
|
|
502
|
+
readonly getCommandRouterAccess: (input: sandbox.SandboxGetCommandRouterAccessRequest) => Effect.Effect<sandbox.SandboxGetCommandRouterAccessResponse, sandbox.SandboxGetCommandRouterAccessError, never>;
|
|
503
|
+
readonly getTunnels: (input: sandbox.SandboxGetTunnelsV2Request) => Effect.Effect<sandbox.SandboxGetTunnelsV2Response, sandbox.SandboxGetTunnelsV2Error, never>;
|
|
504
|
+
readonly createConnectToken: (input: sandbox.SandboxCreateConnectTokenV2Request) => Effect.Effect<sandbox.SandboxCreateConnectTokenV2Response, sandbox.SandboxCreateConnectTokenV2Error, never>;
|
|
505
|
+
readonly setOutboundPolicy: (input: sandbox.SandboxSetOutboundPolicyV2Request) => Effect.Effect<sandbox.SandboxSetOutboundPolicyV2Response, persistent.ModalOpError, never>;
|
|
506
|
+
readonly setTags: (input: sandbox.SandboxTagsSetV2Request) => Effect.Effect<sandbox.SandboxTagsSetV2Response, sandbox.SandboxTagsSetV2Error, never>;
|
|
507
|
+
readonly getTags: (input: sandbox.SandboxTagsGetV2Request) => Effect.Effect<sandbox.SandboxTagsGetV2Response, sandbox.SandboxTagsGetV2Error, never>;
|
|
508
|
+
readonly setName: (input: sandbox.SandboxSetNameRequest) => Effect.Effect<sandbox.SandboxSetNameResponse, sandbox.SandboxSetNameError, never>;
|
|
509
|
+
readonly getResourceUsage: (input: sandbox.SandboxGetResourceUsageRequest) => Effect.Effect<sandbox.SandboxGetResourceUsageResponse, sandbox.SandboxGetResourceUsageError, never>;
|
|
510
|
+
readonly wait: (input: sandbox.SandboxWaitV2Request) => Effect.Effect<sandbox.SandboxWaitV2Response, sandbox.SandboxWaitV2Error, never>;
|
|
511
|
+
readonly terminate: (input: sandbox.SandboxTerminateV2Request) => Effect.Effect<sandbox.SandboxTerminateV2Response, sandbox.SandboxTerminateV2Error, never>;
|
|
512
|
+
readonly usage: import("@distilled.cloud/core/api").PaginatedCall<sandbox.SandboxGetTimeRangeStatsRequest, sandbox.SandboxGetTimeRangeStatsResponse, persistent.ModalOpError, never, sandbox.SandboxStatsGroup>;
|
|
513
|
+
readonly createPersistent: (input: persistent.CreatePersistentSandboxRequest) => Effect.Effect<persistent.CreatePersistentSandboxResponse, persistent.CreatePersistentSandboxError, never>;
|
|
514
|
+
readonly getPersistent: (input: persistent.GetPersistentSandboxRequest) => Effect.Effect<persistent.GetPersistentSandboxResponse, persistent.GetPersistentSandboxError, never>;
|
|
515
|
+
readonly resumePersistent: (input: persistent.ResumePersistentSandboxRequest) => Effect.Effect<persistent.ResumePersistentSandboxResponse, persistent.ResumePersistentSandboxError, never>;
|
|
516
|
+
readonly terminatePersistent: (input: persistent.TerminatePersistentSandboxRequest) => Effect.Effect<persistent.TerminatePersistentSandboxResponse, persistent.TerminatePersistentSandboxError, never>;
|
|
517
|
+
readonly images: {
|
|
518
|
+
readonly getOrCreate: (input: import("@distilled.cloud/modal/image").ImageGetOrCreateRequest) => Effect.Effect<import("@distilled.cloud/modal/image").ImageGetOrCreateResponse, persistent.ModalOpError, never>;
|
|
519
|
+
readonly joinStreaming: import("@distilled.cloud/core/api").StreamingCall<import("@distilled.cloud/modal/image").ImageJoinStreamingRequest, import("@distilled.cloud/modal/image").ImageJoinStreamingStream, import("@distilled.cloud/modal/image").ImageJoinStreamingError, never, import("@distilled.cloud/modal/image").ImageJoinStreamingResponse>;
|
|
520
|
+
readonly putFile: (input: import("@distilled.cloud/modal/mount").MountPutFileRequest) => Effect.Effect<import("@distilled.cloud/modal/mount").MountPutFileResponse, persistent.ModalOpError, never>;
|
|
521
|
+
readonly getOrCreateMount: (input: import("@distilled.cloud/modal/mount").MountGetOrCreateRequest) => Effect.Effect<import("@distilled.cloud/modal/mount").MountGetOrCreateResponse, import("@distilled.cloud/modal/mount").MountGetOrCreateError, never>;
|
|
522
|
+
readonly blobs: {
|
|
523
|
+
readonly create: (input: import("@distilled.cloud/modal/blob").CreateBlobRequest) => Effect.Effect<import("@distilled.cloud/modal/blob").CreateBlobResponse, persistent.ModalOpError, never>;
|
|
524
|
+
readonly get: (input: import("@distilled.cloud/modal/blob").GetBlobRequest) => Effect.Effect<import("@distilled.cloud/modal/blob").GetBlobResponse, persistent.ModalOpError, never>;
|
|
525
|
+
readonly http: HttpClient.HttpClient;
|
|
526
|
+
};
|
|
527
|
+
};
|
|
528
|
+
readonly http: HttpClient.HttpClient;
|
|
529
|
+
}, target: SandboxTarget, image: SandboxImage | undefined) => Effect.Effect<string, import("@distilled.cloud/core/errors").BadGateway | import("./Blob.ts").BlobTransferFailed | import("@distilled.cloud/core/config").ConfigError | import("@distilled.cloud/core/errors").GatewayTimeout | HttpClientError.HttpClientError | import("./ImageBuild.ts").ImageBuildFailed | import("./ImageBuild.ts").ImageBuildTimeout | import("./ImageBuild.ts").ImageBuildUnexpectedResponse | import("@distilled.cloud/modal/image").ImageNotFound | import("@distilled.cloud/core/errors").InternalServerError | import("@distilled.cloud/core/protocol-http").InvalidInput | import("@distilled.cloud/modal/Errors").ModalParseError | import("@distilled.cloud/modal/mount").MountNotFound | import("@distilled.cloud/core/sdk-error").SdkError | import("@distilled.cloud/core/errors").ServiceUnavailable | import("@distilled.cloud/core/errors").TooManyRequests | import("@distilled.cloud/core/errors").Unauthorized | import("@distilled.cloud/modal/Errors").UnknownModalError, never>;
|
|
530
|
+
/** The handle for an existing sandbox id. */
|
|
531
|
+
export declare const sandboxHandle: (ops: SandboxOps, sandboxId: string, target: Pick<SandboxTarget, "environment" | "program">) => RawSandboxHandle;
|
|
532
|
+
/**
|
|
533
|
+
* Create a sandbox in `target`'s app and return its handle. The one
|
|
534
|
+
* implementation behind `CreateSandbox` and warm-base image builds.
|
|
535
|
+
*/
|
|
536
|
+
export declare const createSandbox: (ops: {
|
|
537
|
+
readonly create: (input: sandbox.SandboxCreateV2Request) => Effect.Effect<sandbox.SandboxCreateV2Response, sandbox.SandboxCreateV2Error, never>;
|
|
538
|
+
readonly getFromName: (input: sandbox.SandboxGetFromNameV2Request) => Effect.Effect<sandbox.SandboxGetFromNameV2Response, sandbox.SandboxGetFromNameV2Error, never>;
|
|
539
|
+
readonly list: (input: sandbox.SandboxListV2Request) => Effect.Effect<sandbox.SandboxListV2Response, persistent.ModalOpError, never>;
|
|
540
|
+
readonly restore: (input: sandbox.SandboxRestoreV2Request) => Effect.Effect<sandbox.SandboxRestoreV2Response, sandbox.SandboxRestoreV2Error, never>;
|
|
541
|
+
readonly getTaskId: (input: sandbox.SandboxGetTaskIdV2Request) => Effect.Effect<sandbox.SandboxGetTaskIdV2Response, sandbox.SandboxGetTaskIdV2Error, never>;
|
|
542
|
+
readonly getCommandRouterAccess: (input: sandbox.SandboxGetCommandRouterAccessRequest) => Effect.Effect<sandbox.SandboxGetCommandRouterAccessResponse, sandbox.SandboxGetCommandRouterAccessError, never>;
|
|
543
|
+
readonly getTunnels: (input: sandbox.SandboxGetTunnelsV2Request) => Effect.Effect<sandbox.SandboxGetTunnelsV2Response, sandbox.SandboxGetTunnelsV2Error, never>;
|
|
544
|
+
readonly createConnectToken: (input: sandbox.SandboxCreateConnectTokenV2Request) => Effect.Effect<sandbox.SandboxCreateConnectTokenV2Response, sandbox.SandboxCreateConnectTokenV2Error, never>;
|
|
545
|
+
readonly setOutboundPolicy: (input: sandbox.SandboxSetOutboundPolicyV2Request) => Effect.Effect<sandbox.SandboxSetOutboundPolicyV2Response, persistent.ModalOpError, never>;
|
|
546
|
+
readonly setTags: (input: sandbox.SandboxTagsSetV2Request) => Effect.Effect<sandbox.SandboxTagsSetV2Response, sandbox.SandboxTagsSetV2Error, never>;
|
|
547
|
+
readonly getTags: (input: sandbox.SandboxTagsGetV2Request) => Effect.Effect<sandbox.SandboxTagsGetV2Response, sandbox.SandboxTagsGetV2Error, never>;
|
|
548
|
+
readonly setName: (input: sandbox.SandboxSetNameRequest) => Effect.Effect<sandbox.SandboxSetNameResponse, sandbox.SandboxSetNameError, never>;
|
|
549
|
+
readonly getResourceUsage: (input: sandbox.SandboxGetResourceUsageRequest) => Effect.Effect<sandbox.SandboxGetResourceUsageResponse, sandbox.SandboxGetResourceUsageError, never>;
|
|
550
|
+
readonly wait: (input: sandbox.SandboxWaitV2Request) => Effect.Effect<sandbox.SandboxWaitV2Response, sandbox.SandboxWaitV2Error, never>;
|
|
551
|
+
readonly terminate: (input: sandbox.SandboxTerminateV2Request) => Effect.Effect<sandbox.SandboxTerminateV2Response, sandbox.SandboxTerminateV2Error, never>;
|
|
552
|
+
readonly usage: import("@distilled.cloud/core/api").PaginatedCall<sandbox.SandboxGetTimeRangeStatsRequest, sandbox.SandboxGetTimeRangeStatsResponse, persistent.ModalOpError, never, sandbox.SandboxStatsGroup>;
|
|
553
|
+
readonly createPersistent: (input: persistent.CreatePersistentSandboxRequest) => Effect.Effect<persistent.CreatePersistentSandboxResponse, persistent.CreatePersistentSandboxError, never>;
|
|
554
|
+
readonly getPersistent: (input: persistent.GetPersistentSandboxRequest) => Effect.Effect<persistent.GetPersistentSandboxResponse, persistent.GetPersistentSandboxError, never>;
|
|
555
|
+
readonly resumePersistent: (input: persistent.ResumePersistentSandboxRequest) => Effect.Effect<persistent.ResumePersistentSandboxResponse, persistent.ResumePersistentSandboxError, never>;
|
|
556
|
+
readonly terminatePersistent: (input: persistent.TerminatePersistentSandboxRequest) => Effect.Effect<persistent.TerminatePersistentSandboxResponse, persistent.TerminatePersistentSandboxError, never>;
|
|
557
|
+
readonly images: {
|
|
558
|
+
readonly getOrCreate: (input: import("@distilled.cloud/modal/image").ImageGetOrCreateRequest) => Effect.Effect<import("@distilled.cloud/modal/image").ImageGetOrCreateResponse, persistent.ModalOpError, never>;
|
|
559
|
+
readonly joinStreaming: import("@distilled.cloud/core/api").StreamingCall<import("@distilled.cloud/modal/image").ImageJoinStreamingRequest, import("@distilled.cloud/modal/image").ImageJoinStreamingStream, import("@distilled.cloud/modal/image").ImageJoinStreamingError, never, import("@distilled.cloud/modal/image").ImageJoinStreamingResponse>;
|
|
560
|
+
readonly putFile: (input: import("@distilled.cloud/modal/mount").MountPutFileRequest) => Effect.Effect<import("@distilled.cloud/modal/mount").MountPutFileResponse, persistent.ModalOpError, never>;
|
|
561
|
+
readonly getOrCreateMount: (input: import("@distilled.cloud/modal/mount").MountGetOrCreateRequest) => Effect.Effect<import("@distilled.cloud/modal/mount").MountGetOrCreateResponse, import("@distilled.cloud/modal/mount").MountGetOrCreateError, never>;
|
|
562
|
+
readonly blobs: {
|
|
563
|
+
readonly create: (input: import("@distilled.cloud/modal/blob").CreateBlobRequest) => Effect.Effect<import("@distilled.cloud/modal/blob").CreateBlobResponse, persistent.ModalOpError, never>;
|
|
564
|
+
readonly get: (input: import("@distilled.cloud/modal/blob").GetBlobRequest) => Effect.Effect<import("@distilled.cloud/modal/blob").GetBlobResponse, persistent.ModalOpError, never>;
|
|
565
|
+
readonly http: HttpClient.HttpClient;
|
|
566
|
+
};
|
|
567
|
+
};
|
|
568
|
+
readonly http: HttpClient.HttpClient;
|
|
569
|
+
}, target: SandboxTarget, options?: SandboxCreateOptions | undefined) => Effect.Effect<RawSandboxHandle, import("./Blob.ts").BlobTransferFailed | import("./ImageBuild.ts").ImageBuildFailed | import("./ImageBuild.ts").ImageBuildTimeout | import("./ImageBuild.ts").ImageBuildUnexpectedResponse | import("@distilled.cloud/modal/image").ImageNotFound | import("./Mounts.ts").MountNotBound | import("@distilled.cloud/modal/mount").MountNotFound | SandboxUnexpectedResponse | sandbox.SandboxCreateV2Error, never>;
|
|
570
|
+
/** A running sandbox of `target`'s app by name, or `undefined`. */
|
|
571
|
+
export declare const sandboxFromName: (ops: {
|
|
572
|
+
readonly create: (input: sandbox.SandboxCreateV2Request) => Effect.Effect<sandbox.SandboxCreateV2Response, sandbox.SandboxCreateV2Error, never>;
|
|
573
|
+
readonly getFromName: (input: sandbox.SandboxGetFromNameV2Request) => Effect.Effect<sandbox.SandboxGetFromNameV2Response, sandbox.SandboxGetFromNameV2Error, never>;
|
|
574
|
+
readonly list: (input: sandbox.SandboxListV2Request) => Effect.Effect<sandbox.SandboxListV2Response, persistent.ModalOpError, never>;
|
|
575
|
+
readonly restore: (input: sandbox.SandboxRestoreV2Request) => Effect.Effect<sandbox.SandboxRestoreV2Response, sandbox.SandboxRestoreV2Error, never>;
|
|
576
|
+
readonly getTaskId: (input: sandbox.SandboxGetTaskIdV2Request) => Effect.Effect<sandbox.SandboxGetTaskIdV2Response, sandbox.SandboxGetTaskIdV2Error, never>;
|
|
577
|
+
readonly getCommandRouterAccess: (input: sandbox.SandboxGetCommandRouterAccessRequest) => Effect.Effect<sandbox.SandboxGetCommandRouterAccessResponse, sandbox.SandboxGetCommandRouterAccessError, never>;
|
|
578
|
+
readonly getTunnels: (input: sandbox.SandboxGetTunnelsV2Request) => Effect.Effect<sandbox.SandboxGetTunnelsV2Response, sandbox.SandboxGetTunnelsV2Error, never>;
|
|
579
|
+
readonly createConnectToken: (input: sandbox.SandboxCreateConnectTokenV2Request) => Effect.Effect<sandbox.SandboxCreateConnectTokenV2Response, sandbox.SandboxCreateConnectTokenV2Error, never>;
|
|
580
|
+
readonly setOutboundPolicy: (input: sandbox.SandboxSetOutboundPolicyV2Request) => Effect.Effect<sandbox.SandboxSetOutboundPolicyV2Response, persistent.ModalOpError, never>;
|
|
581
|
+
readonly setTags: (input: sandbox.SandboxTagsSetV2Request) => Effect.Effect<sandbox.SandboxTagsSetV2Response, sandbox.SandboxTagsSetV2Error, never>;
|
|
582
|
+
readonly getTags: (input: sandbox.SandboxTagsGetV2Request) => Effect.Effect<sandbox.SandboxTagsGetV2Response, sandbox.SandboxTagsGetV2Error, never>;
|
|
583
|
+
readonly setName: (input: sandbox.SandboxSetNameRequest) => Effect.Effect<sandbox.SandboxSetNameResponse, sandbox.SandboxSetNameError, never>;
|
|
584
|
+
readonly getResourceUsage: (input: sandbox.SandboxGetResourceUsageRequest) => Effect.Effect<sandbox.SandboxGetResourceUsageResponse, sandbox.SandboxGetResourceUsageError, never>;
|
|
585
|
+
readonly wait: (input: sandbox.SandboxWaitV2Request) => Effect.Effect<sandbox.SandboxWaitV2Response, sandbox.SandboxWaitV2Error, never>;
|
|
586
|
+
readonly terminate: (input: sandbox.SandboxTerminateV2Request) => Effect.Effect<sandbox.SandboxTerminateV2Response, sandbox.SandboxTerminateV2Error, never>;
|
|
587
|
+
readonly usage: import("@distilled.cloud/core/api").PaginatedCall<sandbox.SandboxGetTimeRangeStatsRequest, sandbox.SandboxGetTimeRangeStatsResponse, persistent.ModalOpError, never, sandbox.SandboxStatsGroup>;
|
|
588
|
+
readonly createPersistent: (input: persistent.CreatePersistentSandboxRequest) => Effect.Effect<persistent.CreatePersistentSandboxResponse, persistent.CreatePersistentSandboxError, never>;
|
|
589
|
+
readonly getPersistent: (input: persistent.GetPersistentSandboxRequest) => Effect.Effect<persistent.GetPersistentSandboxResponse, persistent.GetPersistentSandboxError, never>;
|
|
590
|
+
readonly resumePersistent: (input: persistent.ResumePersistentSandboxRequest) => Effect.Effect<persistent.ResumePersistentSandboxResponse, persistent.ResumePersistentSandboxError, never>;
|
|
591
|
+
readonly terminatePersistent: (input: persistent.TerminatePersistentSandboxRequest) => Effect.Effect<persistent.TerminatePersistentSandboxResponse, persistent.TerminatePersistentSandboxError, never>;
|
|
592
|
+
readonly images: {
|
|
593
|
+
readonly getOrCreate: (input: import("@distilled.cloud/modal/image").ImageGetOrCreateRequest) => Effect.Effect<import("@distilled.cloud/modal/image").ImageGetOrCreateResponse, persistent.ModalOpError, never>;
|
|
594
|
+
readonly joinStreaming: import("@distilled.cloud/core/api").StreamingCall<import("@distilled.cloud/modal/image").ImageJoinStreamingRequest, import("@distilled.cloud/modal/image").ImageJoinStreamingStream, import("@distilled.cloud/modal/image").ImageJoinStreamingError, never, import("@distilled.cloud/modal/image").ImageJoinStreamingResponse>;
|
|
595
|
+
readonly putFile: (input: import("@distilled.cloud/modal/mount").MountPutFileRequest) => Effect.Effect<import("@distilled.cloud/modal/mount").MountPutFileResponse, persistent.ModalOpError, never>;
|
|
596
|
+
readonly getOrCreateMount: (input: import("@distilled.cloud/modal/mount").MountGetOrCreateRequest) => Effect.Effect<import("@distilled.cloud/modal/mount").MountGetOrCreateResponse, import("@distilled.cloud/modal/mount").MountGetOrCreateError, never>;
|
|
597
|
+
readonly blobs: {
|
|
598
|
+
readonly create: (input: import("@distilled.cloud/modal/blob").CreateBlobRequest) => Effect.Effect<import("@distilled.cloud/modal/blob").CreateBlobResponse, persistent.ModalOpError, never>;
|
|
599
|
+
readonly get: (input: import("@distilled.cloud/modal/blob").GetBlobRequest) => Effect.Effect<import("@distilled.cloud/modal/blob").GetBlobResponse, persistent.ModalOpError, never>;
|
|
600
|
+
readonly http: HttpClient.HttpClient;
|
|
601
|
+
};
|
|
602
|
+
};
|
|
603
|
+
readonly http: HttpClient.HttpClient;
|
|
604
|
+
}, target: SandboxTarget, name: string) => Effect.Effect<RawSandboxHandle | undefined, persistent.ModalOpError, never>;
|
|
605
|
+
/** Running sandboxes of `target`'s app, optionally filtered by tags. */
|
|
606
|
+
export declare const listSandboxes: (ops: {
|
|
607
|
+
readonly create: (input: sandbox.SandboxCreateV2Request) => Effect.Effect<sandbox.SandboxCreateV2Response, sandbox.SandboxCreateV2Error, never>;
|
|
608
|
+
readonly getFromName: (input: sandbox.SandboxGetFromNameV2Request) => Effect.Effect<sandbox.SandboxGetFromNameV2Response, sandbox.SandboxGetFromNameV2Error, never>;
|
|
609
|
+
readonly list: (input: sandbox.SandboxListV2Request) => Effect.Effect<sandbox.SandboxListV2Response, persistent.ModalOpError, never>;
|
|
610
|
+
readonly restore: (input: sandbox.SandboxRestoreV2Request) => Effect.Effect<sandbox.SandboxRestoreV2Response, sandbox.SandboxRestoreV2Error, never>;
|
|
611
|
+
readonly getTaskId: (input: sandbox.SandboxGetTaskIdV2Request) => Effect.Effect<sandbox.SandboxGetTaskIdV2Response, sandbox.SandboxGetTaskIdV2Error, never>;
|
|
612
|
+
readonly getCommandRouterAccess: (input: sandbox.SandboxGetCommandRouterAccessRequest) => Effect.Effect<sandbox.SandboxGetCommandRouterAccessResponse, sandbox.SandboxGetCommandRouterAccessError, never>;
|
|
613
|
+
readonly getTunnels: (input: sandbox.SandboxGetTunnelsV2Request) => Effect.Effect<sandbox.SandboxGetTunnelsV2Response, sandbox.SandboxGetTunnelsV2Error, never>;
|
|
614
|
+
readonly createConnectToken: (input: sandbox.SandboxCreateConnectTokenV2Request) => Effect.Effect<sandbox.SandboxCreateConnectTokenV2Response, sandbox.SandboxCreateConnectTokenV2Error, never>;
|
|
615
|
+
readonly setOutboundPolicy: (input: sandbox.SandboxSetOutboundPolicyV2Request) => Effect.Effect<sandbox.SandboxSetOutboundPolicyV2Response, persistent.ModalOpError, never>;
|
|
616
|
+
readonly setTags: (input: sandbox.SandboxTagsSetV2Request) => Effect.Effect<sandbox.SandboxTagsSetV2Response, sandbox.SandboxTagsSetV2Error, never>;
|
|
617
|
+
readonly getTags: (input: sandbox.SandboxTagsGetV2Request) => Effect.Effect<sandbox.SandboxTagsGetV2Response, sandbox.SandboxTagsGetV2Error, never>;
|
|
618
|
+
readonly setName: (input: sandbox.SandboxSetNameRequest) => Effect.Effect<sandbox.SandboxSetNameResponse, sandbox.SandboxSetNameError, never>;
|
|
619
|
+
readonly getResourceUsage: (input: sandbox.SandboxGetResourceUsageRequest) => Effect.Effect<sandbox.SandboxGetResourceUsageResponse, sandbox.SandboxGetResourceUsageError, never>;
|
|
620
|
+
readonly wait: (input: sandbox.SandboxWaitV2Request) => Effect.Effect<sandbox.SandboxWaitV2Response, sandbox.SandboxWaitV2Error, never>;
|
|
621
|
+
readonly terminate: (input: sandbox.SandboxTerminateV2Request) => Effect.Effect<sandbox.SandboxTerminateV2Response, sandbox.SandboxTerminateV2Error, never>;
|
|
622
|
+
readonly usage: import("@distilled.cloud/core/api").PaginatedCall<sandbox.SandboxGetTimeRangeStatsRequest, sandbox.SandboxGetTimeRangeStatsResponse, persistent.ModalOpError, never, sandbox.SandboxStatsGroup>;
|
|
623
|
+
readonly createPersistent: (input: persistent.CreatePersistentSandboxRequest) => Effect.Effect<persistent.CreatePersistentSandboxResponse, persistent.CreatePersistentSandboxError, never>;
|
|
624
|
+
readonly getPersistent: (input: persistent.GetPersistentSandboxRequest) => Effect.Effect<persistent.GetPersistentSandboxResponse, persistent.GetPersistentSandboxError, never>;
|
|
625
|
+
readonly resumePersistent: (input: persistent.ResumePersistentSandboxRequest) => Effect.Effect<persistent.ResumePersistentSandboxResponse, persistent.ResumePersistentSandboxError, never>;
|
|
626
|
+
readonly terminatePersistent: (input: persistent.TerminatePersistentSandboxRequest) => Effect.Effect<persistent.TerminatePersistentSandboxResponse, persistent.TerminatePersistentSandboxError, never>;
|
|
627
|
+
readonly images: {
|
|
628
|
+
readonly getOrCreate: (input: import("@distilled.cloud/modal/image").ImageGetOrCreateRequest) => Effect.Effect<import("@distilled.cloud/modal/image").ImageGetOrCreateResponse, persistent.ModalOpError, never>;
|
|
629
|
+
readonly joinStreaming: import("@distilled.cloud/core/api").StreamingCall<import("@distilled.cloud/modal/image").ImageJoinStreamingRequest, import("@distilled.cloud/modal/image").ImageJoinStreamingStream, import("@distilled.cloud/modal/image").ImageJoinStreamingError, never, import("@distilled.cloud/modal/image").ImageJoinStreamingResponse>;
|
|
630
|
+
readonly putFile: (input: import("@distilled.cloud/modal/mount").MountPutFileRequest) => Effect.Effect<import("@distilled.cloud/modal/mount").MountPutFileResponse, persistent.ModalOpError, never>;
|
|
631
|
+
readonly getOrCreateMount: (input: import("@distilled.cloud/modal/mount").MountGetOrCreateRequest) => Effect.Effect<import("@distilled.cloud/modal/mount").MountGetOrCreateResponse, import("@distilled.cloud/modal/mount").MountGetOrCreateError, never>;
|
|
632
|
+
readonly blobs: {
|
|
633
|
+
readonly create: (input: import("@distilled.cloud/modal/blob").CreateBlobRequest) => Effect.Effect<import("@distilled.cloud/modal/blob").CreateBlobResponse, persistent.ModalOpError, never>;
|
|
634
|
+
readonly get: (input: import("@distilled.cloud/modal/blob").GetBlobRequest) => Effect.Effect<import("@distilled.cloud/modal/blob").GetBlobResponse, persistent.ModalOpError, never>;
|
|
635
|
+
readonly http: HttpClient.HttpClient;
|
|
636
|
+
};
|
|
637
|
+
};
|
|
638
|
+
readonly http: HttpClient.HttpClient;
|
|
639
|
+
}, target: SandboxTarget, options?: {
|
|
640
|
+
readonly tags?: Record<string, string>;
|
|
641
|
+
readonly includeFinished?: boolean;
|
|
642
|
+
} | undefined) => Effect.Effect<{
|
|
643
|
+
sandboxId: string;
|
|
644
|
+
name: string | undefined;
|
|
645
|
+
createdAt: number;
|
|
646
|
+
tags: {
|
|
647
|
+
[k: string]: string;
|
|
648
|
+
};
|
|
649
|
+
}[], persistent.ModalOpError, never>;
|
|
650
|
+
/** Restore a memory snapshot into a new sandbox. */
|
|
651
|
+
export declare const restoreSandbox: (ops: {
|
|
652
|
+
readonly create: (input: sandbox.SandboxCreateV2Request) => Effect.Effect<sandbox.SandboxCreateV2Response, sandbox.SandboxCreateV2Error, never>;
|
|
653
|
+
readonly getFromName: (input: sandbox.SandboxGetFromNameV2Request) => Effect.Effect<sandbox.SandboxGetFromNameV2Response, sandbox.SandboxGetFromNameV2Error, never>;
|
|
654
|
+
readonly list: (input: sandbox.SandboxListV2Request) => Effect.Effect<sandbox.SandboxListV2Response, persistent.ModalOpError, never>;
|
|
655
|
+
readonly restore: (input: sandbox.SandboxRestoreV2Request) => Effect.Effect<sandbox.SandboxRestoreV2Response, sandbox.SandboxRestoreV2Error, never>;
|
|
656
|
+
readonly getTaskId: (input: sandbox.SandboxGetTaskIdV2Request) => Effect.Effect<sandbox.SandboxGetTaskIdV2Response, sandbox.SandboxGetTaskIdV2Error, never>;
|
|
657
|
+
readonly getCommandRouterAccess: (input: sandbox.SandboxGetCommandRouterAccessRequest) => Effect.Effect<sandbox.SandboxGetCommandRouterAccessResponse, sandbox.SandboxGetCommandRouterAccessError, never>;
|
|
658
|
+
readonly getTunnels: (input: sandbox.SandboxGetTunnelsV2Request) => Effect.Effect<sandbox.SandboxGetTunnelsV2Response, sandbox.SandboxGetTunnelsV2Error, never>;
|
|
659
|
+
readonly createConnectToken: (input: sandbox.SandboxCreateConnectTokenV2Request) => Effect.Effect<sandbox.SandboxCreateConnectTokenV2Response, sandbox.SandboxCreateConnectTokenV2Error, never>;
|
|
660
|
+
readonly setOutboundPolicy: (input: sandbox.SandboxSetOutboundPolicyV2Request) => Effect.Effect<sandbox.SandboxSetOutboundPolicyV2Response, persistent.ModalOpError, never>;
|
|
661
|
+
readonly setTags: (input: sandbox.SandboxTagsSetV2Request) => Effect.Effect<sandbox.SandboxTagsSetV2Response, sandbox.SandboxTagsSetV2Error, never>;
|
|
662
|
+
readonly getTags: (input: sandbox.SandboxTagsGetV2Request) => Effect.Effect<sandbox.SandboxTagsGetV2Response, sandbox.SandboxTagsGetV2Error, never>;
|
|
663
|
+
readonly setName: (input: sandbox.SandboxSetNameRequest) => Effect.Effect<sandbox.SandboxSetNameResponse, sandbox.SandboxSetNameError, never>;
|
|
664
|
+
readonly getResourceUsage: (input: sandbox.SandboxGetResourceUsageRequest) => Effect.Effect<sandbox.SandboxGetResourceUsageResponse, sandbox.SandboxGetResourceUsageError, never>;
|
|
665
|
+
readonly wait: (input: sandbox.SandboxWaitV2Request) => Effect.Effect<sandbox.SandboxWaitV2Response, sandbox.SandboxWaitV2Error, never>;
|
|
666
|
+
readonly terminate: (input: sandbox.SandboxTerminateV2Request) => Effect.Effect<sandbox.SandboxTerminateV2Response, sandbox.SandboxTerminateV2Error, never>;
|
|
667
|
+
readonly usage: import("@distilled.cloud/core/api").PaginatedCall<sandbox.SandboxGetTimeRangeStatsRequest, sandbox.SandboxGetTimeRangeStatsResponse, persistent.ModalOpError, never, sandbox.SandboxStatsGroup>;
|
|
668
|
+
readonly createPersistent: (input: persistent.CreatePersistentSandboxRequest) => Effect.Effect<persistent.CreatePersistentSandboxResponse, persistent.CreatePersistentSandboxError, never>;
|
|
669
|
+
readonly getPersistent: (input: persistent.GetPersistentSandboxRequest) => Effect.Effect<persistent.GetPersistentSandboxResponse, persistent.GetPersistentSandboxError, never>;
|
|
670
|
+
readonly resumePersistent: (input: persistent.ResumePersistentSandboxRequest) => Effect.Effect<persistent.ResumePersistentSandboxResponse, persistent.ResumePersistentSandboxError, never>;
|
|
671
|
+
readonly terminatePersistent: (input: persistent.TerminatePersistentSandboxRequest) => Effect.Effect<persistent.TerminatePersistentSandboxResponse, persistent.TerminatePersistentSandboxError, never>;
|
|
672
|
+
readonly images: {
|
|
673
|
+
readonly getOrCreate: (input: import("@distilled.cloud/modal/image").ImageGetOrCreateRequest) => Effect.Effect<import("@distilled.cloud/modal/image").ImageGetOrCreateResponse, persistent.ModalOpError, never>;
|
|
674
|
+
readonly joinStreaming: import("@distilled.cloud/core/api").StreamingCall<import("@distilled.cloud/modal/image").ImageJoinStreamingRequest, import("@distilled.cloud/modal/image").ImageJoinStreamingStream, import("@distilled.cloud/modal/image").ImageJoinStreamingError, never, import("@distilled.cloud/modal/image").ImageJoinStreamingResponse>;
|
|
675
|
+
readonly putFile: (input: import("@distilled.cloud/modal/mount").MountPutFileRequest) => Effect.Effect<import("@distilled.cloud/modal/mount").MountPutFileResponse, persistent.ModalOpError, never>;
|
|
676
|
+
readonly getOrCreateMount: (input: import("@distilled.cloud/modal/mount").MountGetOrCreateRequest) => Effect.Effect<import("@distilled.cloud/modal/mount").MountGetOrCreateResponse, import("@distilled.cloud/modal/mount").MountGetOrCreateError, never>;
|
|
677
|
+
readonly blobs: {
|
|
678
|
+
readonly create: (input: import("@distilled.cloud/modal/blob").CreateBlobRequest) => Effect.Effect<import("@distilled.cloud/modal/blob").CreateBlobResponse, persistent.ModalOpError, never>;
|
|
679
|
+
readonly get: (input: import("@distilled.cloud/modal/blob").GetBlobRequest) => Effect.Effect<import("@distilled.cloud/modal/blob").GetBlobResponse, persistent.ModalOpError, never>;
|
|
680
|
+
readonly http: HttpClient.HttpClient;
|
|
681
|
+
};
|
|
682
|
+
};
|
|
683
|
+
readonly http: HttpClient.HttpClient;
|
|
684
|
+
}, target: SandboxTarget, snapshot: {
|
|
685
|
+
readonly snapshotId: string;
|
|
686
|
+
}, options?: {
|
|
687
|
+
readonly name?: string;
|
|
688
|
+
} | undefined) => Effect.Effect<RawSandboxHandle, SandboxUnexpectedResponse | sandbox.SandboxRestoreV2Error, never>;
|
|
689
|
+
/**
|
|
690
|
+
* Options for a persistent sandbox. Modal fixes each session's lifetime (an
|
|
691
|
+
* hour, paused after five idle minutes) and doesn't support names, GPUs,
|
|
692
|
+
* `env`, tags or memory snapshots on persistent sandboxes yet.
|
|
693
|
+
*/
|
|
694
|
+
export type PersistentSandboxCreateOptions = Omit<SandboxCreateOptions, "timeout" | "idleTimeout" | "name" | "gpu" | "env" | "tags" | "enableSnapshot">;
|
|
695
|
+
/** A persistent sandbox: one box whose filesystem outlives its sessions. */
|
|
696
|
+
export interface PersistentSandboxHandleOf<R> {
|
|
697
|
+
readonly persistentSandboxId: string;
|
|
698
|
+
/**
|
|
699
|
+
* The running session, resuming the box from its last session's
|
|
700
|
+
* filesystem when it's paused.
|
|
701
|
+
*/
|
|
702
|
+
session(): Effect.Effect<SandboxHandleOf<R>, SandboxOpError<"getPersistent"> | SandboxOpError<"resumePersistent"> | SandboxUnexpectedResponse, R>;
|
|
703
|
+
/** Terminate the box for good. */
|
|
704
|
+
terminate(): Effect.Effect<void, Exclude<SandboxOpError<"terminatePersistent">, {
|
|
705
|
+
readonly _tag: "PersistentSandboxNotFound";
|
|
706
|
+
}>, R>;
|
|
707
|
+
}
|
|
708
|
+
export type RawPersistentSandboxHandle = PersistentSandboxHandleOf<never>;
|
|
709
|
+
export type PersistentSandboxHandle = PersistentSandboxHandleOf<RuntimeContext>;
|
|
710
|
+
/** The handle for an existing persistent sandbox id. */
|
|
711
|
+
export declare const persistentSandboxHandle: (ops: SandboxOps, persistentSandboxId: string, target: Pick<SandboxTarget, "environment" | "program">) => RawPersistentSandboxHandle;
|
|
712
|
+
/** Create a persistent sandbox in `target`'s app. */
|
|
713
|
+
export declare const createPersistentSandbox: (ops: {
|
|
714
|
+
readonly create: (input: sandbox.SandboxCreateV2Request) => Effect.Effect<sandbox.SandboxCreateV2Response, sandbox.SandboxCreateV2Error, never>;
|
|
715
|
+
readonly getFromName: (input: sandbox.SandboxGetFromNameV2Request) => Effect.Effect<sandbox.SandboxGetFromNameV2Response, sandbox.SandboxGetFromNameV2Error, never>;
|
|
716
|
+
readonly list: (input: sandbox.SandboxListV2Request) => Effect.Effect<sandbox.SandboxListV2Response, persistent.ModalOpError, never>;
|
|
717
|
+
readonly restore: (input: sandbox.SandboxRestoreV2Request) => Effect.Effect<sandbox.SandboxRestoreV2Response, sandbox.SandboxRestoreV2Error, never>;
|
|
718
|
+
readonly getTaskId: (input: sandbox.SandboxGetTaskIdV2Request) => Effect.Effect<sandbox.SandboxGetTaskIdV2Response, sandbox.SandboxGetTaskIdV2Error, never>;
|
|
719
|
+
readonly getCommandRouterAccess: (input: sandbox.SandboxGetCommandRouterAccessRequest) => Effect.Effect<sandbox.SandboxGetCommandRouterAccessResponse, sandbox.SandboxGetCommandRouterAccessError, never>;
|
|
720
|
+
readonly getTunnels: (input: sandbox.SandboxGetTunnelsV2Request) => Effect.Effect<sandbox.SandboxGetTunnelsV2Response, sandbox.SandboxGetTunnelsV2Error, never>;
|
|
721
|
+
readonly createConnectToken: (input: sandbox.SandboxCreateConnectTokenV2Request) => Effect.Effect<sandbox.SandboxCreateConnectTokenV2Response, sandbox.SandboxCreateConnectTokenV2Error, never>;
|
|
722
|
+
readonly setOutboundPolicy: (input: sandbox.SandboxSetOutboundPolicyV2Request) => Effect.Effect<sandbox.SandboxSetOutboundPolicyV2Response, persistent.ModalOpError, never>;
|
|
723
|
+
readonly setTags: (input: sandbox.SandboxTagsSetV2Request) => Effect.Effect<sandbox.SandboxTagsSetV2Response, sandbox.SandboxTagsSetV2Error, never>;
|
|
724
|
+
readonly getTags: (input: sandbox.SandboxTagsGetV2Request) => Effect.Effect<sandbox.SandboxTagsGetV2Response, sandbox.SandboxTagsGetV2Error, never>;
|
|
725
|
+
readonly setName: (input: sandbox.SandboxSetNameRequest) => Effect.Effect<sandbox.SandboxSetNameResponse, sandbox.SandboxSetNameError, never>;
|
|
726
|
+
readonly getResourceUsage: (input: sandbox.SandboxGetResourceUsageRequest) => Effect.Effect<sandbox.SandboxGetResourceUsageResponse, sandbox.SandboxGetResourceUsageError, never>;
|
|
727
|
+
readonly wait: (input: sandbox.SandboxWaitV2Request) => Effect.Effect<sandbox.SandboxWaitV2Response, sandbox.SandboxWaitV2Error, never>;
|
|
728
|
+
readonly terminate: (input: sandbox.SandboxTerminateV2Request) => Effect.Effect<sandbox.SandboxTerminateV2Response, sandbox.SandboxTerminateV2Error, never>;
|
|
729
|
+
readonly usage: import("@distilled.cloud/core/api").PaginatedCall<sandbox.SandboxGetTimeRangeStatsRequest, sandbox.SandboxGetTimeRangeStatsResponse, persistent.ModalOpError, never, sandbox.SandboxStatsGroup>;
|
|
730
|
+
readonly createPersistent: (input: persistent.CreatePersistentSandboxRequest) => Effect.Effect<persistent.CreatePersistentSandboxResponse, persistent.CreatePersistentSandboxError, never>;
|
|
731
|
+
readonly getPersistent: (input: persistent.GetPersistentSandboxRequest) => Effect.Effect<persistent.GetPersistentSandboxResponse, persistent.GetPersistentSandboxError, never>;
|
|
732
|
+
readonly resumePersistent: (input: persistent.ResumePersistentSandboxRequest) => Effect.Effect<persistent.ResumePersistentSandboxResponse, persistent.ResumePersistentSandboxError, never>;
|
|
733
|
+
readonly terminatePersistent: (input: persistent.TerminatePersistentSandboxRequest) => Effect.Effect<persistent.TerminatePersistentSandboxResponse, persistent.TerminatePersistentSandboxError, never>;
|
|
734
|
+
readonly images: {
|
|
735
|
+
readonly getOrCreate: (input: import("@distilled.cloud/modal/image").ImageGetOrCreateRequest) => Effect.Effect<import("@distilled.cloud/modal/image").ImageGetOrCreateResponse, persistent.ModalOpError, never>;
|
|
736
|
+
readonly joinStreaming: import("@distilled.cloud/core/api").StreamingCall<import("@distilled.cloud/modal/image").ImageJoinStreamingRequest, import("@distilled.cloud/modal/image").ImageJoinStreamingStream, import("@distilled.cloud/modal/image").ImageJoinStreamingError, never, import("@distilled.cloud/modal/image").ImageJoinStreamingResponse>;
|
|
737
|
+
readonly putFile: (input: import("@distilled.cloud/modal/mount").MountPutFileRequest) => Effect.Effect<import("@distilled.cloud/modal/mount").MountPutFileResponse, persistent.ModalOpError, never>;
|
|
738
|
+
readonly getOrCreateMount: (input: import("@distilled.cloud/modal/mount").MountGetOrCreateRequest) => Effect.Effect<import("@distilled.cloud/modal/mount").MountGetOrCreateResponse, import("@distilled.cloud/modal/mount").MountGetOrCreateError, never>;
|
|
739
|
+
readonly blobs: {
|
|
740
|
+
readonly create: (input: import("@distilled.cloud/modal/blob").CreateBlobRequest) => Effect.Effect<import("@distilled.cloud/modal/blob").CreateBlobResponse, persistent.ModalOpError, never>;
|
|
741
|
+
readonly get: (input: import("@distilled.cloud/modal/blob").GetBlobRequest) => Effect.Effect<import("@distilled.cloud/modal/blob").GetBlobResponse, persistent.ModalOpError, never>;
|
|
742
|
+
readonly http: HttpClient.HttpClient;
|
|
743
|
+
};
|
|
744
|
+
};
|
|
745
|
+
readonly http: HttpClient.HttpClient;
|
|
746
|
+
}, target: SandboxTarget, options?: PersistentSandboxCreateOptions | undefined) => Effect.Effect<RawPersistentSandboxHandle, import("./Blob.ts").BlobTransferFailed | import("./ImageBuild.ts").ImageBuildFailed | import("./ImageBuild.ts").ImageBuildTimeout | import("./ImageBuild.ts").ImageBuildUnexpectedResponse | import("@distilled.cloud/modal/image").ImageNotFound | import("./Mounts.ts").MountNotBound | import("@distilled.cloud/modal/mount").MountNotFound | SandboxUnexpectedResponse | persistent.CreatePersistentSandboxError, never>;
|
|
747
|
+
export {};
|
|
748
|
+
//# sourceMappingURL=SandboxClient.d.ts.map
|