modal 0.5.4 → 0.5.6

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/dist/index.d.cts CHANGED
@@ -4971,6 +4971,98 @@ interface MessageFns<T> {
4971
4971
  fromPartial(object: DeepPartial<T>): T;
4972
4972
  }
4973
4973
 
4974
+ /** Optional parameters for {@link SecretService#fromName client.secrets.fromName()}. */
4975
+ type SecretFromNameParams = {
4976
+ environment?: string;
4977
+ requiredKeys?: string[];
4978
+ };
4979
+ /** Optional parameters for {@link SecretService#fromObject client.secrets.fromObject()}. */
4980
+ type SecretFromObjectParams = {
4981
+ environment?: string;
4982
+ };
4983
+ /** Optional parameters for {@link SecretService#delete client.secrets.delete()}. */
4984
+ type SecretDeleteParams = {
4985
+ environment?: string;
4986
+ allowMissing?: boolean;
4987
+ };
4988
+ /**
4989
+ * Service for managing {@link Secret Secrets}.
4990
+ *
4991
+ * Normally only ever accessed via the client as:
4992
+ * ```typescript
4993
+ * const modal = new ModalClient();
4994
+ * const secret = await modal.secrets.fromName("my-secret");
4995
+ * ```
4996
+ */
4997
+ declare class SecretService {
4998
+ #private;
4999
+ constructor(client: ModalClient);
5000
+ /** Reference a {@link Secret} by its name. */
5001
+ fromName(name: string, params?: SecretFromNameParams): Promise<Secret>;
5002
+ /** Create a {@link Secret} from a plain object of key-value pairs. */
5003
+ fromObject(entries: Record<string, string>, params?: SecretFromObjectParams): Promise<Secret>;
5004
+ /**
5005
+ * Delete a named {@link Secret}.
5006
+ *
5007
+ * Warning: Deletion is irreversible and will affect any Apps currently using the Secret.
5008
+ */
5009
+ delete(name: string, params?: SecretDeleteParams): Promise<void>;
5010
+ }
5011
+ /** Secrets provide a dictionary of environment variables for {@link Image}s. */
5012
+ declare class Secret {
5013
+ readonly secretId: string;
5014
+ readonly name?: string;
5015
+ /** @ignore */
5016
+ constructor(secretId: string, name?: string);
5017
+ /**
5018
+ * @deprecated Use {@link SecretService#fromName client.secrets.fromName()} instead.
5019
+ */
5020
+ static fromName(name: string, params?: SecretFromNameParams): Promise<Secret>;
5021
+ /**
5022
+ * @deprecated Use {@link SecretService#fromObject client.secrets.fromObject()} instead.
5023
+ */
5024
+ static fromObject(entries: Record<string, string>, params?: SecretFromObjectParams): Promise<Secret>;
5025
+ }
5026
+
5027
+ declare class CloudBucketMountService {
5028
+ #private;
5029
+ constructor(client: ModalClient);
5030
+ create(bucketName: string, params?: {
5031
+ secret?: Secret;
5032
+ readOnly?: boolean;
5033
+ requesterPays?: boolean;
5034
+ bucketEndpointUrl?: string;
5035
+ keyPrefix?: string;
5036
+ oidcAuthRoleArn?: string;
5037
+ }): CloudBucketMount;
5038
+ }
5039
+ /** Cloud Bucket Mounts provide access to cloud storage buckets within Modal Functions. */
5040
+ declare class CloudBucketMount {
5041
+ #private;
5042
+ readonly bucketName: string;
5043
+ readonly secret?: Secret;
5044
+ readonly readOnly: boolean;
5045
+ readonly requesterPays: boolean;
5046
+ readonly bucketEndpointUrl?: string;
5047
+ readonly keyPrefix?: string;
5048
+ readonly oidcAuthRoleArn?: string;
5049
+ /**
5050
+ * @deprecated Use {@link CloudBucketMountService#create client.cloudBucketMounts.create()} instead.
5051
+ */
5052
+ constructor(bucketName: string, params?: {
5053
+ secret?: Secret;
5054
+ readOnly?: boolean;
5055
+ requesterPays?: boolean;
5056
+ bucketEndpointUrl?: string;
5057
+ keyPrefix?: string;
5058
+ oidcAuthRoleArn?: string;
5059
+ });
5060
+ /** @ignore */
5061
+ constructor(bucketName: string, secret: Secret | undefined, readOnly: boolean, requesterPays: boolean, bucketEndpointUrl: string | undefined, keyPrefix: string | undefined, oidcAuthRoleArn: string | undefined, bucketType: CloudBucketMount_BucketType);
5062
+ /** @ignore */
5063
+ toProto(mountPath: string): CloudBucketMount$1;
5064
+ }
5065
+
4974
5066
  /**
4975
5067
  * Service for managing {@link FunctionCall}s.
4976
5068
  *
@@ -5073,59 +5165,6 @@ declare class Function_ {
5073
5165
  getWebUrl(): Promise<string | undefined>;
5074
5166
  }
5075
5167
 
5076
- /** Optional parameters for {@link SecretService#fromName client.secrets.fromName()}. */
5077
- type SecretFromNameParams = {
5078
- environment?: string;
5079
- requiredKeys?: string[];
5080
- };
5081
- /** Optional parameters for {@link SecretService#fromObject client.secrets.fromObject()}. */
5082
- type SecretFromObjectParams = {
5083
- environment?: string;
5084
- };
5085
- /** Optional parameters for {@link SecretService#delete client.secrets.delete()}. */
5086
- type SecretDeleteParams = {
5087
- environment?: string;
5088
- allowMissing?: boolean;
5089
- };
5090
- /**
5091
- * Service for managing {@link Secret Secrets}.
5092
- *
5093
- * Normally only ever accessed via the client as:
5094
- * ```typescript
5095
- * const modal = new ModalClient();
5096
- * const secret = await modal.secrets.fromName("my-secret");
5097
- * ```
5098
- */
5099
- declare class SecretService {
5100
- #private;
5101
- constructor(client: ModalClient);
5102
- /** Reference a {@link Secret} by its name. */
5103
- fromName(name: string, params?: SecretFromNameParams): Promise<Secret>;
5104
- /** Create a {@link Secret} from a plain object of key-value pairs. */
5105
- fromObject(entries: Record<string, string>, params?: SecretFromObjectParams): Promise<Secret>;
5106
- /**
5107
- * Delete a named {@link Secret}.
5108
- *
5109
- * Warning: Deletion is irreversible and will affect any Apps currently using the Secret.
5110
- */
5111
- delete(name: string, params?: SecretDeleteParams): Promise<void>;
5112
- }
5113
- /** Secrets provide a dictionary of environment variables for {@link Image}s. */
5114
- declare class Secret {
5115
- readonly secretId: string;
5116
- readonly name?: string;
5117
- /** @ignore */
5118
- constructor(secretId: string, name?: string);
5119
- /**
5120
- * @deprecated Use {@link SecretService#fromName client.secrets.fromName()} instead.
5121
- */
5122
- static fromName(name: string, params?: SecretFromNameParams): Promise<Secret>;
5123
- /**
5124
- * @deprecated Use {@link SecretService#fromObject client.secrets.fromObject()} instead.
5125
- */
5126
- static fromObject(entries: Record<string, string>, params?: SecretFromObjectParams): Promise<Secret>;
5127
- }
5128
-
5129
5168
  /** Retry policy configuration for a Modal Function/Cls. */
5130
5169
  declare class Retries {
5131
5170
  readonly maxRetries: number;
@@ -5648,25 +5687,6 @@ interface ModalWriteStream<R = any> extends WritableStream<R> {
5648
5687
  writeBytes(bytes: Uint8Array): Promise<void>;
5649
5688
  }
5650
5689
 
5651
- /** Cloud Bucket Mounts provide access to cloud storage buckets within Modal Functions. */
5652
- declare class CloudBucketMount {
5653
- readonly bucketName: string;
5654
- readonly secret?: Secret;
5655
- readonly readOnly: boolean;
5656
- readonly requesterPays: boolean;
5657
- readonly bucketEndpointUrl?: string;
5658
- readonly keyPrefix?: string;
5659
- readonly oidcAuthRoleArn?: string;
5660
- constructor(bucketName: string, params?: {
5661
- secret?: Secret;
5662
- readOnly?: boolean;
5663
- requesterPays?: boolean;
5664
- bucketEndpointUrl?: string;
5665
- keyPrefix?: string;
5666
- oidcAuthRoleArn?: string;
5667
- });
5668
- }
5669
-
5670
5690
  /**
5671
5691
  * Stdin is always present, but this option allow you to drop stdout or stderr
5672
5692
  * if you don't need them. The default is "pipe", matching Node.js behavior.
@@ -5694,7 +5714,7 @@ type SandboxCreateParams = {
5694
5714
  gpu?: string;
5695
5715
  /** Timeout of the Sandbox container in milliseconds, defaults to 10 minutes. */
5696
5716
  timeoutMs?: number;
5697
- /** The amount of time in milliseconds that a sandbox can be idle before being terminated. */
5717
+ /** The amount of time in milliseconds that a Sandbox can be idle before being terminated. */
5698
5718
  idleTimeoutMs?: number;
5699
5719
  /** Working directory of the Sandbox. */
5700
5720
  workdir?: string;
@@ -5740,7 +5760,7 @@ type SandboxCreateParams = {
5740
5760
  * Normally only ever accessed via the client as:
5741
5761
  * ```typescript
5742
5762
  * const modal = new ModalClient();
5743
- * const sandbox = await modal.sandboxes.create(app, image);
5763
+ * const sb = await modal.sandboxes.create(app, image);
5744
5764
  * ```
5745
5765
  */
5746
5766
  declare class SandboxService {
@@ -5804,6 +5824,16 @@ type SandboxExecParams = {
5804
5824
  /** Enable a PTY for the command. */
5805
5825
  pty?: boolean;
5806
5826
  };
5827
+ /** Optional parameters for {@link Sandbox#createConnectToken Sandbox.createConnectToken()}. */
5828
+ type SandboxCreateConnectTokenParams = {
5829
+ /** Optional user-provided metadata string that will be added to the headers by the proxy when forwarding requests to the Sandbox. */
5830
+ userMetadata?: string;
5831
+ };
5832
+ /** Credentials returned by {@link Sandbox#createConnectToken Sandbox.createConnectToken()}. */
5833
+ type SandboxCreateConnectCredentials = {
5834
+ url: string;
5835
+ token: string;
5836
+ };
5807
5837
  /** A port forwarded from within a running Modal {@link Sandbox}. */
5808
5838
  declare class Tunnel {
5809
5839
  host: string;
@@ -5853,6 +5883,10 @@ declare class Sandbox {
5853
5883
  exec(command: string[], params: SandboxExecParams & {
5854
5884
  mode: "binary";
5855
5885
  }): Promise<ContainerProcess<Uint8Array>>;
5886
+ /**
5887
+ * Create a token for making HTTP connections to the Sandbox.
5888
+ */
5889
+ createConnectToken(params?: SandboxCreateConnectTokenParams): Promise<SandboxCreateConnectCredentials>;
5856
5890
  terminate(): Promise<void>;
5857
5891
  wait(): Promise<number>;
5858
5892
  /** Get {@link Tunnel} metadata for the Sandbox.
@@ -5949,11 +5983,12 @@ type ModalGrpcClient = Client<typeof ModalClientDefinition, TimeoutOptions & Ret
5949
5983
  *
5950
5984
  * const app = await modal.apps.fromName("my-app");
5951
5985
  * const image = modal.images.fromRegistry("python:3.13");
5952
- * const sandbox = await modal.sandboxes.create(app, image);
5986
+ * const sb = await modal.sandboxes.create(app, image);
5953
5987
  * ```
5954
5988
  */
5955
5989
  declare class ModalClient {
5956
5990
  readonly apps: AppService;
5991
+ readonly cloudBucketMounts: CloudBucketMountService;
5957
5992
  readonly cls: ClsService;
5958
5993
  readonly functions: FunctionService;
5959
5994
  readonly functionCalls: FunctionCallService;
@@ -6118,4 +6153,4 @@ declare class SandboxTimeoutError extends Error {
6118
6153
 
6119
6154
  declare function checkForRenamedParams(params: any, renames: Record<string, string>): void;
6120
6155
 
6121
- export { AlreadyExistsError, App, type AppFromNameParams, AppService, type ClientOptions, CloudBucketMount, Cls, type ClsFromNameParams, ClsInstance, ClsService, type ClsWithBatchingParams, type ClsWithConcurrencyParams, type ClsWithOptionsParams, ContainerProcess, type DeleteOptions, type EphemeralOptions, FunctionCall, type FunctionCallCancelParams, type FunctionCallGetParams, FunctionCallService, type FunctionFromNameParams, FunctionService, type FunctionStats, FunctionTimeoutError, type FunctionUpdateAutoscalerParams, Function_, Image, type ImageDeleteParams, type ImageDockerfileCommandsParams, ImageService, InternalFailure, InvalidError, type LogLevel, type Logger, type LookupOptions, ModalClient, type ModalClientParams, type ModalReadStream, type ModalWriteStream, NotFoundError, type Profile, Proxy, type ProxyFromNameParams, ProxyService, Queue, type QueueClearParams, type QueueDeleteParams, QueueEmptyError, type QueueEphemeralParams, type QueueFromNameParams, QueueFullError, type QueueGetParams, type QueueIterateParams, type QueueLenParams, type QueuePutParams, QueueService, RemoteError, Retries, Sandbox, type SandboxCreateParams, type SandboxExecParams, SandboxFile, type SandboxFileMode, type SandboxFromNameParams, type SandboxListParams, SandboxService, SandboxTimeoutError, Secret, type SecretDeleteParams, type SecretFromNameParams, type SecretFromObjectParams, SecretService, type StdioBehavior, type StreamMode, Tunnel, Volume, type VolumeDeleteParams, type VolumeEphemeralParams, type VolumeFromNameParams, VolumeService, checkForRenamedParams, close, initializeClient };
6156
+ export { AlreadyExistsError, App, type AppFromNameParams, AppService, type ClientOptions, CloudBucketMount, CloudBucketMountService, Cls, type ClsFromNameParams, ClsInstance, ClsService, type ClsWithBatchingParams, type ClsWithConcurrencyParams, type ClsWithOptionsParams, ContainerProcess, type DeleteOptions, type EphemeralOptions, FunctionCall, type FunctionCallCancelParams, type FunctionCallGetParams, FunctionCallService, type FunctionFromNameParams, FunctionService, type FunctionStats, FunctionTimeoutError, type FunctionUpdateAutoscalerParams, Function_, Image, type ImageDeleteParams, type ImageDockerfileCommandsParams, ImageService, InternalFailure, InvalidError, type LogLevel, type Logger, type LookupOptions, ModalClient, type ModalClientParams, type ModalReadStream, type ModalWriteStream, NotFoundError, type Profile, Proxy, type ProxyFromNameParams, ProxyService, Queue, type QueueClearParams, type QueueDeleteParams, QueueEmptyError, type QueueEphemeralParams, type QueueFromNameParams, QueueFullError, type QueueGetParams, type QueueIterateParams, type QueueLenParams, type QueuePutParams, QueueService, RemoteError, Retries, Sandbox, type SandboxCreateConnectCredentials, type SandboxCreateConnectTokenParams, type SandboxCreateParams, type SandboxExecParams, SandboxFile, type SandboxFileMode, type SandboxFromNameParams, type SandboxListParams, SandboxService, SandboxTimeoutError, Secret, type SecretDeleteParams, type SecretFromNameParams, type SecretFromObjectParams, SecretService, type StdioBehavior, type StreamMode, Tunnel, Volume, type VolumeDeleteParams, type VolumeEphemeralParams, type VolumeFromNameParams, VolumeService, checkForRenamedParams, close, initializeClient };
package/dist/index.d.ts CHANGED
@@ -4971,6 +4971,98 @@ interface MessageFns<T> {
4971
4971
  fromPartial(object: DeepPartial<T>): T;
4972
4972
  }
4973
4973
 
4974
+ /** Optional parameters for {@link SecretService#fromName client.secrets.fromName()}. */
4975
+ type SecretFromNameParams = {
4976
+ environment?: string;
4977
+ requiredKeys?: string[];
4978
+ };
4979
+ /** Optional parameters for {@link SecretService#fromObject client.secrets.fromObject()}. */
4980
+ type SecretFromObjectParams = {
4981
+ environment?: string;
4982
+ };
4983
+ /** Optional parameters for {@link SecretService#delete client.secrets.delete()}. */
4984
+ type SecretDeleteParams = {
4985
+ environment?: string;
4986
+ allowMissing?: boolean;
4987
+ };
4988
+ /**
4989
+ * Service for managing {@link Secret Secrets}.
4990
+ *
4991
+ * Normally only ever accessed via the client as:
4992
+ * ```typescript
4993
+ * const modal = new ModalClient();
4994
+ * const secret = await modal.secrets.fromName("my-secret");
4995
+ * ```
4996
+ */
4997
+ declare class SecretService {
4998
+ #private;
4999
+ constructor(client: ModalClient);
5000
+ /** Reference a {@link Secret} by its name. */
5001
+ fromName(name: string, params?: SecretFromNameParams): Promise<Secret>;
5002
+ /** Create a {@link Secret} from a plain object of key-value pairs. */
5003
+ fromObject(entries: Record<string, string>, params?: SecretFromObjectParams): Promise<Secret>;
5004
+ /**
5005
+ * Delete a named {@link Secret}.
5006
+ *
5007
+ * Warning: Deletion is irreversible and will affect any Apps currently using the Secret.
5008
+ */
5009
+ delete(name: string, params?: SecretDeleteParams): Promise<void>;
5010
+ }
5011
+ /** Secrets provide a dictionary of environment variables for {@link Image}s. */
5012
+ declare class Secret {
5013
+ readonly secretId: string;
5014
+ readonly name?: string;
5015
+ /** @ignore */
5016
+ constructor(secretId: string, name?: string);
5017
+ /**
5018
+ * @deprecated Use {@link SecretService#fromName client.secrets.fromName()} instead.
5019
+ */
5020
+ static fromName(name: string, params?: SecretFromNameParams): Promise<Secret>;
5021
+ /**
5022
+ * @deprecated Use {@link SecretService#fromObject client.secrets.fromObject()} instead.
5023
+ */
5024
+ static fromObject(entries: Record<string, string>, params?: SecretFromObjectParams): Promise<Secret>;
5025
+ }
5026
+
5027
+ declare class CloudBucketMountService {
5028
+ #private;
5029
+ constructor(client: ModalClient);
5030
+ create(bucketName: string, params?: {
5031
+ secret?: Secret;
5032
+ readOnly?: boolean;
5033
+ requesterPays?: boolean;
5034
+ bucketEndpointUrl?: string;
5035
+ keyPrefix?: string;
5036
+ oidcAuthRoleArn?: string;
5037
+ }): CloudBucketMount;
5038
+ }
5039
+ /** Cloud Bucket Mounts provide access to cloud storage buckets within Modal Functions. */
5040
+ declare class CloudBucketMount {
5041
+ #private;
5042
+ readonly bucketName: string;
5043
+ readonly secret?: Secret;
5044
+ readonly readOnly: boolean;
5045
+ readonly requesterPays: boolean;
5046
+ readonly bucketEndpointUrl?: string;
5047
+ readonly keyPrefix?: string;
5048
+ readonly oidcAuthRoleArn?: string;
5049
+ /**
5050
+ * @deprecated Use {@link CloudBucketMountService#create client.cloudBucketMounts.create()} instead.
5051
+ */
5052
+ constructor(bucketName: string, params?: {
5053
+ secret?: Secret;
5054
+ readOnly?: boolean;
5055
+ requesterPays?: boolean;
5056
+ bucketEndpointUrl?: string;
5057
+ keyPrefix?: string;
5058
+ oidcAuthRoleArn?: string;
5059
+ });
5060
+ /** @ignore */
5061
+ constructor(bucketName: string, secret: Secret | undefined, readOnly: boolean, requesterPays: boolean, bucketEndpointUrl: string | undefined, keyPrefix: string | undefined, oidcAuthRoleArn: string | undefined, bucketType: CloudBucketMount_BucketType);
5062
+ /** @ignore */
5063
+ toProto(mountPath: string): CloudBucketMount$1;
5064
+ }
5065
+
4974
5066
  /**
4975
5067
  * Service for managing {@link FunctionCall}s.
4976
5068
  *
@@ -5073,59 +5165,6 @@ declare class Function_ {
5073
5165
  getWebUrl(): Promise<string | undefined>;
5074
5166
  }
5075
5167
 
5076
- /** Optional parameters for {@link SecretService#fromName client.secrets.fromName()}. */
5077
- type SecretFromNameParams = {
5078
- environment?: string;
5079
- requiredKeys?: string[];
5080
- };
5081
- /** Optional parameters for {@link SecretService#fromObject client.secrets.fromObject()}. */
5082
- type SecretFromObjectParams = {
5083
- environment?: string;
5084
- };
5085
- /** Optional parameters for {@link SecretService#delete client.secrets.delete()}. */
5086
- type SecretDeleteParams = {
5087
- environment?: string;
5088
- allowMissing?: boolean;
5089
- };
5090
- /**
5091
- * Service for managing {@link Secret Secrets}.
5092
- *
5093
- * Normally only ever accessed via the client as:
5094
- * ```typescript
5095
- * const modal = new ModalClient();
5096
- * const secret = await modal.secrets.fromName("my-secret");
5097
- * ```
5098
- */
5099
- declare class SecretService {
5100
- #private;
5101
- constructor(client: ModalClient);
5102
- /** Reference a {@link Secret} by its name. */
5103
- fromName(name: string, params?: SecretFromNameParams): Promise<Secret>;
5104
- /** Create a {@link Secret} from a plain object of key-value pairs. */
5105
- fromObject(entries: Record<string, string>, params?: SecretFromObjectParams): Promise<Secret>;
5106
- /**
5107
- * Delete a named {@link Secret}.
5108
- *
5109
- * Warning: Deletion is irreversible and will affect any Apps currently using the Secret.
5110
- */
5111
- delete(name: string, params?: SecretDeleteParams): Promise<void>;
5112
- }
5113
- /** Secrets provide a dictionary of environment variables for {@link Image}s. */
5114
- declare class Secret {
5115
- readonly secretId: string;
5116
- readonly name?: string;
5117
- /** @ignore */
5118
- constructor(secretId: string, name?: string);
5119
- /**
5120
- * @deprecated Use {@link SecretService#fromName client.secrets.fromName()} instead.
5121
- */
5122
- static fromName(name: string, params?: SecretFromNameParams): Promise<Secret>;
5123
- /**
5124
- * @deprecated Use {@link SecretService#fromObject client.secrets.fromObject()} instead.
5125
- */
5126
- static fromObject(entries: Record<string, string>, params?: SecretFromObjectParams): Promise<Secret>;
5127
- }
5128
-
5129
5168
  /** Retry policy configuration for a Modal Function/Cls. */
5130
5169
  declare class Retries {
5131
5170
  readonly maxRetries: number;
@@ -5648,25 +5687,6 @@ interface ModalWriteStream<R = any> extends WritableStream<R> {
5648
5687
  writeBytes(bytes: Uint8Array): Promise<void>;
5649
5688
  }
5650
5689
 
5651
- /** Cloud Bucket Mounts provide access to cloud storage buckets within Modal Functions. */
5652
- declare class CloudBucketMount {
5653
- readonly bucketName: string;
5654
- readonly secret?: Secret;
5655
- readonly readOnly: boolean;
5656
- readonly requesterPays: boolean;
5657
- readonly bucketEndpointUrl?: string;
5658
- readonly keyPrefix?: string;
5659
- readonly oidcAuthRoleArn?: string;
5660
- constructor(bucketName: string, params?: {
5661
- secret?: Secret;
5662
- readOnly?: boolean;
5663
- requesterPays?: boolean;
5664
- bucketEndpointUrl?: string;
5665
- keyPrefix?: string;
5666
- oidcAuthRoleArn?: string;
5667
- });
5668
- }
5669
-
5670
5690
  /**
5671
5691
  * Stdin is always present, but this option allow you to drop stdout or stderr
5672
5692
  * if you don't need them. The default is "pipe", matching Node.js behavior.
@@ -5694,7 +5714,7 @@ type SandboxCreateParams = {
5694
5714
  gpu?: string;
5695
5715
  /** Timeout of the Sandbox container in milliseconds, defaults to 10 minutes. */
5696
5716
  timeoutMs?: number;
5697
- /** The amount of time in milliseconds that a sandbox can be idle before being terminated. */
5717
+ /** The amount of time in milliseconds that a Sandbox can be idle before being terminated. */
5698
5718
  idleTimeoutMs?: number;
5699
5719
  /** Working directory of the Sandbox. */
5700
5720
  workdir?: string;
@@ -5740,7 +5760,7 @@ type SandboxCreateParams = {
5740
5760
  * Normally only ever accessed via the client as:
5741
5761
  * ```typescript
5742
5762
  * const modal = new ModalClient();
5743
- * const sandbox = await modal.sandboxes.create(app, image);
5763
+ * const sb = await modal.sandboxes.create(app, image);
5744
5764
  * ```
5745
5765
  */
5746
5766
  declare class SandboxService {
@@ -5804,6 +5824,16 @@ type SandboxExecParams = {
5804
5824
  /** Enable a PTY for the command. */
5805
5825
  pty?: boolean;
5806
5826
  };
5827
+ /** Optional parameters for {@link Sandbox#createConnectToken Sandbox.createConnectToken()}. */
5828
+ type SandboxCreateConnectTokenParams = {
5829
+ /** Optional user-provided metadata string that will be added to the headers by the proxy when forwarding requests to the Sandbox. */
5830
+ userMetadata?: string;
5831
+ };
5832
+ /** Credentials returned by {@link Sandbox#createConnectToken Sandbox.createConnectToken()}. */
5833
+ type SandboxCreateConnectCredentials = {
5834
+ url: string;
5835
+ token: string;
5836
+ };
5807
5837
  /** A port forwarded from within a running Modal {@link Sandbox}. */
5808
5838
  declare class Tunnel {
5809
5839
  host: string;
@@ -5853,6 +5883,10 @@ declare class Sandbox {
5853
5883
  exec(command: string[], params: SandboxExecParams & {
5854
5884
  mode: "binary";
5855
5885
  }): Promise<ContainerProcess<Uint8Array>>;
5886
+ /**
5887
+ * Create a token for making HTTP connections to the Sandbox.
5888
+ */
5889
+ createConnectToken(params?: SandboxCreateConnectTokenParams): Promise<SandboxCreateConnectCredentials>;
5856
5890
  terminate(): Promise<void>;
5857
5891
  wait(): Promise<number>;
5858
5892
  /** Get {@link Tunnel} metadata for the Sandbox.
@@ -5949,11 +5983,12 @@ type ModalGrpcClient = Client<typeof ModalClientDefinition, TimeoutOptions & Ret
5949
5983
  *
5950
5984
  * const app = await modal.apps.fromName("my-app");
5951
5985
  * const image = modal.images.fromRegistry("python:3.13");
5952
- * const sandbox = await modal.sandboxes.create(app, image);
5986
+ * const sb = await modal.sandboxes.create(app, image);
5953
5987
  * ```
5954
5988
  */
5955
5989
  declare class ModalClient {
5956
5990
  readonly apps: AppService;
5991
+ readonly cloudBucketMounts: CloudBucketMountService;
5957
5992
  readonly cls: ClsService;
5958
5993
  readonly functions: FunctionService;
5959
5994
  readonly functionCalls: FunctionCallService;
@@ -6118,4 +6153,4 @@ declare class SandboxTimeoutError extends Error {
6118
6153
 
6119
6154
  declare function checkForRenamedParams(params: any, renames: Record<string, string>): void;
6120
6155
 
6121
- export { AlreadyExistsError, App, type AppFromNameParams, AppService, type ClientOptions, CloudBucketMount, Cls, type ClsFromNameParams, ClsInstance, ClsService, type ClsWithBatchingParams, type ClsWithConcurrencyParams, type ClsWithOptionsParams, ContainerProcess, type DeleteOptions, type EphemeralOptions, FunctionCall, type FunctionCallCancelParams, type FunctionCallGetParams, FunctionCallService, type FunctionFromNameParams, FunctionService, type FunctionStats, FunctionTimeoutError, type FunctionUpdateAutoscalerParams, Function_, Image, type ImageDeleteParams, type ImageDockerfileCommandsParams, ImageService, InternalFailure, InvalidError, type LogLevel, type Logger, type LookupOptions, ModalClient, type ModalClientParams, type ModalReadStream, type ModalWriteStream, NotFoundError, type Profile, Proxy, type ProxyFromNameParams, ProxyService, Queue, type QueueClearParams, type QueueDeleteParams, QueueEmptyError, type QueueEphemeralParams, type QueueFromNameParams, QueueFullError, type QueueGetParams, type QueueIterateParams, type QueueLenParams, type QueuePutParams, QueueService, RemoteError, Retries, Sandbox, type SandboxCreateParams, type SandboxExecParams, SandboxFile, type SandboxFileMode, type SandboxFromNameParams, type SandboxListParams, SandboxService, SandboxTimeoutError, Secret, type SecretDeleteParams, type SecretFromNameParams, type SecretFromObjectParams, SecretService, type StdioBehavior, type StreamMode, Tunnel, Volume, type VolumeDeleteParams, type VolumeEphemeralParams, type VolumeFromNameParams, VolumeService, checkForRenamedParams, close, initializeClient };
6156
+ export { AlreadyExistsError, App, type AppFromNameParams, AppService, type ClientOptions, CloudBucketMount, CloudBucketMountService, Cls, type ClsFromNameParams, ClsInstance, ClsService, type ClsWithBatchingParams, type ClsWithConcurrencyParams, type ClsWithOptionsParams, ContainerProcess, type DeleteOptions, type EphemeralOptions, FunctionCall, type FunctionCallCancelParams, type FunctionCallGetParams, FunctionCallService, type FunctionFromNameParams, FunctionService, type FunctionStats, FunctionTimeoutError, type FunctionUpdateAutoscalerParams, Function_, Image, type ImageDeleteParams, type ImageDockerfileCommandsParams, ImageService, InternalFailure, InvalidError, type LogLevel, type Logger, type LookupOptions, ModalClient, type ModalClientParams, type ModalReadStream, type ModalWriteStream, NotFoundError, type Profile, Proxy, type ProxyFromNameParams, ProxyService, Queue, type QueueClearParams, type QueueDeleteParams, QueueEmptyError, type QueueEphemeralParams, type QueueFromNameParams, QueueFullError, type QueueGetParams, type QueueIterateParams, type QueueLenParams, type QueuePutParams, QueueService, RemoteError, Retries, Sandbox, type SandboxCreateConnectCredentials, type SandboxCreateConnectTokenParams, type SandboxCreateParams, type SandboxExecParams, SandboxFile, type SandboxFileMode, type SandboxFromNameParams, type SandboxListParams, SandboxService, SandboxTimeoutError, Secret, type SecretDeleteParams, type SecretFromNameParams, type SecretFromObjectParams, SecretService, type StdioBehavior, type StreamMode, Tunnel, Volume, type VolumeDeleteParams, type VolumeEphemeralParams, type VolumeFromNameParams, VolumeService, checkForRenamedParams, close, initializeClient };