modal 0.7.3 → 0.7.5

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
@@ -126,6 +126,26 @@ declare enum DeploymentNamespace {
126
126
  DEPLOYMENT_NAMESPACE_GLOBAL = 3,
127
127
  UNRECOGNIZED = -1
128
128
  }
129
+ declare enum EndpointApiSurface {
130
+ ENDPOINT_API_SURFACE_UNSPECIFIED = 0,
131
+ ENDPOINT_API_SURFACE_OPENAI_CHAT_COMPLETIONS = 1,
132
+ ENDPOINT_API_SURFACE_OPENAI_RESPONSES = 2,
133
+ ENDPOINT_API_SURFACE_ANTHROPIC_MESSAGES = 3,
134
+ UNRECOGNIZED = -1
135
+ }
136
+ declare enum EndpointInputModality {
137
+ ENDPOINT_INPUT_MODALITY_UNSPECIFIED = 0,
138
+ ENDPOINT_INPUT_MODALITY_TEXT = 1,
139
+ ENDPOINT_INPUT_MODALITY_IMAGE = 2,
140
+ ENDPOINT_INPUT_MODALITY_AUDIO = 3,
141
+ UNRECOGNIZED = -1
142
+ }
143
+ declare enum EnvironmentRole {
144
+ ENVIRONMENT_ROLE_UNSPECIFIED = 0,
145
+ ENVIRONMENT_ROLE_VIEWER = 1,
146
+ ENVIRONMENT_ROLE_CONTRIBUTOR = 2,
147
+ UNRECOGNIZED = -1
148
+ }
129
149
  declare enum ExecOutputOption {
130
150
  EXEC_OUTPUT_OPTION_UNSPECIFIED = 0,
131
151
  EXEC_OUTPUT_OPTION_DEVNULL = 1,
@@ -171,6 +191,20 @@ declare enum GPUType {
171
191
  GPU_TYPE_H200 = 12,
172
192
  UNRECOGNIZED = -1
173
193
  }
194
+ declare enum IdentityProviderType {
195
+ IDENTITY_PROVIDER_TYPE_UNSPECIFIED = 0,
196
+ IDENTITY_PROVIDER_TYPE_GITHUB = 1,
197
+ IDENTITY_PROVIDER_TYPE_OKTA = 2,
198
+ IDENTITY_PROVIDER_TYPE_GOOGLE_OAUTH = 3,
199
+ UNRECOGNIZED = -1
200
+ }
201
+ declare enum MemberRole {
202
+ MEMBER_ROLE_UNSPECIFIED = 0,
203
+ MEMBER_ROLE_USER = 1,
204
+ MEMBER_ROLE_MANAGER = 2,
205
+ MEMBER_ROLE_OWNER = 3,
206
+ UNRECOGNIZED = -1
207
+ }
174
208
  declare enum ObjectCreationType {
175
209
  /** OBJECT_CREATION_TYPE_UNSPECIFIED - just lookup */
176
210
  OBJECT_CREATION_TYPE_UNSPECIFIED = 0,
@@ -513,7 +547,14 @@ interface AppGetByDeploymentNameRequest {
513
547
  }
514
548
  declare const AppGetByDeploymentNameRequest: MessageFns$1<AppGetByDeploymentNameRequest>;
515
549
  interface AppGetByDeploymentNameResponse {
550
+ /** Null when App with requested name is not deployed */
516
551
  appId: string;
552
+ /** Populated if App with requested name was recently stopped */
553
+ previousAppId: string;
554
+ /** Populated because server may resolve default environment */
555
+ environmentName: string;
556
+ /** Lifecycle of current App or recently stopped App */
557
+ lifecycle: AppLifecycle | undefined;
517
558
  }
518
559
  declare const AppGetByDeploymentNameResponse: MessageFns$1<AppGetByDeploymentNameResponse>;
519
560
  interface AppGetLayoutRequest {
@@ -524,6 +565,14 @@ interface AppGetLayoutResponse {
524
565
  appLayout: AppLayout | undefined;
525
566
  }
526
567
  declare const AppGetLayoutResponse: MessageFns$1<AppGetLayoutResponse>;
568
+ interface AppGetLifecycleRequest {
569
+ appId: string;
570
+ }
571
+ declare const AppGetLifecycleRequest: MessageFns$1<AppGetLifecycleRequest>;
572
+ interface AppGetLifecycleResponse {
573
+ lifecycle: AppLifecycle | undefined;
574
+ }
575
+ declare const AppGetLifecycleResponse: MessageFns$1<AppGetLifecycleResponse>;
527
576
  interface AppGetLogsRequest {
528
577
  appId: string;
529
578
  timeout: number;
@@ -535,6 +584,7 @@ interface AppGetLogsRequest {
535
584
  functionCallId: string;
536
585
  fileDescriptor: FileDescriptor;
537
586
  sandboxId: string;
587
+ searchText: string;
538
588
  }
539
589
  declare const AppGetLogsRequest: MessageFns$1<AppGetLogsRequest>;
540
590
  interface AppGetObjectsItem {
@@ -589,6 +639,23 @@ interface AppLayout {
589
639
  };
590
640
  }
591
641
  declare const AppLayout: MessageFns$1<AppLayout>;
642
+ interface AppLifecycle {
643
+ appState: AppState;
644
+ createdAt: number;
645
+ /** User or service user name */
646
+ createdBy: string;
647
+ /** Most recent deployment event */
648
+ deployedAt: number;
649
+ /** User or service user name */
650
+ deployedBy: string;
651
+ /** Only meaningful when App is deployed */
652
+ version: number;
653
+ /** Unset when App is still running */
654
+ stoppedAt: number;
655
+ /** User or service user name, null if running or ephemeral App that finished normally */
656
+ stoppedBy: string;
657
+ }
658
+ declare const AppLifecycle: MessageFns$1<AppLifecycle>;
592
659
  interface AppListRequest {
593
660
  environmentName: string;
594
661
  }
@@ -659,6 +726,16 @@ interface AppRollbackRequest {
659
726
  version: number;
660
727
  }
661
728
  declare const AppRollbackRequest: MessageFns$1<AppRollbackRequest>;
729
+ interface AppRolloverRequest {
730
+ appId: string;
731
+ }
732
+ declare const AppRolloverRequest: MessageFns$1<AppRolloverRequest>;
733
+ interface AppRolloverResponse {
734
+ url: string;
735
+ serverWarnings: Warning[];
736
+ deployedAt: number;
737
+ }
738
+ declare const AppRolloverResponse: MessageFns$1<AppRolloverResponse>;
662
739
  interface AppSetObjectsRequest {
663
740
  appId: string;
664
741
  indexedObjectIds: {
@@ -733,7 +810,7 @@ interface AutoscalerSettings {
733
810
  maxContainers?: number | undefined;
734
811
  /** Additional container to spin up when Function is active */
735
812
  bufferContainers?: number | undefined;
736
- /** Currently unused; a placeholder in case we decide to expose scaleup control to users */
813
+ /** Stabilization window (in seconds) before scaling up; requires sustained demand over this period */
737
814
  scaleupWindow?: number | undefined;
738
815
  /** Maximum amount of time a container can be idle before being scaled down, in seconds; pka "container_idle_timeout" */
739
816
  scaledownWindow?: number | undefined;
@@ -1169,6 +1246,7 @@ interface DictGetOrCreateRequest {
1169
1246
  deploymentName: string;
1170
1247
  environmentName: string;
1171
1248
  objectCreationType: ObjectCreationType;
1249
+ /** Unused after 1.4.0 */
1172
1250
  data: DictEntry[];
1173
1251
  }
1174
1252
  declare const DictGetOrCreateRequest: MessageFns$1<DictGetOrCreateRequest>;
@@ -1274,14 +1352,85 @@ interface DomainListResponse {
1274
1352
  domains: Domain[];
1275
1353
  }
1276
1354
  declare const DomainListResponse: MessageFns$1<DomainListResponse>;
1355
+ interface EndpointComputeRegionSpec {
1356
+ auto?: Empty | undefined;
1357
+ colocated?: Empty | undefined;
1358
+ explicit?: EndpointComputeRegionSpec_ExplicitRegions | undefined;
1359
+ }
1360
+ declare const EndpointComputeRegionSpec: MessageFns$1<EndpointComputeRegionSpec>;
1361
+ interface EndpointComputeRegionSpec_ExplicitRegions {
1362
+ regions: string[];
1363
+ }
1364
+ declare const EndpointComputeRegionSpec_ExplicitRegions: MessageFns$1<EndpointComputeRegionSpec_ExplicitRegions>;
1365
+ interface EndpointCreateRequest {
1366
+ name: string;
1367
+ description: string;
1368
+ proxyRegions: string[];
1369
+ computeRegion: EndpointComputeRegionSpec | undefined;
1370
+ model: EndpointModelSource | undefined;
1371
+ apiSurfaces: EndpointApiSurface[];
1372
+ inputModalities: EndpointInputModality[];
1373
+ environmentName: string;
1374
+ }
1375
+ declare const EndpointCreateRequest: MessageFns$1<EndpointCreateRequest>;
1376
+ interface EndpointCreateResponse {
1377
+ endpointId: string;
1378
+ }
1379
+ declare const EndpointCreateResponse: MessageFns$1<EndpointCreateResponse>;
1380
+ interface EndpointCustomModelSource {
1381
+ baseModelRepoId: string;
1382
+ huggingface?: EndpointHuggingFaceModelSource | undefined;
1383
+ modalVolume?: EndpointModalVolumeModelSource | undefined;
1384
+ }
1385
+ declare const EndpointCustomModelSource: MessageFns$1<EndpointCustomModelSource>;
1386
+ interface EndpointHuggingFaceModelSource {
1387
+ repoId: string;
1388
+ revision: string;
1389
+ huggingfaceToken: string;
1390
+ }
1391
+ declare const EndpointHuggingFaceModelSource: MessageFns$1<EndpointHuggingFaceModelSource>;
1392
+ interface EndpointModalVolumeModelSource {
1393
+ volumeId: string;
1394
+ modelPath: string;
1395
+ }
1396
+ declare const EndpointModalVolumeModelSource: MessageFns$1<EndpointModalVolumeModelSource>;
1397
+ interface EndpointModelSource {
1398
+ baseModelRepoId?: string | undefined;
1399
+ custom?: EndpointCustomModelSource | undefined;
1400
+ }
1401
+ declare const EndpointModelSource: MessageFns$1<EndpointModelSource>;
1277
1402
  interface EnvironmentCreateRequest {
1278
1403
  name: string;
1404
+ isManaged: boolean;
1279
1405
  }
1280
1406
  declare const EnvironmentCreateRequest: MessageFns$1<EnvironmentCreateRequest>;
1281
1407
  interface EnvironmentDeleteRequest {
1282
1408
  name: string;
1283
1409
  }
1284
1410
  declare const EnvironmentDeleteRequest: MessageFns$1<EnvironmentDeleteRequest>;
1411
+ interface EnvironmentGetManagedRequest {
1412
+ environmentId: string;
1413
+ }
1414
+ declare const EnvironmentGetManagedRequest: MessageFns$1<EnvironmentGetManagedRequest>;
1415
+ interface EnvironmentGetManagedResponse {
1416
+ environmentId: string;
1417
+ name: string;
1418
+ createdAt: number;
1419
+ principalRoles: EnvironmentGetManagedResponse_PrincipalEnvRole[];
1420
+ additionalRoles: EnvironmentGetManagedResponse_PrincipalEnvRole[];
1421
+ }
1422
+ declare const EnvironmentGetManagedResponse: MessageFns$1<EnvironmentGetManagedResponse>;
1423
+ interface EnvironmentGetManagedResponse_PrincipalEnvRole {
1424
+ userId: string;
1425
+ serviceUserId: string;
1426
+ email: string;
1427
+ avatarUrl: string;
1428
+ serviceUserName: string;
1429
+ role: EnvironmentRole;
1430
+ memberRole: MemberRole;
1431
+ userName: string;
1432
+ }
1433
+ declare const EnvironmentGetManagedResponse_PrincipalEnvRole: MessageFns$1<EnvironmentGetManagedResponse_PrincipalEnvRole>;
1285
1434
  interface EnvironmentGetOrCreateRequest {
1286
1435
  deploymentName: string;
1287
1436
  objectCreationType: ObjectCreationType;
@@ -1314,6 +1463,18 @@ interface EnvironmentMetadata {
1314
1463
  settings: EnvironmentSettings | undefined;
1315
1464
  }
1316
1465
  declare const EnvironmentMetadata: MessageFns$1<EnvironmentMetadata>;
1466
+ interface EnvironmentRoleSetRequest {
1467
+ environmentId: string;
1468
+ userId: string;
1469
+ serviceUserId: string;
1470
+ role: EnvironmentRole;
1471
+ }
1472
+ declare const EnvironmentRoleSetRequest: MessageFns$1<EnvironmentRoleSetRequest>;
1473
+ interface EnvironmentSetManagedRequest {
1474
+ environmentId: string;
1475
+ managed: boolean;
1476
+ }
1477
+ declare const EnvironmentSetManagedRequest: MessageFns$1<EnvironmentSetManagedRequest>;
1317
1478
  /**
1318
1479
  * Environment-scoped settings, with workspace-level defaults.
1319
1480
  * Note that we use MergeFrom to combine workspace / environment settings,
@@ -1436,7 +1597,7 @@ interface FunctionMessage {
1436
1597
  objectDependencies: ObjectDependency[];
1437
1598
  blockNetwork: boolean;
1438
1599
  /**
1439
- * In the SDK, we've deprecated `max_inputs` (which only every implemented `max_inputs=1`)
1600
+ * In the SDK, we've deprecated `max_inputs` (which only ever implemented `max_inputs=1`)
1440
1601
  * in favor of a boolean `single_use_containers` parameter.
1441
1602
  */
1442
1603
  maxInputs: number;
@@ -1473,6 +1634,8 @@ interface FunctionMessage {
1473
1634
  /**
1474
1635
  * _experimental_proxy_ip -> ProxyInfo
1475
1636
  * TODO: deprecate.
1637
+ *
1638
+ * @deprecated
1476
1639
  */
1477
1640
  ExperimentalProxyIp?: string | undefined;
1478
1641
  /** For internal debugging use only. */
@@ -1525,6 +1688,8 @@ interface FunctionMessage {
1525
1688
  singleUseContainers: boolean;
1526
1689
  /** When True, the function is a server function */
1527
1690
  isServer: boolean;
1691
+ /** Where inputs to a function should be routed through. */
1692
+ routingRegion: string;
1528
1693
  }
1529
1694
  declare const FunctionMessage: MessageFns$1<FunctionMessage>;
1530
1695
  interface FunctionAsyncInvokeRequest {
@@ -1675,6 +1840,8 @@ interface FunctionData {
1675
1840
  /**
1676
1841
  * _experimental_proxy_ip -> ProxyInfo
1677
1842
  * TODO: deprecate.
1843
+ *
1844
+ * @deprecated
1678
1845
  */
1679
1846
  ExperimentalProxyIp?: string | undefined;
1680
1847
  /** Mapping of method names to method definitions, only non-empty for class service functions */
@@ -1717,6 +1884,8 @@ interface FunctionData {
1717
1884
  implementationName: string;
1718
1885
  /** When True, the function is a server function */
1719
1886
  isServer: boolean;
1887
+ /** Where inputs to a function should be routed through. */
1888
+ routingRegion: string;
1720
1889
  }
1721
1890
  declare const FunctionData: MessageFns$1<FunctionData>;
1722
1891
  interface FunctionData_RankedFunction {
@@ -1731,7 +1900,6 @@ interface FunctionFinishInputsRequest {
1731
1900
  }
1732
1901
  declare const FunctionFinishInputsRequest: MessageFns$1<FunctionFinishInputsRequest>;
1733
1902
  interface FunctionGetCallGraphRequest {
1734
- /** TODO: use input_id once we switch client submit API to return those. */
1735
1903
  functionCallId: string;
1736
1904
  }
1737
1905
  declare const FunctionGetCallGraphRequest: MessageFns$1<FunctionGetCallGraphRequest>;
@@ -1764,6 +1932,7 @@ interface FunctionGetInputsItem {
1764
1932
  /** intercepted and only used by the worker. */
1765
1933
  functionMapIdx?: number | undefined;
1766
1934
  attemptToken: string;
1935
+ fromInputPlane: boolean;
1767
1936
  }
1768
1937
  declare const FunctionGetInputsItem: MessageFns$1<FunctionGetInputsItem>;
1769
1938
  interface FunctionGetInputsRequest {
@@ -1987,6 +2156,8 @@ interface FunctionPutOutputsItem {
1987
2156
  functionCallId: string;
1988
2157
  /** injected by the worker */
1989
2158
  functionMapIdx?: number | undefined;
2159
+ /** injected by the worker */
2160
+ fromInputPlane: boolean;
1990
2161
  }
1991
2162
  declare const FunctionPutOutputsItem: MessageFns$1<FunctionPutOutputsItem>;
1992
2163
  interface FunctionPutOutputsRequest {
@@ -2029,6 +2200,7 @@ interface FunctionStats$1 {
2029
2200
  backlog: number;
2030
2201
  numTotalTasks: number;
2031
2202
  numRunningInputs: number;
2203
+ inputHeadroom: number;
2032
2204
  }
2033
2205
  declare const FunctionStats$1: MessageFns$1<FunctionStats$1>;
2034
2206
  interface FunctionUpdateSchedulingParamsRequest {
@@ -2460,6 +2632,17 @@ interface PortSpecs {
2460
2632
  ports: PortSpec[];
2461
2633
  }
2462
2634
  declare const PortSpecs: MessageFns$1<PortSpecs>;
2635
+ interface Probe$1 {
2636
+ tcpPort?: number | undefined;
2637
+ execCommand?: Probe_ExecCommand | undefined;
2638
+ intervalMs?: number | undefined;
2639
+ }
2640
+ declare const Probe$1: MessageFns$1<Probe$1>;
2641
+ interface Probe_ExecCommand {
2642
+ /** Command and args to execute directly (argv form, not shell-parsed). */
2643
+ argv: string[];
2644
+ }
2645
+ declare const Probe_ExecCommand: MessageFns$1<Probe_ExecCommand>;
2463
2646
  interface Proxy$1 {
2464
2647
  name: string;
2465
2648
  createdAt: number;
@@ -2717,6 +2900,7 @@ interface Sandbox$1 {
2717
2900
  nfsMounts: SharedVolumeMount[];
2718
2901
  /** For internal debugging use only. */
2719
2902
  runtimeDebug: boolean;
2903
+ /** deprecated, use network_access instead */
2720
2904
  blockNetwork: boolean;
2721
2905
  s3Mounts: S3Mount[];
2722
2906
  cloudBucketMounts: CloudBucketMount$1[];
@@ -2762,9 +2946,9 @@ interface Sandbox$1 {
2762
2946
  /** Optional idle timeout in seconds. If set, the sandbox will be terminated after being idle for this duration. */
2763
2947
  idleTimeoutSecs?: number | undefined;
2764
2948
  /**
2765
- * If set, the sandbox will be created with direct sandbox commands enabled.
2766
- * Exec commands for the sandbox will be issued directly to the sandbox
2767
- * command router running on the Modal worker.
2949
+ * Deprecated: direct sandbox commands are always enabled.
2950
+ *
2951
+ * @deprecated
2768
2952
  */
2769
2953
  directSandboxCommandsEnabled: boolean;
2770
2954
  /**
@@ -2781,6 +2965,13 @@ interface Sandbox$1 {
2781
2965
  * for OIDC-based authentication (e.g. to AWS, GCP).
2782
2966
  */
2783
2967
  includeOidcIdentityToken: boolean;
2968
+ /** Probe used to determine when the sandbox has become ready. */
2969
+ readinessProbe?: Probe$1 | undefined;
2970
+ /**
2971
+ * If set, only connections from these CIDRs will be allowed to connect to the sandbox
2972
+ * (tunnels and auth proxy).
2973
+ */
2974
+ inboundCidrAllowlist: string[];
2784
2975
  }
2785
2976
  declare const Sandbox$1: MessageFns$1<Sandbox$1>;
2786
2977
  interface SandboxCreateConnectTokenRequest {
@@ -2798,6 +2989,7 @@ interface SandboxCreateRequest {
2798
2989
  definition: Sandbox$1 | undefined;
2799
2990
  /** DEPRECATED* 7/16/2025 */
2800
2991
  environmentName: string;
2992
+ tags: SandboxTag[];
2801
2993
  }
2802
2994
  declare const SandboxCreateRequest: MessageFns$1<SandboxCreateRequest>;
2803
2995
  interface SandboxCreateResponse {
@@ -2812,8 +3004,28 @@ declare const SandboxCreateV2Request: MessageFns$1<SandboxCreateV2Request>;
2812
3004
  interface SandboxCreateV2Response {
2813
3005
  sandboxId: string;
2814
3006
  tunnels: TunnelData[];
3007
+ taskId: string;
2815
3008
  }
2816
3009
  declare const SandboxCreateV2Response: MessageFns$1<SandboxCreateV2Response>;
3010
+ /**
3011
+ * Used by the sandbox controller to get command router access for V2 sandboxes.
3012
+ * For all other use cases, use TaskGetCommandRouterAccess instead.
3013
+ */
3014
+ interface SandboxGetCommandRouterAccessRequest {
3015
+ sandboxId: string;
3016
+ }
3017
+ declare const SandboxGetCommandRouterAccessRequest: MessageFns$1<SandboxGetCommandRouterAccessRequest>;
3018
+ interface SandboxGetCommandRouterAccessResponse {
3019
+ jwt: string;
3020
+ url: string;
3021
+ /**
3022
+ * Worker's public IPv4 address. When set, clients should connect directly
3023
+ * to this IP while still using the URL's hostname for TLS SNI and the
3024
+ * HTTP/2 :authority header.
3025
+ */
3026
+ workerIpv4Address: string;
3027
+ }
3028
+ declare const SandboxGetCommandRouterAccessResponse: MessageFns$1<SandboxGetCommandRouterAccessResponse>;
2817
3029
  interface SandboxGetFromNameRequest {
2818
3030
  sandboxName: string;
2819
3031
  environmentName: string;
@@ -2884,6 +3096,9 @@ interface SandboxInfo {
2884
3096
  regions: string[];
2885
3097
  timeoutSecs: number;
2886
3098
  idleTimeoutSecs?: number | undefined;
3099
+ readyAt?: number | undefined;
3100
+ readinessProbe?: Probe$1 | undefined;
3101
+ tunnels: TunnelData[];
2887
3102
  }
2888
3103
  declare const SandboxInfo: MessageFns$1<SandboxInfo>;
2889
3104
  interface SandboxListRequest {
@@ -3004,6 +3219,15 @@ interface SandboxWaitResponse {
3004
3219
  result: GenericResult | undefined;
3005
3220
  }
3006
3221
  declare const SandboxWaitResponse: MessageFns$1<SandboxWaitResponse>;
3222
+ interface SandboxWaitUntilReadyRequest {
3223
+ sandboxId: string;
3224
+ timeout: number;
3225
+ }
3226
+ declare const SandboxWaitUntilReadyRequest: MessageFns$1<SandboxWaitUntilReadyRequest>;
3227
+ interface SandboxWaitUntilReadyResponse {
3228
+ readyAt: number;
3229
+ }
3230
+ declare const SandboxWaitUntilReadyResponse: MessageFns$1<SandboxWaitUntilReadyResponse>;
3007
3231
  interface Schedule {
3008
3232
  cron?: Schedule_Cron | undefined;
3009
3233
  period?: Schedule_Period | undefined;
@@ -3096,12 +3320,26 @@ interface SecretUpdateRequest_Update {
3096
3320
  value?: string | undefined;
3097
3321
  }
3098
3322
  declare const SecretUpdateRequest_Update: MessageFns$1<SecretUpdateRequest_Update>;
3323
+ interface ServiceUser {
3324
+ name: string;
3325
+ tokenId: string;
3326
+ createdBy: string;
3327
+ createdAt: number;
3328
+ lastUsedAt: number;
3329
+ createdByAvatarUrl: string;
3330
+ serviceUserId: string;
3331
+ }
3332
+ declare const ServiceUser: MessageFns$1<ServiceUser>;
3099
3333
  interface ServiceUserIdentity {
3100
3334
  serviceUserId: string;
3101
3335
  serviceUserName: string;
3102
3336
  createdBy: UserIdentity | undefined;
3103
3337
  }
3104
3338
  declare const ServiceUserIdentity: MessageFns$1<ServiceUserIdentity>;
3339
+ interface ServiceUserListResponse {
3340
+ serviceUsers: ServiceUser[];
3341
+ }
3342
+ declare const ServiceUserListResponse: MessageFns$1<ServiceUserListResponse>;
3105
3343
  interface SharedVolumeDeleteRequest {
3106
3344
  sharedVolumeId: string;
3107
3345
  }
@@ -3220,6 +3458,15 @@ interface TaskGetCommandRouterAccessResponse {
3220
3458
  url: string;
3221
3459
  }
3222
3460
  declare const TaskGetCommandRouterAccessResponse: MessageFns$1<TaskGetCommandRouterAccessResponse>;
3461
+ interface TaskGetInfoRequest {
3462
+ taskId: string;
3463
+ }
3464
+ declare const TaskGetInfoRequest: MessageFns$1<TaskGetInfoRequest>;
3465
+ interface TaskGetInfoResponse {
3466
+ appId: string;
3467
+ info: TaskInfo | undefined;
3468
+ }
3469
+ declare const TaskGetInfoResponse: MessageFns$1<TaskGetInfoResponse>;
3223
3470
  interface TaskInfo {
3224
3471
  id: string;
3225
3472
  startedAt: number;
@@ -3250,6 +3497,8 @@ interface TaskLogs {
3250
3497
  functionCallId: string;
3251
3498
  inputId: string;
3252
3499
  timestampNs: number;
3500
+ containerId: string;
3501
+ containerName: string;
3253
3502
  }
3254
3503
  declare const TaskLogs: MessageFns$1<TaskLogs>;
3255
3504
  interface TaskLogsBatch {
@@ -3299,6 +3548,19 @@ interface TaskTemplate {
3299
3548
  index: number;
3300
3549
  }
3301
3550
  declare const TaskTemplate: MessageFns$1<TaskTemplate>;
3551
+ interface TemplateListRequest {
3552
+ }
3553
+ declare const TemplateListRequest: MessageFns$1<TemplateListRequest>;
3554
+ interface TemplateListResponse {
3555
+ items: TemplateListResponse_TemplateListItem[];
3556
+ }
3557
+ declare const TemplateListResponse: MessageFns$1<TemplateListResponse>;
3558
+ interface TemplateListResponse_TemplateListItem {
3559
+ name: string;
3560
+ repo: string;
3561
+ ref: string;
3562
+ }
3563
+ declare const TemplateListResponse_TemplateListItem: MessageFns$1<TemplateListResponse_TemplateListItem>;
3302
3564
  interface TokenFlowCreateRequest {
3303
3565
  utmSource: string;
3304
3566
  localhostPort: number;
@@ -3528,6 +3790,7 @@ interface VolumeMount {
3528
3790
  mountPath: string;
3529
3791
  allowBackgroundCommits: boolean;
3530
3792
  readOnly: boolean;
3793
+ subPath?: string | undefined;
3531
3794
  }
3532
3795
  declare const VolumeMount: MessageFns$1<VolumeMount>;
3533
3796
  interface VolumePutFiles2Request {
@@ -3693,6 +3956,23 @@ interface WorkspaceDashboardUrlResponse {
3693
3956
  url: string;
3694
3957
  }
3695
3958
  declare const WorkspaceDashboardUrlResponse: MessageFns$1<WorkspaceDashboardUrlResponse>;
3959
+ interface WorkspaceMembersListItem {
3960
+ memberId: string;
3961
+ memberDisplayname: string;
3962
+ memberRole: MemberRole;
3963
+ joinedAt: number;
3964
+ lastActiveAt: number;
3965
+ deletedAt: number;
3966
+ userId: string;
3967
+ identityProviderType: IdentityProviderType;
3968
+ email: string;
3969
+ avatarUrl: string;
3970
+ }
3971
+ declare const WorkspaceMembersListItem: MessageFns$1<WorkspaceMembersListItem>;
3972
+ interface WorkspaceMembersListResponse {
3973
+ members: WorkspaceMembersListItem[];
3974
+ }
3975
+ declare const WorkspaceMembersListResponse: MessageFns$1<WorkspaceMembersListResponse>;
3696
3976
  interface WorkspaceNameLookupResponse {
3697
3977
  /** @deprecated */
3698
3978
  workspaceName: string;
@@ -3769,6 +4049,14 @@ declare const ModalClientDefinition: {
3769
4049
  readonly responseStream: false;
3770
4050
  readonly options: {};
3771
4051
  };
4052
+ readonly appGetLifecycle: {
4053
+ readonly name: "AppGetLifecycle";
4054
+ readonly requestType: MessageFns$1<AppGetLifecycleRequest>;
4055
+ readonly requestStream: false;
4056
+ readonly responseType: MessageFns$1<AppGetLifecycleResponse>;
4057
+ readonly responseStream: false;
4058
+ readonly options: {};
4059
+ };
3772
4060
  readonly appGetLogs: {
3773
4061
  readonly name: "AppGetLogs";
3774
4062
  readonly requestType: MessageFns$1<AppGetLogsRequest>;
@@ -3841,6 +4129,14 @@ declare const ModalClientDefinition: {
3841
4129
  readonly responseStream: false;
3842
4130
  readonly options: {};
3843
4131
  };
4132
+ readonly appRollover: {
4133
+ readonly name: "AppRollover";
4134
+ readonly requestType: MessageFns$1<AppRolloverRequest>;
4135
+ readonly requestStream: false;
4136
+ readonly responseType: MessageFns$1<AppRolloverResponse>;
4137
+ readonly responseStream: false;
4138
+ readonly options: {};
4139
+ };
3844
4140
  readonly appSetObjects: {
3845
4141
  readonly name: "AppSetObjects";
3846
4142
  readonly requestType: MessageFns$1<AppSetObjectsRequest>;
@@ -4178,6 +4474,15 @@ declare const ModalClientDefinition: {
4178
4474
  readonly responseStream: false;
4179
4475
  readonly options: {};
4180
4476
  };
4477
+ /** Endpoints */
4478
+ readonly endpointCreate: {
4479
+ readonly name: "EndpointCreate";
4480
+ readonly requestType: MessageFns$1<EndpointCreateRequest>;
4481
+ readonly requestStream: false;
4482
+ readonly responseType: MessageFns$1<EndpointCreateResponse>;
4483
+ readonly responseStream: false;
4484
+ readonly options: {};
4485
+ };
4181
4486
  /** Environments */
4182
4487
  readonly environmentCreate: {
4183
4488
  readonly name: "EnvironmentCreate";
@@ -4195,6 +4500,14 @@ declare const ModalClientDefinition: {
4195
4500
  readonly responseStream: false;
4196
4501
  readonly options: {};
4197
4502
  };
4503
+ readonly environmentGetManaged: {
4504
+ readonly name: "EnvironmentGetManaged";
4505
+ readonly requestType: MessageFns$1<EnvironmentGetManagedRequest>;
4506
+ readonly requestStream: false;
4507
+ readonly responseType: MessageFns$1<EnvironmentGetManagedResponse>;
4508
+ readonly responseStream: false;
4509
+ readonly options: {};
4510
+ };
4198
4511
  readonly environmentGetOrCreate: {
4199
4512
  readonly name: "EnvironmentGetOrCreate";
4200
4513
  readonly requestType: MessageFns$1<EnvironmentGetOrCreateRequest>;
@@ -4211,6 +4524,22 @@ declare const ModalClientDefinition: {
4211
4524
  readonly responseStream: false;
4212
4525
  readonly options: {};
4213
4526
  };
4527
+ readonly environmentRoleSet: {
4528
+ readonly name: "EnvironmentRoleSet";
4529
+ readonly requestType: MessageFns$1<EnvironmentRoleSetRequest>;
4530
+ readonly requestStream: false;
4531
+ readonly responseType: MessageFns$2<Empty>;
4532
+ readonly responseStream: false;
4533
+ readonly options: {};
4534
+ };
4535
+ readonly environmentSetManaged: {
4536
+ readonly name: "EnvironmentSetManaged";
4537
+ readonly requestType: MessageFns$1<EnvironmentSetManagedRequest>;
4538
+ readonly requestStream: false;
4539
+ readonly responseType: MessageFns$2<Empty>;
4540
+ readonly responseStream: false;
4541
+ readonly options: {};
4542
+ };
4214
4543
  readonly environmentUpdate: {
4215
4544
  readonly name: "EnvironmentUpdate";
4216
4545
  readonly requestType: MessageFns$1<EnvironmentUpdateRequest>;
@@ -4696,6 +5025,14 @@ declare const ModalClientDefinition: {
4696
5025
  readonly responseStream: false;
4697
5026
  readonly options: {};
4698
5027
  };
5028
+ readonly sandboxGetCommandRouterAccess: {
5029
+ readonly name: "SandboxGetCommandRouterAccess";
5030
+ readonly requestType: MessageFns$1<SandboxGetCommandRouterAccessRequest>;
5031
+ readonly requestStream: false;
5032
+ readonly responseType: MessageFns$1<SandboxGetCommandRouterAccessResponse>;
5033
+ readonly responseStream: false;
5034
+ readonly options: {};
5035
+ };
4699
5036
  readonly sandboxGetFromName: {
4700
5037
  readonly name: "SandboxGetFromName";
4701
5038
  readonly requestType: MessageFns$1<SandboxGetFromNameRequest>;
@@ -4729,6 +5066,14 @@ declare const ModalClientDefinition: {
4729
5066
  readonly responseStream: false;
4730
5067
  readonly options: {};
4731
5068
  };
5069
+ readonly sandboxGetTaskIdV2: {
5070
+ readonly name: "SandboxGetTaskIdV2";
5071
+ readonly requestType: MessageFns$1<SandboxGetTaskIdRequest>;
5072
+ readonly requestStream: false;
5073
+ readonly responseType: MessageFns$1<SandboxGetTaskIdResponse>;
5074
+ readonly responseStream: false;
5075
+ readonly options: {};
5076
+ };
4732
5077
  readonly sandboxGetTunnels: {
4733
5078
  readonly name: "SandboxGetTunnels";
4734
5079
  readonly requestType: MessageFns$1<SandboxGetTunnelsRequest>;
@@ -4737,6 +5082,14 @@ declare const ModalClientDefinition: {
4737
5082
  readonly responseStream: false;
4738
5083
  readonly options: {};
4739
5084
  };
5085
+ readonly sandboxGetTunnelsV2: {
5086
+ readonly name: "SandboxGetTunnelsV2";
5087
+ readonly requestType: MessageFns$1<SandboxGetTunnelsRequest>;
5088
+ readonly requestStream: false;
5089
+ readonly responseType: MessageFns$1<SandboxGetTunnelsResponse>;
5090
+ readonly responseStream: false;
5091
+ readonly options: {};
5092
+ };
4740
5093
  readonly sandboxList: {
4741
5094
  readonly name: "SandboxList";
4742
5095
  readonly requestType: MessageFns$1<SandboxListRequest>;
@@ -4833,6 +5186,14 @@ declare const ModalClientDefinition: {
4833
5186
  readonly responseStream: false;
4834
5187
  readonly options: {};
4835
5188
  };
5189
+ readonly sandboxTerminateV2: {
5190
+ readonly name: "SandboxTerminateV2";
5191
+ readonly requestType: MessageFns$1<SandboxTerminateRequest>;
5192
+ readonly requestStream: false;
5193
+ readonly responseType: MessageFns$1<SandboxTerminateResponse>;
5194
+ readonly responseStream: false;
5195
+ readonly options: {};
5196
+ };
4836
5197
  readonly sandboxWait: {
4837
5198
  readonly name: "SandboxWait";
4838
5199
  readonly requestType: MessageFns$1<SandboxWaitRequest>;
@@ -4841,6 +5202,22 @@ declare const ModalClientDefinition: {
4841
5202
  readonly responseStream: false;
4842
5203
  readonly options: {};
4843
5204
  };
5205
+ readonly sandboxWaitUntilReady: {
5206
+ readonly name: "SandboxWaitUntilReady";
5207
+ readonly requestType: MessageFns$1<SandboxWaitUntilReadyRequest>;
5208
+ readonly requestStream: false;
5209
+ readonly responseType: MessageFns$1<SandboxWaitUntilReadyResponse>;
5210
+ readonly responseStream: false;
5211
+ readonly options: {};
5212
+ };
5213
+ readonly sandboxWaitV2: {
5214
+ readonly name: "SandboxWaitV2";
5215
+ readonly requestType: MessageFns$1<SandboxWaitRequest>;
5216
+ readonly requestStream: false;
5217
+ readonly responseType: MessageFns$1<SandboxWaitResponse>;
5218
+ readonly responseStream: false;
5219
+ readonly options: {};
5220
+ };
4844
5221
  /** Secrets */
4845
5222
  readonly secretDelete: {
4846
5223
  readonly name: "SecretDelete";
@@ -4874,6 +5251,15 @@ declare const ModalClientDefinition: {
4874
5251
  readonly responseStream: false;
4875
5252
  readonly options: {};
4876
5253
  };
5254
+ /** Service users */
5255
+ readonly serviceUserList: {
5256
+ readonly name: "ServiceUserList";
5257
+ readonly requestType: MessageFns$2<Empty>;
5258
+ readonly requestStream: false;
5259
+ readonly responseType: MessageFns$1<ServiceUserListResponse>;
5260
+ readonly responseStream: false;
5261
+ readonly options: {};
5262
+ };
4877
5263
  /** SharedVolumes */
4878
5264
  readonly sharedVolumeDelete: {
4879
5265
  readonly name: "SharedVolumeDelete";
@@ -4972,6 +5358,14 @@ declare const ModalClientDefinition: {
4972
5358
  readonly responseStream: false;
4973
5359
  readonly options: {};
4974
5360
  };
5361
+ readonly taskGetInfo: {
5362
+ readonly name: "TaskGetInfo";
5363
+ readonly requestType: MessageFns$1<TaskGetInfoRequest>;
5364
+ readonly requestStream: false;
5365
+ readonly responseType: MessageFns$1<TaskGetInfoResponse>;
5366
+ readonly responseStream: false;
5367
+ readonly options: {};
5368
+ };
4975
5369
  readonly taskList: {
4976
5370
  readonly name: "TaskList";
4977
5371
  readonly requestType: MessageFns$1<TaskListRequest>;
@@ -4988,6 +5382,15 @@ declare const ModalClientDefinition: {
4988
5382
  readonly responseStream: false;
4989
5383
  readonly options: {};
4990
5384
  };
5385
+ /** Templates */
5386
+ readonly templateList: {
5387
+ readonly name: "TemplateList";
5388
+ readonly requestType: MessageFns$1<TemplateListRequest>;
5389
+ readonly requestStream: false;
5390
+ readonly responseType: MessageFns$1<TemplateListResponse>;
5391
+ readonly responseStream: false;
5392
+ readonly options: {};
5393
+ };
4991
5394
  /** Tokens (web auth flow) */
4992
5395
  readonly tokenFlowCreate: {
4993
5396
  readonly name: "TokenFlowCreate";
@@ -5192,6 +5595,14 @@ declare const ModalClientDefinition: {
5192
5595
  readonly responseStream: false;
5193
5596
  readonly options: {};
5194
5597
  };
5598
+ readonly workspaceMembersList: {
5599
+ readonly name: "WorkspaceMembersList";
5600
+ readonly requestType: MessageFns$2<Empty>;
5601
+ readonly requestStream: false;
5602
+ readonly responseType: MessageFns$1<WorkspaceMembersListResponse>;
5603
+ readonly responseStream: false;
5604
+ readonly options: {};
5605
+ };
5195
5606
  readonly workspaceNameLookup: {
5196
5607
  readonly name: "WorkspaceNameLookup";
5197
5608
  readonly requestType: MessageFns$2<Empty>;
@@ -5403,8 +5814,8 @@ declare class Function_ {
5403
5814
  getCurrentStats(): Promise<FunctionStats>;
5404
5815
  updateAutoscaler(params: FunctionUpdateAutoscalerParams): Promise<void>;
5405
5816
  /**
5406
- * URL of a Function running as a web endpoint.
5407
- * @returns The web URL if this Function is a web endpoint, otherwise undefined
5817
+ * URL for addressing the Web Function via HTTP.
5818
+ * @returns The web URL, or undefined if this is not a Web Function
5408
5819
  */
5409
5820
  getWebUrl(): Promise<string | undefined>;
5410
5821
  }
@@ -5932,6 +6343,12 @@ interface TaskExecStartRequest {
5932
6343
  * internal debugging.
5933
6344
  */
5934
6345
  runtimeDebug: boolean;
6346
+ /** Fully qualified target container ID. Empty targets the main container. */
6347
+ containerId: string;
6348
+ /** Environment variables to set directly for the exec'd command. */
6349
+ env: {
6350
+ [key: string]: string;
6351
+ };
5935
6352
  }
5936
6353
  declare const TaskExecStartRequest: MessageFns<TaskExecStartRequest>;
5937
6354
  interface TaskExecStartResponse {
@@ -5961,12 +6378,53 @@ declare const TaskMountDirectoryRequest: MessageFns<TaskMountDirectoryRequest>;
5961
6378
  interface TaskSnapshotDirectoryRequest {
5962
6379
  taskId: string;
5963
6380
  path: Uint8Array;
6381
+ /** A unique ID to ensure idempotency of directory snapshot requests. */
6382
+ snapshotId: string;
6383
+ /**
6384
+ * Lifetime for the resulting image, in seconds. When set, the
6385
+ * image's expires_at is a hard cutoff: it is fixed at creation time
6386
+ * and is not extended on use.
6387
+ *
6388
+ * When unset, the resulting image gets the legacy retention policy:
6389
+ * a 30-day TTL that is bumped forward by 30 days on every use, so
6390
+ * active images effectively never expire.
6391
+ *
6392
+ * Sentinel: -1 means "no expiry" (the image never expires).
6393
+ * 0 and other negative values are invalid and rejected by the
6394
+ * server.
6395
+ */
6396
+ ttlSeconds?: number | undefined;
5964
6397
  }
5965
6398
  declare const TaskSnapshotDirectoryRequest: MessageFns<TaskSnapshotDirectoryRequest>;
5966
6399
  interface TaskSnapshotDirectoryResponse {
5967
6400
  imageId: string;
5968
6401
  }
5969
6402
  declare const TaskSnapshotDirectoryResponse: MessageFns<TaskSnapshotDirectoryResponse>;
6403
+ interface TaskSnapshotFilesystemRequest {
6404
+ taskId: string;
6405
+ /** A unique ID to ensure idempotency of filesystem snapshot requests. */
6406
+ snapshotId: string;
6407
+ /**
6408
+ * Lifetime for the resulting image, in seconds. Must be set. When positive,
6409
+ * the image expiry is a hard cutoff: it is fixed at creation time and is
6410
+ * not extended on use.
6411
+ *
6412
+ * Sentinel: -1 means "no expiry" (the image never expires).
6413
+ * 0 and other negative values are invalid and rejected by the
6414
+ * server.
6415
+ */
6416
+ ttlSeconds?: number | undefined;
6417
+ }
6418
+ declare const TaskSnapshotFilesystemRequest: MessageFns<TaskSnapshotFilesystemRequest>;
6419
+ interface TaskSnapshotFilesystemResponse {
6420
+ imageId: string;
6421
+ }
6422
+ declare const TaskSnapshotFilesystemResponse: MessageFns<TaskSnapshotFilesystemResponse>;
6423
+ interface TaskUnmountDirectoryRequest {
6424
+ taskId: string;
6425
+ path: Uint8Array;
6426
+ }
6427
+ declare const TaskUnmountDirectoryRequest: MessageFns<TaskUnmountDirectoryRequest>;
5970
6428
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
5971
6429
  type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
5972
6430
  [K in keyof T]?: DeepPartial<T[K]>;
@@ -5996,6 +6454,8 @@ interface Profile {
5996
6454
  environment?: string;
5997
6455
  imageBuilderVersion?: string;
5998
6456
  logLevel?: string;
6457
+ /** Parsed from MODAL_MAX_THROTTLE_WAIT. null means unlimited. */
6458
+ maxThrottleWaitSecs?: number;
5999
6459
  }
6000
6460
 
6001
6461
  /** @ignore */
@@ -6004,13 +6464,15 @@ declare class TaskCommandRouterClientImpl {
6004
6464
  private channel;
6005
6465
  private serverClient;
6006
6466
  private taskId;
6467
+ private sandboxId;
6468
+ private isV2;
6007
6469
  private serverUrl;
6008
6470
  private jwt;
6009
6471
  private jwtExp;
6010
6472
  private jwtRefreshLock;
6011
6473
  private logger;
6012
6474
  private closed;
6013
- static tryInit(serverClient: ModalGrpcClient, taskId: string, logger: Logger, profile: Profile): Promise<TaskCommandRouterClientImpl | null>;
6475
+ static tryInit(serverClient: ModalGrpcClient, taskId: string, sandboxId: string, isV2: boolean, logger: Logger, profile: Profile): Promise<TaskCommandRouterClientImpl | null>;
6014
6476
  private constructor();
6015
6477
  close(): void;
6016
6478
  execStart(request: TaskExecStartRequest): Promise<TaskExecStartResponse>;
@@ -6020,6 +6482,8 @@ declare class TaskCommandRouterClientImpl {
6020
6482
  execWait(taskId: string, execId: string, deadline?: number | null): Promise<TaskExecWaitResponse>;
6021
6483
  mountDirectory(request: TaskMountDirectoryRequest): Promise<void>;
6022
6484
  snapshotDirectory(request: TaskSnapshotDirectoryRequest): Promise<TaskSnapshotDirectoryResponse>;
6485
+ snapshotFilesystem(request: TaskSnapshotFilesystemRequest, options?: TimeoutOptions): Promise<TaskSnapshotFilesystemResponse>;
6486
+ unmountDirectory(request: TaskUnmountDirectoryRequest): Promise<void>;
6023
6487
  private refreshJwt;
6024
6488
  private callWithAuthRetry;
6025
6489
  private streamStdio;
@@ -6042,7 +6506,7 @@ declare class SandboxFile {
6042
6506
  read(): Promise<Uint8Array>;
6043
6507
  /**
6044
6508
  * Write data to the file.
6045
- * @param data - Data to write (string or Uint8Array)
6509
+ * @param data - Data to write
6046
6510
  */
6047
6511
  write(data: Uint8Array): Promise<void>;
6048
6512
  /**
@@ -6105,6 +6569,19 @@ type StdioBehavior = "pipe" | "ignore";
6105
6569
  * means the data will be read as raw bytes (Uint8Array).
6106
6570
  */
6107
6571
  type StreamMode = "text" | "binary";
6572
+ /** Optional parameters for {@link Probe.withTcp} and {@link Probe.withExec}. */
6573
+ type ProbeParams = {
6574
+ intervalMs: number;
6575
+ };
6576
+ /** Probe configuration for sandbox readiness checks. */
6577
+ declare class Probe {
6578
+ #private;
6579
+ private constructor();
6580
+ static withTcp(port: number, params?: ProbeParams): Probe;
6581
+ static withExec(argv: string[], params?: ProbeParams): Probe;
6582
+ /** @ignore */
6583
+ toProto(): Probe$1;
6584
+ }
6108
6585
  /** Optional parameters for {@link SandboxService#create client.sandboxes.create()}. */
6109
6586
  type SandboxCreateParams = {
6110
6587
  /** Reservation of physical CPU cores for the Sandbox, can be fractional. */
@@ -6136,7 +6613,8 @@ type SandboxCreateParams = {
6136
6613
  volumes?: Record<string, Volume>;
6137
6614
  /** Mount points for {@link CloudBucketMount}s. */
6138
6615
  cloudBucketMounts?: Record<string, CloudBucketMount>;
6139
- /** Enable a PTY for the Sandbox. */
6616
+ /** Enable a PTY for the Sandbox entrypoint command. When enabled, all output (stdout and
6617
+ * stderr from the process) is multiplexed into stdout, and the stderr stream is effectively empty. */
6140
6618
  pty?: boolean;
6141
6619
  /** List of ports to tunnel into the Sandbox. Encrypted ports are tunneled with TLS. */
6142
6620
  encryptedPorts?: number[];
@@ -6146,8 +6624,14 @@ type SandboxCreateParams = {
6146
6624
  unencryptedPorts?: number[];
6147
6625
  /** Whether to block all network access from the Sandbox. */
6148
6626
  blockNetwork?: boolean;
6149
- /** List of CIDRs the Sandbox is allowed to access. If None, all CIDRs are allowed. Cannot be used with blockNetwork. */
6627
+ /** List of CIDRs the Sandbox is allowed to access. If not set, all CIDRs are allowed. Cannot be used with blockNetwork. */
6628
+ outboundCidrAllowlist?: string[];
6629
+ /**
6630
+ * @deprecated Use {@link outboundCidrAllowlist} instead.
6631
+ */
6150
6632
  cidrAllowlist?: string[];
6633
+ /** List of CIDRs allowed to connect inbound to the Sandbox (tunnels and connection tokens). If not set, all IPs are allowed. Cannot be used with blockNetwork. */
6634
+ inboundCidrAllowlist?: string[];
6151
6635
  /** Cloud provider to run the Sandbox on. */
6152
6636
  cloud?: string;
6153
6637
  /** Region(s) to run the Sandbox on. */
@@ -6156,14 +6640,20 @@ type SandboxCreateParams = {
6156
6640
  verbose?: boolean;
6157
6641
  /** Reference to a Modal {@link Proxy} to use in front of this Sandbox. */
6158
6642
  proxy?: Proxy;
6643
+ /** Probe used to determine when the Sandbox has become ready. */
6644
+ readinessProbe?: Probe;
6159
6645
  /** Optional name for the Sandbox. Unique within an App. */
6160
6646
  name?: string;
6647
+ /** Tags to attach to the Sandbox. Filterable via {@link SandboxService#list Sandbox.list}. */
6648
+ tags?: Record<string, string>;
6161
6649
  /** Optional experimental options. */
6162
6650
  experimentalOptions?: Record<string, any>;
6163
6651
  /** If set, connections to this Sandbox will be subdomains of this domain rather than the default.
6164
6652
  * This requires prior manual setup by Modal and is only available for Enterprise customers.
6165
6653
  */
6166
6654
  customDomain?: string;
6655
+ /** If true, the sandbox will receive a MODAL_IDENTITY_TOKEN env var for OIDC-based auth (e.g. to AWS, GCP). */
6656
+ includeOidcIdentityToken?: boolean;
6167
6657
  };
6168
6658
  /**
6169
6659
  * Service for managing {@link Sandbox}es.
@@ -6181,6 +6671,10 @@ declare class SandboxService {
6181
6671
  * Create a new {@link Sandbox} in the {@link App} with the specified {@link Image} and options.
6182
6672
  */
6183
6673
  create(app: App, image: Image, params?: SandboxCreateParams): Promise<Sandbox>;
6674
+ /**
6675
+ * Create a new {@link Sandbox} using the experimental V2 backend.
6676
+ */
6677
+ experimentalCreate(app: App, image: Image, params?: SandboxCreateParams): Promise<Sandbox>;
6184
6678
  /** Returns a running {@link Sandbox} object from an ID.
6185
6679
  *
6186
6680
  * @returns Sandbox with ID
@@ -6232,7 +6726,8 @@ type SandboxExecParams = {
6232
6726
  env?: Record<string, string>;
6233
6727
  /** {@link Secret}s to inject as environment variables for the commmand.*/
6234
6728
  secrets?: Secret[];
6235
- /** Enable a PTY for the command. */
6729
+ /** Enable a PTY for the command. When enabled, all output (stdout and stderr from the
6730
+ * process) is multiplexed into stdout, and the stderr stream is effectively empty. */
6236
6731
  pty?: boolean;
6237
6732
  };
6238
6733
  /** Optional parameters for {@link Sandbox#createConnectToken Sandbox.createConnectToken()}. */
@@ -6269,7 +6764,11 @@ declare class Sandbox {
6269
6764
  #private;
6270
6765
  readonly sandboxId: string;
6271
6766
  /** @ignore */
6272
- constructor(client: ModalClient, sandboxId: string);
6767
+ constructor(client: ModalClient, sandboxId: string, params?: {
6768
+ isV2?: boolean;
6769
+ taskId?: string;
6770
+ tunnels?: Record<number, Tunnel>;
6771
+ });
6273
6772
  get stdin(): ModalWriteStream<string>;
6274
6773
  get stdout(): ModalReadStream<string>;
6275
6774
  get stderr(): ModalReadStream<string>;
@@ -6313,6 +6812,16 @@ declare class Sandbox {
6313
6812
  */
6314
6813
  detach(): void;
6315
6814
  wait(): Promise<number>;
6815
+ /**
6816
+ * Wait until the Sandbox readiness probe reports the Sandbox is ready.
6817
+ *
6818
+ * This method only works for Sandboxes configured with a readiness probe.
6819
+ *
6820
+ * @param timeoutMs - Maximum total time to wait, in milliseconds.
6821
+ * @returns A promise that resolves once the Sandbox is ready.
6822
+ * @throws {@link TimeoutError} If readiness is not reported before `timeoutMs`.
6823
+ */
6824
+ waitUntilReady(timeoutMs?: number): Promise<void>;
6316
6825
  /** Get {@link Tunnel} metadata for the Sandbox.
6317
6826
  *
6318
6827
  * Raises {@link SandboxTimeoutError} if the tunnels are not available after the timeout.
@@ -6325,7 +6834,11 @@ declare class Sandbox {
6325
6834
  *
6326
6835
  * Returns an {@link Image} object which can be used to spawn a new Sandbox with the same filesystem.
6327
6836
  *
6328
- * @param timeoutMs - Timeout for the snapshot operation in milliseconds
6837
+ * `timeoutMs` is propagated as the gRPC deadline. If the snapshot does
6838
+ * not return within that window, the call is cancelled and an error is
6839
+ * thrown.
6840
+ *
6841
+ * @param timeoutMs - Timeout for the snapshot operation in milliseconds.
6329
6842
  * @returns Promise that resolves to an {@link Image}
6330
6843
  */
6331
6844
  snapshotFilesystem(timeoutMs?: number): Promise<Image>;
@@ -6336,9 +6849,18 @@ declare class Sandbox {
6336
6849
  * @param image - Optional {@link Image} to mount. If undefined, mounts an empty directory.
6337
6850
  */
6338
6851
  mountImage(path: string, image?: Image): Promise<void>;
6852
+ /**
6853
+ * Unmounts an {@link Image} previously mounted at a path in the Sandbox filesystem.
6854
+ *
6855
+ * @param path - The mount path to unmount
6856
+ */
6857
+ unmountImage(path: string): Promise<void>;
6339
6858
  /**
6340
6859
  * Snapshots and creates a new {@link Image} from a directory in the running sandbox.
6341
6860
  *
6861
+ * Directory snapshots are currently persisted for 30 days after they
6862
+ * were created.
6863
+ *
6342
6864
  * @param path - The path of the directory to snapshot
6343
6865
  * @returns Promise that resolves to an {@link Image}
6344
6866
  */
@@ -6372,6 +6894,7 @@ interface ModalClientParams {
6372
6894
  endpoint?: string;
6373
6895
  timeoutMs?: number;
6374
6896
  maxRetries?: number;
6897
+ maxThrottleWaitSecs?: number;
6375
6898
  logger?: Logger;
6376
6899
  logLevel?: LogLevel;
6377
6900
  /**
@@ -6534,6 +7057,10 @@ declare class App {
6534
7057
  imageFromGcpArtifactRegistry(tag: string, secret: Secret): Promise<Image>;
6535
7058
  }
6536
7059
 
7060
+ /** An operation exceeds the allowed time limit. */
7061
+ declare class TimeoutError extends Error {
7062
+ constructor(message?: string);
7063
+ }
6537
7064
  /** Function execution exceeds the allowed time limit. */
6538
7065
  declare class FunctionTimeoutError extends Error {
6539
7066
  constructor(message: string);
@@ -6577,4 +7104,4 @@ declare class ClientClosedError extends Error {
6577
7104
 
6578
7105
  declare function checkForRenamedParams(params: any, renames: Record<string, string>): void;
6579
7106
 
6580
- export { AlreadyExistsError, App, type AppFromNameParams, AppService, ClientClosedError, 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, type SandboxTerminateParams, 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 };
7107
+ export { AlreadyExistsError, App, type AppFromNameParams, AppService, ClientClosedError, 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, Probe, type ProbeParams, 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, type SandboxTerminateParams, SandboxTimeoutError, Secret, type SecretDeleteParams, type SecretFromNameParams, type SecretFromObjectParams, SecretService, type StdioBehavior, type StreamMode, TimeoutError, Tunnel, Volume, type VolumeDeleteParams, type VolumeEphemeralParams, type VolumeFromNameParams, VolumeService, checkForRenamedParams, close, initializeClient };