modal 0.7.6 → 0.8.1

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
@@ -140,6 +140,22 @@ declare enum EndpointInputModality {
140
140
  ENDPOINT_INPUT_MODALITY_AUDIO = 3,
141
141
  UNRECOGNIZED = -1
142
142
  }
143
+ declare enum EndpointLifecycleStatus {
144
+ ENDPOINT_LIFECYCLE_STATUS_UNSPECIFIED = 0,
145
+ ENDPOINT_LIFECYCLE_STATUS_ACTIVE = 1,
146
+ ENDPOINT_LIFECYCLE_STATUS_STOPPED = 2,
147
+ UNRECOGNIZED = -1
148
+ }
149
+ declare enum EndpointProvisioningStatus {
150
+ ENDPOINT_PROVISIONING_STATUS_UNSPECIFIED = 0,
151
+ ENDPOINT_PROVISIONING_STATUS_PENDING = 1,
152
+ ENDPOINT_PROVISIONING_STATUS_RUNNING = 2,
153
+ ENDPOINT_PROVISIONING_STATUS_SUCCEEDED = 3,
154
+ ENDPOINT_PROVISIONING_STATUS_FAILED = 4,
155
+ ENDPOINT_PROVISIONING_STATUS_CANCELLING = 5,
156
+ ENDPOINT_PROVISIONING_STATUS_CANCELLED = 6,
157
+ UNRECOGNIZED = -1
158
+ }
143
159
  declare enum EndpointStopSource {
144
160
  ENDPOINT_STOP_SOURCE_UNSPECIFIED = 0,
145
161
  ENDPOINT_STOP_SOURCE_CLI = 1,
@@ -732,6 +748,12 @@ interface AppRollbackRequest {
732
748
  version: number;
733
749
  }
734
750
  declare const AppRollbackRequest: MessageFns$1<AppRollbackRequest>;
751
+ interface AppRollbackResponse {
752
+ url: string;
753
+ serverWarnings: Warning[];
754
+ deployedAt: number;
755
+ }
756
+ declare const AppRollbackResponse: MessageFns$1<AppRollbackResponse>;
735
757
  interface AppRolloverRequest {
736
758
  appId: string;
737
759
  }
@@ -820,6 +842,10 @@ interface AutoscalerSettings {
820
842
  scaleupWindow?: number | undefined;
821
843
  /** Maximum amount of time a container can be idle before being scaled down, in seconds; pka "container_idle_timeout" */
822
844
  scaledownWindow?: number | undefined;
845
+ /** Target concurrent inputs per replica for Flash autoscaling. */
846
+ targetConcurrency?: number | undefined;
847
+ /** Maximum number of containers that can be scaled down per minute for Flash autoscaling. */
848
+ scaledownRateLimit?: number | undefined;
823
849
  }
824
850
  declare const AutoscalerSettings: MessageFns$1<AutoscalerSettings>;
825
851
  interface BaseImage {
@@ -896,6 +922,7 @@ interface ClassGetRequest {
896
922
  environmentName: string;
897
923
  /** True starting with 0.67.x clients, which don't create method placeholder functions */
898
924
  onlyClassFunction: boolean;
925
+ appVersion: number;
899
926
  }
900
927
  declare const ClassGetRequest: MessageFns$1<ClassGetRequest>;
901
928
  interface ClassGetResponse {
@@ -1184,6 +1211,14 @@ interface CreationInfo {
1184
1211
  createdBy: string;
1185
1212
  }
1186
1213
  declare const CreationInfo: MessageFns$1<CreationInfo>;
1214
+ interface CurlAuthTokenRequest {
1215
+ url: string;
1216
+ }
1217
+ declare const CurlAuthTokenRequest: MessageFns$1<CurlAuthTokenRequest>;
1218
+ interface CurlAuthTokenResponse {
1219
+ token: string;
1220
+ }
1221
+ declare const CurlAuthTokenResponse: MessageFns$1<CurlAuthTokenResponse>;
1187
1222
  interface CustomDomainConfig {
1188
1223
  name: string;
1189
1224
  }
@@ -1377,10 +1412,13 @@ interface EndpointCreateRequest {
1377
1412
  apiSurfaces: EndpointApiSurface[];
1378
1413
  inputModalities: EndpointInputModality[];
1379
1414
  environmentName: string;
1415
+ unauthenticated: boolean;
1380
1416
  }
1381
1417
  declare const EndpointCreateRequest: MessageFns$1<EndpointCreateRequest>;
1382
1418
  interface EndpointCreateResponse {
1383
1419
  endpointId: string;
1420
+ endpointPageUrl: string;
1421
+ name: string;
1384
1422
  }
1385
1423
  declare const EndpointCreateResponse: MessageFns$1<EndpointCreateResponse>;
1386
1424
  interface EndpointCustomModelSource {
@@ -1389,12 +1427,42 @@ interface EndpointCustomModelSource {
1389
1427
  modalVolume?: EndpointModalVolumeModelSource | undefined;
1390
1428
  }
1391
1429
  declare const EndpointCustomModelSource: MessageFns$1<EndpointCustomModelSource>;
1430
+ interface EndpointGetByNameRequest {
1431
+ name: string;
1432
+ environmentName: string;
1433
+ }
1434
+ declare const EndpointGetByNameRequest: MessageFns$1<EndpointGetByNameRequest>;
1435
+ interface EndpointGetByNameResponse {
1436
+ endpointId: string;
1437
+ environmentName: string;
1438
+ }
1439
+ declare const EndpointGetByNameResponse: MessageFns$1<EndpointGetByNameResponse>;
1440
+ interface EndpointGetLifecycleRequest {
1441
+ endpointId: string;
1442
+ }
1443
+ declare const EndpointGetLifecycleRequest: MessageFns$1<EndpointGetLifecycleRequest>;
1444
+ interface EndpointGetLifecycleResponse {
1445
+ lifecycle: EndpointLifecycle | undefined;
1446
+ }
1447
+ declare const EndpointGetLifecycleResponse: MessageFns$1<EndpointGetLifecycleResponse>;
1392
1448
  interface EndpointHuggingFaceModelSource {
1393
1449
  repoId: string;
1394
1450
  revision: string;
1395
1451
  huggingfaceToken: string;
1396
1452
  }
1397
1453
  declare const EndpointHuggingFaceModelSource: MessageFns$1<EndpointHuggingFaceModelSource>;
1454
+ interface EndpointLifecycle {
1455
+ status: EndpointLifecycleStatus;
1456
+ createdAt: number;
1457
+ /** User or service user name */
1458
+ createdBy: string;
1459
+ /** Unset when Endpoint is active */
1460
+ stoppedAt: number;
1461
+ /** User or service user name */
1462
+ stoppedBy: string;
1463
+ environmentName: string;
1464
+ }
1465
+ declare const EndpointLifecycle: MessageFns$1<EndpointLifecycle>;
1398
1466
  interface EndpointListItem {
1399
1467
  endpointId: string;
1400
1468
  name: string;
@@ -1402,6 +1470,11 @@ interface EndpointListItem {
1402
1470
  activeDeploymentId: string;
1403
1471
  updatedAt: number;
1404
1472
  metadata: EndpointMetadata | undefined;
1473
+ appState: AppState;
1474
+ functionId: string;
1475
+ createdByAvatarUrl: string;
1476
+ provisioningStatus: EndpointProvisioningStatus;
1477
+ status: string;
1405
1478
  }
1406
1479
  declare const EndpointListItem: MessageFns$1<EndpointListItem>;
1407
1480
  interface EndpointListRequest {
@@ -1440,12 +1513,24 @@ declare const EndpointStopResponse: MessageFns$1<EndpointStopResponse>;
1440
1513
  interface EnvironmentCreateRequest {
1441
1514
  name: string;
1442
1515
  isManaged: boolean;
1516
+ settings: EnvironmentSettings | undefined;
1443
1517
  }
1444
1518
  declare const EnvironmentCreateRequest: MessageFns$1<EnvironmentCreateRequest>;
1445
1519
  interface EnvironmentDeleteRequest {
1446
1520
  name: string;
1447
1521
  }
1448
1522
  declare const EnvironmentDeleteRequest: MessageFns$1<EnvironmentDeleteRequest>;
1523
+ interface EnvironmentGetBudgetRequest {
1524
+ environmentId: string;
1525
+ }
1526
+ declare const EnvironmentGetBudgetRequest: MessageFns$1<EnvironmentGetBudgetRequest>;
1527
+ interface EnvironmentGetBudgetResponse {
1528
+ cycleBudgetDollars?: number | undefined;
1529
+ effectiveCycleSpendLimit: number;
1530
+ currentCycleUsage: number;
1531
+ spendLimitReached: boolean;
1532
+ }
1533
+ declare const EnvironmentGetBudgetResponse: MessageFns$1<EnvironmentGetBudgetResponse>;
1449
1534
  interface EnvironmentGetManagedRequest {
1450
1535
  environmentId: string;
1451
1536
  }
@@ -1490,6 +1575,11 @@ interface EnvironmentListItem {
1490
1575
  maxConcurrentGpus?: number | undefined;
1491
1576
  currentConcurrentTasks: number;
1492
1577
  currentConcurrentGpus: number;
1578
+ /** manager-set */
1579
+ cycleBudgetDollars?: number | undefined;
1580
+ effectiveCycleSpendLimit: number;
1581
+ currentCycleUsage: number;
1582
+ spendLimitReached: boolean;
1493
1583
  }
1494
1584
  declare const EnvironmentListItem: MessageFns$1<EnvironmentListItem>;
1495
1585
  interface EnvironmentListResponse {
@@ -1508,6 +1598,12 @@ interface EnvironmentRoleSetRequest {
1508
1598
  role: EnvironmentRole;
1509
1599
  }
1510
1600
  declare const EnvironmentRoleSetRequest: MessageFns$1<EnvironmentRoleSetRequest>;
1601
+ interface EnvironmentSetBudgetRequest {
1602
+ environmentId: string;
1603
+ cycleBudgetDollars?: number | undefined;
1604
+ clearBudget: boolean;
1605
+ }
1606
+ declare const EnvironmentSetBudgetRequest: MessageFns$1<EnvironmentSetBudgetRequest>;
1511
1607
  interface EnvironmentSetManagedRequest {
1512
1608
  environmentId: string;
1513
1609
  managed: boolean;
@@ -1521,6 +1617,8 @@ declare const EnvironmentSetManagedRequest: MessageFns$1<EnvironmentSetManagedRe
1521
1617
  interface EnvironmentSettings {
1522
1618
  imageBuilderVersion: string;
1523
1619
  webhookSuffix: string;
1620
+ maxConcurrentGpus?: number | undefined;
1621
+ maxConcurrentTasks?: number | undefined;
1524
1622
  }
1525
1623
  declare const EnvironmentSettings: MessageFns$1<EnvironmentSettings>;
1526
1624
  interface EnvironmentUpdateRequest {
@@ -1704,8 +1802,8 @@ interface FunctionMessage {
1704
1802
  [key: string]: string;
1705
1803
  };
1706
1804
  /**
1707
- * If set, client deps will be mounted into the container, and are
1708
- * no longer expected to exist in the image itself.
1805
+ * Deprecated: still set by client but ignored by server. The scheduler
1806
+ * derives this from the image's builder_version directly.
1709
1807
  */
1710
1808
  mountClientDependencies: boolean;
1711
1809
  flashServiceUrls: string[];
@@ -1744,7 +1842,7 @@ declare const FunctionAsyncInvokeResponse: MessageFns$1<FunctionAsyncInvokeRespo
1744
1842
  interface FunctionBindParamsRequest {
1745
1843
  functionId: string;
1746
1844
  serializedParams: Uint8Array;
1747
- functionOptions: FunctionOptions | undefined;
1845
+ functionOptions: FunctionOptions$1 | undefined;
1748
1846
  environmentName: string;
1749
1847
  /** Only used for the input plane. */
1750
1848
  authSecret: string;
@@ -1783,7 +1881,6 @@ interface FunctionCallGetDataRequest {
1783
1881
  functionCallId?: string | undefined;
1784
1882
  attemptToken?: string | undefined;
1785
1883
  lastIndex: number;
1786
- useGaplessRead: boolean;
1787
1884
  }
1788
1885
  declare const FunctionCallGetDataRequest: MessageFns$1<FunctionCallGetDataRequest>;
1789
1886
  interface FunctionCallInfo {
@@ -2033,6 +2130,7 @@ interface FunctionGetRequest {
2033
2130
  appName: string;
2034
2131
  objectTag: string;
2035
2132
  environmentName: string;
2133
+ appVersion: number;
2036
2134
  }
2037
2135
  declare const FunctionGetRequest: MessageFns$1<FunctionGetRequest>;
2038
2136
  interface FunctionGetResponse {
@@ -2111,7 +2209,8 @@ interface FunctionMapResponse {
2111
2209
  maxInputsOutstanding: number;
2112
2210
  }
2113
2211
  declare const FunctionMapResponse: MessageFns$1<FunctionMapResponse>;
2114
- interface FunctionOptions {
2212
+ /** todo(ayush): update this to also use `autoscaler_settings` */
2213
+ interface FunctionOptions$1 {
2115
2214
  secretIds: string[];
2116
2215
  /** Currently not supported */
2117
2216
  mountIds: string[];
@@ -2133,8 +2232,9 @@ interface FunctionOptions {
2133
2232
  cloudProviderStr?: string | undefined;
2134
2233
  replaceCloudBucketMounts: boolean;
2135
2234
  cloudBucketMounts: CloudBucketMount$1[];
2235
+ pinnedAppVersion?: number | undefined;
2136
2236
  }
2137
- declare const FunctionOptions: MessageFns$1<FunctionOptions>;
2237
+ declare const FunctionOptions$1: MessageFns$1<FunctionOptions$1>;
2138
2238
  interface FunctionPrecreateRequest {
2139
2239
  appId: string;
2140
2240
  functionName: string;
@@ -2292,6 +2392,7 @@ interface HTTPConfig {
2292
2392
  exitGracePeriod: number;
2293
2393
  h2Enabled: boolean;
2294
2394
  targetConcurrency: number;
2395
+ unauthenticated: boolean;
2295
2396
  }
2296
2397
  declare const HTTPConfig: MessageFns$1<HTTPConfig>;
2297
2398
  interface Image$1 {
@@ -2342,6 +2443,16 @@ interface ImageFromIdResponse {
2342
2443
  metadata: ImageMetadata | undefined;
2343
2444
  }
2344
2445
  declare const ImageFromIdResponse: MessageFns$1<ImageFromIdResponse>;
2446
+ interface ImageGetByTagRequest {
2447
+ /** Full "name:tag" string. Must be non-empty. */
2448
+ tag: string;
2449
+ environmentName: string;
2450
+ }
2451
+ declare const ImageGetByTagRequest: MessageFns$1<ImageGetByTagRequest>;
2452
+ interface ImageGetByTagResponse {
2453
+ imageId: string;
2454
+ }
2455
+ declare const ImageGetByTagResponse: MessageFns$1<ImageGetByTagResponse>;
2345
2456
  interface ImageGetOrCreateRequest {
2346
2457
  image: Image$1 | undefined;
2347
2458
  appId: string;
@@ -2382,6 +2493,29 @@ interface ImageJoinStreamingResponse {
2382
2493
  metadata: ImageMetadata | undefined;
2383
2494
  }
2384
2495
  declare const ImageJoinStreamingResponse: MessageFns$1<ImageJoinStreamingResponse>;
2496
+ interface ImageListTagsItem {
2497
+ tag: string;
2498
+ imageId: string;
2499
+ revisionId: string;
2500
+ createdAt: number;
2501
+ updatedAt: number;
2502
+ }
2503
+ declare const ImageListTagsItem: MessageFns$1<ImageListTagsItem>;
2504
+ interface ImageListTagsRequest {
2505
+ environmentName: string;
2506
+ /** Prefix search over full "name:tag" strings. */
2507
+ tagPrefix: string;
2508
+ /** Defaults to 100. Values above 100 are rejected by the server. */
2509
+ maxObjects: number;
2510
+ pageToken: string;
2511
+ }
2512
+ declare const ImageListTagsRequest: MessageFns$1<ImageListTagsRequest>;
2513
+ interface ImageListTagsResponse {
2514
+ items: ImageListTagsItem[];
2515
+ nextPageToken: string;
2516
+ environmentName: string;
2517
+ }
2518
+ declare const ImageListTagsResponse: MessageFns$1<ImageListTagsResponse>;
2385
2519
  interface ImageMetadata {
2386
2520
  /** The output of `python -VV. Not set if missing */
2387
2521
  pythonVersionInfo?: string | undefined;
@@ -2406,11 +2540,47 @@ interface ImageMetadata {
2406
2540
  imageBuilderVersion?: string | undefined;
2407
2541
  }
2408
2542
  declare const ImageMetadata: MessageFns$1<ImageMetadata>;
2543
+ interface ImagePublishRequest {
2544
+ imageId: string;
2545
+ /** Full "name:tag" string. Must be non-empty. Each ImagePublish RPC writes exactly one tag. */
2546
+ tag: string;
2547
+ environmentName: string;
2548
+ /** Marks the published tag as public. Public read protocol is defined separately. */
2549
+ isPublic: boolean;
2550
+ }
2551
+ declare const ImagePublishRequest: MessageFns$1<ImagePublishRequest>;
2552
+ interface ImagePublishResponse {
2553
+ imageId: string;
2554
+ revisionId: string;
2555
+ }
2556
+ declare const ImagePublishResponse: MessageFns$1<ImagePublishResponse>;
2409
2557
  interface ImageRegistryConfig {
2410
2558
  registryAuthType: RegistryAuthType;
2411
2559
  secretId: string;
2412
2560
  }
2413
2561
  declare const ImageRegistryConfig: MessageFns$1<ImageRegistryConfig>;
2562
+ interface ImageTagRevisionsItem {
2563
+ imageId: string;
2564
+ revisionId: string;
2565
+ createdAt: number;
2566
+ }
2567
+ declare const ImageTagRevisionsItem: MessageFns$1<ImageTagRevisionsItem>;
2568
+ interface ImageTagRevisionsRequest {
2569
+ /** Full "name:tag" string. Must be non-empty. */
2570
+ tag: string;
2571
+ environmentName: string;
2572
+ /** Defaults to 100. Values above 100 are rejected by the server. */
2573
+ maxObjects: number;
2574
+ pageToken: string;
2575
+ }
2576
+ declare const ImageTagRevisionsRequest: MessageFns$1<ImageTagRevisionsRequest>;
2577
+ interface ImageTagRevisionsResponse {
2578
+ items: ImageTagRevisionsItem[];
2579
+ nextPageToken: string;
2580
+ tag: string;
2581
+ environmentName: string;
2582
+ }
2583
+ declare const ImageTagRevisionsResponse: MessageFns$1<ImageTagRevisionsResponse>;
2414
2584
  interface InputCallGraphInfo {
2415
2585
  inputId: string;
2416
2586
  status: GenericResult_GenericStatus;
@@ -2554,6 +2724,7 @@ declare const MultiPartUploadList: MessageFns$1<MultiPartUploadList>;
2554
2724
  interface NetworkAccess {
2555
2725
  networkAccessType: NetworkAccess_NetworkAccessType;
2556
2726
  allowedCidrs: string[];
2727
+ allowedDomains: string[];
2557
2728
  }
2558
2729
  declare const NetworkAccess: MessageFns$1<NetworkAccess>;
2559
2730
  interface NotebookKernelPublishResultsRequest {
@@ -2975,10 +3146,18 @@ interface Sandbox$1 {
2975
3146
  verbose: boolean;
2976
3147
  /** If set, the sandbox will be created with a name. */
2977
3148
  name?: string | undefined;
2978
- /** Experimental options */
3149
+ /**
3150
+ * Deprecated: use experimental_options_v2 instead.
3151
+ *
3152
+ * @deprecated
3153
+ */
2979
3154
  experimentalOptions: {
2980
3155
  [key: string]: boolean;
2981
3156
  };
3157
+ /** Experimental options */
3158
+ experimentalOptionsV2: {
3159
+ [key: string]: string;
3160
+ };
2982
3161
  /** Internal use only. */
2983
3162
  preloadPathPrefixes: string[];
2984
3163
  /** Optional idle timeout in seconds. If set, the sandbox will be terminated after being idle for this duration. */
@@ -3016,6 +3195,8 @@ declare const Sandbox$1: MessageFns$1<Sandbox$1>;
3016
3195
  interface SandboxCreateConnectTokenRequest {
3017
3196
  sandboxId: string;
3018
3197
  userMetadata: string;
3198
+ /** Uses port 8080 if unspecified. */
3199
+ port?: number | undefined;
3019
3200
  }
3020
3201
  declare const SandboxCreateConnectTokenRequest: MessageFns$1<SandboxCreateConnectTokenRequest>;
3021
3202
  interface SandboxCreateConnectTokenResponse {
@@ -3038,6 +3219,7 @@ declare const SandboxCreateResponse: MessageFns$1<SandboxCreateResponse>;
3038
3219
  interface SandboxCreateV2Request {
3039
3220
  appId: string;
3040
3221
  definition: Sandbox$1 | undefined;
3222
+ ephemeralSecrets: StringMap | undefined;
3041
3223
  }
3042
3224
  declare const SandboxCreateV2Request: MessageFns$1<SandboxCreateV2Request>;
3043
3225
  interface SandboxCreateV2Response {
@@ -3156,6 +3338,10 @@ interface SandboxRestoreRequest {
3156
3338
  snapshotId: string;
3157
3339
  sandboxNameOverride: string;
3158
3340
  sandboxNameOverrideType: SandboxRestoreRequest_SandboxNameOverrideType;
3341
+ /** For internal debugging use only. */
3342
+ workerId: string;
3343
+ replaceVolumeMounts: boolean;
3344
+ volumeMounts: VolumeMount[];
3159
3345
  }
3160
3346
  declare const SandboxRestoreRequest: MessageFns$1<SandboxRestoreRequest>;
3161
3347
  interface SandboxRestoreResponse {
@@ -3475,6 +3661,7 @@ declare const SystemErrorMessage: MessageFns$1<SystemErrorMessage>;
3475
3661
  interface TaskClusterHelloRequest {
3476
3662
  taskId: string;
3477
3663
  containerIp: string;
3664
+ imexHostIp: string;
3478
3665
  }
3479
3666
  declare const TaskClusterHelloRequest: MessageFns$1<TaskClusterHelloRequest>;
3480
3667
  interface TaskClusterHelloResponse {
@@ -3483,6 +3670,11 @@ interface TaskClusterHelloResponse {
3483
3670
  /** All IPv6 addresses in cluster, ordered by cluster rank */
3484
3671
  containerIps: string[];
3485
3672
  containerIpv4Ips: string[];
3673
+ /**
3674
+ * Host IPs of every gang member's nvidia-imex daemon, ordered by cluster rank,
3675
+ * and otherwise absent on non-NVL72 systems
3676
+ */
3677
+ imexPeerIps: string[];
3486
3678
  }
3487
3679
  declare const TaskClusterHelloResponse: MessageFns$1<TaskClusterHelloResponse>;
3488
3680
  interface TaskCurrentInputsResponse {
@@ -3606,6 +3798,15 @@ interface TemplateListResponse_TemplateListItem {
3606
3798
  ref: string;
3607
3799
  }
3608
3800
  declare const TemplateListResponse_TemplateListItem: MessageFns$1<TemplateListResponse_TemplateListItem>;
3801
+ interface TokenCreateResponse {
3802
+ tokenId: string;
3803
+ tokenSecret: string;
3804
+ }
3805
+ declare const TokenCreateResponse: MessageFns$1<TokenCreateResponse>;
3806
+ interface TokenDeleteRequest {
3807
+ tokenId: string;
3808
+ }
3809
+ declare const TokenDeleteRequest: MessageFns$1<TokenDeleteRequest>;
3609
3810
  interface TokenFlowCreateRequest {
3610
3811
  utmSource: string;
3611
3812
  localhostPort: number;
@@ -3691,6 +3892,12 @@ interface VolumeCommitRequest {
3691
3892
  * a volume mount.
3692
3893
  */
3693
3894
  volumeId: string;
3895
+ /**
3896
+ * Set by the runtime when committing a volume mounted in a sandbox
3897
+ * sidecar container (used for runtime-driven commit-on-exit).
3898
+ * Unset targets the task's main container.
3899
+ */
3900
+ containerId?: string | undefined;
3694
3901
  }
3695
3902
  declare const VolumeCommitRequest: MessageFns$1<VolumeCommitRequest>;
3696
3903
  interface VolumeCommitResponse {
@@ -3973,6 +4180,42 @@ interface WebhookConfig {
3973
4180
  ephemeralSuffix: string;
3974
4181
  }
3975
4182
  declare const WebhookConfig: MessageFns$1<WebhookConfig>;
4183
+ interface WebhookToken {
4184
+ tokenId: string;
4185
+ createdAt: number;
4186
+ scoped: boolean;
4187
+ }
4188
+ declare const WebhookToken: MessageFns$1<WebhookToken>;
4189
+ interface WebhookTokenCreateRequest {
4190
+ scoped: boolean;
4191
+ }
4192
+ declare const WebhookTokenCreateRequest: MessageFns$1<WebhookTokenCreateRequest>;
4193
+ interface WebhookTokenEnvironmentAddRequest {
4194
+ tokenId: string;
4195
+ environmentId: string;
4196
+ }
4197
+ declare const WebhookTokenEnvironmentAddRequest: MessageFns$1<WebhookTokenEnvironmentAddRequest>;
4198
+ interface WebhookTokenEnvironmentListRequest {
4199
+ tokenId: string;
4200
+ }
4201
+ declare const WebhookTokenEnvironmentListRequest: MessageFns$1<WebhookTokenEnvironmentListRequest>;
4202
+ interface WebhookTokenEnvironmentListResponse {
4203
+ environmentIds: string[];
4204
+ }
4205
+ declare const WebhookTokenEnvironmentListResponse: MessageFns$1<WebhookTokenEnvironmentListResponse>;
4206
+ interface WebhookTokenEnvironmentRemoveRequest {
4207
+ tokenId: string;
4208
+ environmentId: string;
4209
+ }
4210
+ declare const WebhookTokenEnvironmentRemoveRequest: MessageFns$1<WebhookTokenEnvironmentRemoveRequest>;
4211
+ interface WebhookTokenListForEnvironmentRequest {
4212
+ environmentName: string;
4213
+ }
4214
+ declare const WebhookTokenListForEnvironmentRequest: MessageFns$1<WebhookTokenListForEnvironmentRequest>;
4215
+ interface WebhookTokenListResponse {
4216
+ tokens: WebhookToken[];
4217
+ }
4218
+ declare const WebhookTokenListResponse: MessageFns$1<WebhookTokenListResponse>;
3976
4219
  interface WorkspaceBillingReportItem {
3977
4220
  objectId: string;
3978
4221
  description: string;
@@ -3982,6 +4225,13 @@ interface WorkspaceBillingReportItem {
3982
4225
  tags: {
3983
4226
  [key: string]: string;
3984
4227
  };
4228
+ /** old field to be removed */
4229
+ costByResourceFloat: {
4230
+ [key: string]: number;
4231
+ };
4232
+ costByResource: {
4233
+ [key: string]: string;
4234
+ };
3985
4235
  }
3986
4236
  declare const WorkspaceBillingReportItem: MessageFns$1<WorkspaceBillingReportItem>;
3987
4237
  interface WorkspaceBillingReportRequest {
@@ -3991,6 +4241,8 @@ interface WorkspaceBillingReportRequest {
3991
4241
  /** e.g. 'd' or 'h'; server defines what we accept */
3992
4242
  resolution: string;
3993
4243
  tagNames: string[];
4244
+ environmentIds: string[];
4245
+ appIds: string[];
3994
4246
  }
3995
4247
  declare const WorkspaceBillingReportRequest: MessageFns$1<WorkspaceBillingReportRequest>;
3996
4248
  interface WorkspaceDashboardUrlRequest {
@@ -4012,6 +4264,7 @@ interface WorkspaceMembersListItem {
4012
4264
  identityProviderType: IdentityProviderType;
4013
4265
  email: string;
4014
4266
  avatarUrl: string;
4267
+ idpExternalId: string;
4015
4268
  }
4016
4269
  declare const WorkspaceMembersListItem: MessageFns$1<WorkspaceMembersListItem>;
4017
4270
  interface WorkspaceMembersListResponse {
@@ -4170,7 +4423,7 @@ declare const ModalClientDefinition: {
4170
4423
  readonly name: "AppRollback";
4171
4424
  readonly requestType: MessageFns$1<AppRollbackRequest>;
4172
4425
  readonly requestStream: false;
4173
- readonly responseType: MessageFns$2<Empty>;
4426
+ readonly responseType: MessageFns$1<AppRollbackResponse>;
4174
4427
  readonly responseStream: false;
4175
4428
  readonly options: {};
4176
4429
  };
@@ -4397,6 +4650,15 @@ declare const ModalClientDefinition: {
4397
4650
  readonly responseStream: false;
4398
4651
  readonly options: {};
4399
4652
  };
4653
+ /** Curl */
4654
+ readonly curlGetAuthToken: {
4655
+ readonly name: "CurlGetAuthToken";
4656
+ readonly requestType: MessageFns$1<CurlAuthTokenRequest>;
4657
+ readonly requestStream: false;
4658
+ readonly responseType: MessageFns$1<CurlAuthTokenResponse>;
4659
+ readonly responseStream: false;
4660
+ readonly options: {};
4661
+ };
4400
4662
  /** Dicts */
4401
4663
  readonly dictClear: {
4402
4664
  readonly name: "DictClear";
@@ -4528,6 +4790,22 @@ declare const ModalClientDefinition: {
4528
4790
  readonly responseStream: false;
4529
4791
  readonly options: {};
4530
4792
  };
4793
+ readonly endpointGetByName: {
4794
+ readonly name: "EndpointGetByName";
4795
+ readonly requestType: MessageFns$1<EndpointGetByNameRequest>;
4796
+ readonly requestStream: false;
4797
+ readonly responseType: MessageFns$1<EndpointGetByNameResponse>;
4798
+ readonly responseStream: false;
4799
+ readonly options: {};
4800
+ };
4801
+ readonly endpointGetLifecycle: {
4802
+ readonly name: "EndpointGetLifecycle";
4803
+ readonly requestType: MessageFns$1<EndpointGetLifecycleRequest>;
4804
+ readonly requestStream: false;
4805
+ readonly responseType: MessageFns$1<EndpointGetLifecycleResponse>;
4806
+ readonly responseStream: false;
4807
+ readonly options: {};
4808
+ };
4531
4809
  readonly endpointList: {
4532
4810
  readonly name: "EndpointList";
4533
4811
  readonly requestType: MessageFns$1<EndpointListRequest>;
@@ -4561,6 +4839,14 @@ declare const ModalClientDefinition: {
4561
4839
  readonly responseStream: false;
4562
4840
  readonly options: {};
4563
4841
  };
4842
+ readonly environmentGetBudget: {
4843
+ readonly name: "EnvironmentGetBudget";
4844
+ readonly requestType: MessageFns$1<EnvironmentGetBudgetRequest>;
4845
+ readonly requestStream: false;
4846
+ readonly responseType: MessageFns$1<EnvironmentGetBudgetResponse>;
4847
+ readonly responseStream: false;
4848
+ readonly options: {};
4849
+ };
4564
4850
  readonly environmentGetManaged: {
4565
4851
  readonly name: "EnvironmentGetManaged";
4566
4852
  readonly requestType: MessageFns$1<EnvironmentGetManagedRequest>;
@@ -4593,6 +4879,14 @@ declare const ModalClientDefinition: {
4593
4879
  readonly responseStream: false;
4594
4880
  readonly options: {};
4595
4881
  };
4882
+ readonly environmentSetBudget: {
4883
+ readonly name: "EnvironmentSetBudget";
4884
+ readonly requestType: MessageFns$1<EnvironmentSetBudgetRequest>;
4885
+ readonly requestStream: false;
4886
+ readonly responseType: MessageFns$2<Empty>;
4887
+ readonly responseStream: false;
4888
+ readonly options: {};
4889
+ };
4596
4890
  readonly environmentSetManaged: {
4597
4891
  readonly name: "EnvironmentSetManaged";
4598
4892
  readonly requestType: MessageFns$1<EnvironmentSetManagedRequest>;
@@ -4856,6 +5150,14 @@ declare const ModalClientDefinition: {
4856
5150
  readonly responseStream: false;
4857
5151
  readonly options: {};
4858
5152
  };
5153
+ readonly imageGetByTag: {
5154
+ readonly name: "ImageGetByTag";
5155
+ readonly requestType: MessageFns$1<ImageGetByTagRequest>;
5156
+ readonly requestStream: false;
5157
+ readonly responseType: MessageFns$1<ImageGetByTagResponse>;
5158
+ readonly responseStream: false;
5159
+ readonly options: {};
5160
+ };
4859
5161
  readonly imageGetOrCreate: {
4860
5162
  readonly name: "ImageGetOrCreate";
4861
5163
  readonly requestType: MessageFns$1<ImageGetOrCreateRequest>;
@@ -4872,6 +5174,30 @@ declare const ModalClientDefinition: {
4872
5174
  readonly responseStream: true;
4873
5175
  readonly options: {};
4874
5176
  };
5177
+ readonly imageListTags: {
5178
+ readonly name: "ImageListTags";
5179
+ readonly requestType: MessageFns$1<ImageListTagsRequest>;
5180
+ readonly requestStream: false;
5181
+ readonly responseType: MessageFns$1<ImageListTagsResponse>;
5182
+ readonly responseStream: false;
5183
+ readonly options: {};
5184
+ };
5185
+ readonly imagePublish: {
5186
+ readonly name: "ImagePublish";
5187
+ readonly requestType: MessageFns$1<ImagePublishRequest>;
5188
+ readonly requestStream: false;
5189
+ readonly responseType: MessageFns$1<ImagePublishResponse>;
5190
+ readonly responseStream: false;
5191
+ readonly options: {};
5192
+ };
5193
+ readonly imageTagRevisions: {
5194
+ readonly name: "ImageTagRevisions";
5195
+ readonly requestType: MessageFns$1<ImageTagRevisionsRequest>;
5196
+ readonly requestStream: false;
5197
+ readonly responseType: MessageFns$1<ImageTagRevisionsResponse>;
5198
+ readonly responseStream: false;
5199
+ readonly options: {};
5200
+ };
4875
5201
  /** Input Plane Map */
4876
5202
  readonly mapAwait: {
4877
5203
  readonly name: "MapAwait";
@@ -5159,6 +5485,14 @@ declare const ModalClientDefinition: {
5159
5485
  readonly responseStream: false;
5160
5486
  readonly options: {};
5161
5487
  };
5488
+ readonly sandboxListV2: {
5489
+ readonly name: "SandboxListV2";
5490
+ readonly requestType: MessageFns$1<SandboxListRequest>;
5491
+ readonly requestStream: false;
5492
+ readonly responseType: MessageFns$1<SandboxListResponse>;
5493
+ readonly responseStream: false;
5494
+ readonly options: {};
5495
+ };
5162
5496
  readonly sandboxRestore: {
5163
5497
  readonly name: "SandboxRestore";
5164
5498
  readonly requestType: MessageFns$1<SandboxRestoreRequest>;
@@ -5639,6 +5973,63 @@ declare const ModalClientDefinition: {
5639
5973
  readonly responseStream: false;
5640
5974
  readonly options: {};
5641
5975
  };
5976
+ /** Webhook tokens (proxy tokens) */
5977
+ readonly webhookTokenCreate: {
5978
+ readonly name: "WebhookTokenCreate";
5979
+ readonly requestType: MessageFns$1<WebhookTokenCreateRequest>;
5980
+ readonly requestStream: false;
5981
+ readonly responseType: MessageFns$1<TokenCreateResponse>;
5982
+ readonly responseStream: false;
5983
+ readonly options: {};
5984
+ };
5985
+ readonly webhookTokenDelete: {
5986
+ readonly name: "WebhookTokenDelete";
5987
+ readonly requestType: MessageFns$1<TokenDeleteRequest>;
5988
+ readonly requestStream: false;
5989
+ readonly responseType: MessageFns$2<Empty>;
5990
+ readonly responseStream: false;
5991
+ readonly options: {};
5992
+ };
5993
+ readonly webhookTokenEnvironmentAdd: {
5994
+ readonly name: "WebhookTokenEnvironmentAdd";
5995
+ readonly requestType: MessageFns$1<WebhookTokenEnvironmentAddRequest>;
5996
+ readonly requestStream: false;
5997
+ readonly responseType: MessageFns$2<Empty>;
5998
+ readonly responseStream: false;
5999
+ readonly options: {};
6000
+ };
6001
+ readonly webhookTokenEnvironmentList: {
6002
+ readonly name: "WebhookTokenEnvironmentList";
6003
+ readonly requestType: MessageFns$1<WebhookTokenEnvironmentListRequest>;
6004
+ readonly requestStream: false;
6005
+ readonly responseType: MessageFns$1<WebhookTokenEnvironmentListResponse>;
6006
+ readonly responseStream: false;
6007
+ readonly options: {};
6008
+ };
6009
+ readonly webhookTokenEnvironmentRemove: {
6010
+ readonly name: "WebhookTokenEnvironmentRemove";
6011
+ readonly requestType: MessageFns$1<WebhookTokenEnvironmentRemoveRequest>;
6012
+ readonly requestStream: false;
6013
+ readonly responseType: MessageFns$2<Empty>;
6014
+ readonly responseStream: false;
6015
+ readonly options: {};
6016
+ };
6017
+ readonly webhookTokenList: {
6018
+ readonly name: "WebhookTokenList";
6019
+ readonly requestType: MessageFns$2<Empty>;
6020
+ readonly requestStream: false;
6021
+ readonly responseType: MessageFns$1<WebhookTokenListResponse>;
6022
+ readonly responseStream: false;
6023
+ readonly options: {};
6024
+ };
6025
+ readonly webhookTokenListForEnvironment: {
6026
+ readonly name: "WebhookTokenListForEnvironment";
6027
+ readonly requestType: MessageFns$1<WebhookTokenListForEnvironmentRequest>;
6028
+ readonly requestStream: false;
6029
+ readonly responseType: MessageFns$1<WebhookTokenListResponse>;
6030
+ readonly responseStream: false;
6031
+ readonly options: {};
6032
+ };
5642
6033
  /** Workspaces */
5643
6034
  readonly workspaceBillingReport: {
5644
6035
  readonly name: "WorkspaceBillingReport";
@@ -5730,14 +6121,6 @@ declare class Secret {
5730
6121
  readonly name?: string;
5731
6122
  /** @ignore */
5732
6123
  constructor(secretId: string, name?: string);
5733
- /**
5734
- * @deprecated Use {@link SecretService#fromName client.secrets.fromName()} instead.
5735
- */
5736
- static fromName(name: string, params?: SecretFromNameParams): Promise<Secret>;
5737
- /**
5738
- * @deprecated Use {@link SecretService#fromObject client.secrets.fromObject()} instead.
5739
- */
5740
- static fromObject(entries: Record<string, string>, params?: SecretFromObjectParams): Promise<Secret>;
5741
6124
  }
5742
6125
 
5743
6126
  declare class CloudBucketMountService {
@@ -5762,17 +6145,6 @@ declare class CloudBucketMount {
5762
6145
  readonly bucketEndpointUrl?: string;
5763
6146
  readonly keyPrefix?: string;
5764
6147
  readonly oidcAuthRoleArn?: string;
5765
- /**
5766
- * @deprecated Use {@link CloudBucketMountService#create client.cloudBucketMounts.create()} instead.
5767
- */
5768
- constructor(bucketName: string, params?: {
5769
- secret?: Secret;
5770
- readOnly?: boolean;
5771
- requesterPays?: boolean;
5772
- bucketEndpointUrl?: string;
5773
- keyPrefix?: string;
5774
- oidcAuthRoleArn?: string;
5775
- });
5776
6148
  /** @ignore */
5777
6149
  constructor(bucketName: string, secret: Secret | undefined, readOnly: boolean, requesterPays: boolean, bucketEndpointUrl: string | undefined, keyPrefix: string | undefined, oidcAuthRoleArn: string | undefined, bucketType: CloudBucketMount_BucketType);
5778
6150
  /** @ignore */
@@ -5814,126 +6186,52 @@ declare class FunctionCall {
5814
6186
  #private;
5815
6187
  readonly functionCallId: string;
5816
6188
  /** @ignore */
5817
- constructor(client: ModalClient | undefined, functionCallId: string);
5818
- /**
5819
- * @deprecated Use {@link FunctionCallService#fromId client.functionCalls.fromId()} instead.
5820
- */
5821
- static fromId(functionCallId: string): FunctionCall;
6189
+ constructor(client: ModalClient, functionCallId: string);
5822
6190
  /** Get the result of a FunctionCall, optionally waiting with a timeout. */
5823
6191
  get(params?: FunctionCallGetParams): Promise<any>;
5824
6192
  /** Cancel a running FunctionCall. */
5825
6193
  cancel(params?: FunctionCallCancelParams): Promise<void>;
5826
6194
  }
5827
6195
 
5828
- /** Optional parameters for `client.functions.fromName()`. */
5829
- type FunctionFromNameParams = {
6196
+ type HeartbeatFunction = () => Promise<any>;
6197
+ declare class EphemeralHeartbeatManager {
6198
+ private readonly heartbeatFn;
6199
+ private readonly abortController;
6200
+ constructor(heartbeatFn: HeartbeatFunction);
6201
+ private start;
6202
+ stop(): void;
6203
+ }
6204
+
6205
+ /** Optional parameters for {@link VolumeService#fromName client.volumes.fromName()}. */
6206
+ type VolumeFromNameParams = {
5830
6207
  environment?: string;
5831
6208
  createIfMissing?: boolean;
5832
6209
  };
6210
+ /** Optional parameters for {@link VolumeService#ephemeral client.volumes.ephemeral()}. */
6211
+ type VolumeEphemeralParams = {
6212
+ environment?: string;
6213
+ };
6214
+ /** Optional parameters for {@link VolumeService#delete client.volumes.delete()}. */
6215
+ type VolumeDeleteParams = {
6216
+ environment?: string;
6217
+ allowMissing?: boolean;
6218
+ };
5833
6219
  /**
5834
- * Service for managing {@link Function_ Function}s.
6220
+ * Service for managing {@link Volume}s.
5835
6221
  *
5836
6222
  * Normally only ever accessed via the client as:
5837
6223
  * ```typescript
5838
6224
  * const modal = new ModalClient();
5839
- * const function = await modal.functions.fromName("my-app", "my-function");
6225
+ * const volume = await modal.volumes.fromName("my-volume");
5840
6226
  * ```
5841
6227
  */
5842
- declare class FunctionService {
6228
+ declare class VolumeService {
5843
6229
  #private;
5844
6230
  constructor(client: ModalClient);
5845
6231
  /**
5846
- * Reference a {@link Function_ Function} by its name in an App.
6232
+ * Reference a {@link Volume} by its name.
5847
6233
  */
5848
- fromName(appName: string, name: string, params?: FunctionFromNameParams): Promise<Function_>;
5849
- }
5850
- /** Simple data structure storing stats for a running {@link Function_ Function}. */
5851
- interface FunctionStats {
5852
- backlog: number;
5853
- numTotalRunners: number;
5854
- }
5855
- /** Optional parameters for {@link Function_#updateAutoscaler Function_.updateAutoscaler()}. */
5856
- interface FunctionUpdateAutoscalerParams {
5857
- minContainers?: number;
5858
- maxContainers?: number;
5859
- bufferContainers?: number;
5860
- scaledownWindowMs?: number;
5861
- }
5862
- /** Represents a deployed Modal Function, which can be invoked remotely. */
5863
- declare class Function_ {
5864
- #private;
5865
- readonly functionId: string;
5866
- readonly methodName?: string;
5867
- /** @ignore */
5868
- constructor(client: ModalClient, functionId: string, methodName?: string, functionHandleMetadata?: FunctionHandleMetadata);
5869
- /**
5870
- * @deprecated Use `client.functions.fromName()` instead.
5871
- */
5872
- static lookup(appName: string, name: string, params?: FunctionFromNameParams): Promise<Function_>;
5873
- remote(args?: any[], kwargs?: Record<string, any>): Promise<any>;
5874
- spawn(args?: any[], kwargs?: Record<string, any>): Promise<FunctionCall>;
5875
- getCurrentStats(): Promise<FunctionStats>;
5876
- updateAutoscaler(params: FunctionUpdateAutoscalerParams): Promise<void>;
5877
- /**
5878
- * URL for addressing the Web Function via HTTP.
5879
- * @returns The web URL, or undefined if this is not a Web Function
5880
- */
5881
- getWebUrl(): Promise<string | undefined>;
5882
- }
5883
-
5884
- /** Retry policy configuration for a Modal Function/Cls. */
5885
- declare class Retries {
5886
- readonly maxRetries: number;
5887
- readonly backoffCoefficient: number;
5888
- readonly initialDelayMs: number;
5889
- readonly maxDelayMs: number;
5890
- constructor(params: {
5891
- maxRetries: number;
5892
- backoffCoefficient?: number;
5893
- initialDelayMs?: number;
5894
- maxDelayMs?: number;
5895
- });
5896
- }
5897
-
5898
- type HeartbeatFunction = () => Promise<any>;
5899
- declare class EphemeralHeartbeatManager {
5900
- private readonly heartbeatFn;
5901
- private readonly abortController;
5902
- constructor(heartbeatFn: HeartbeatFunction);
5903
- private start;
5904
- stop(): void;
5905
- }
5906
-
5907
- /** Optional parameters for {@link VolumeService#fromName client.volumes.fromName()}. */
5908
- type VolumeFromNameParams = {
5909
- environment?: string;
5910
- createIfMissing?: boolean;
5911
- };
5912
- /** Optional parameters for {@link VolumeService#ephemeral client.volumes.ephemeral()}. */
5913
- type VolumeEphemeralParams = {
5914
- environment?: string;
5915
- };
5916
- /** Optional parameters for {@link VolumeService#delete client.volumes.delete()}. */
5917
- type VolumeDeleteParams = {
5918
- environment?: string;
5919
- allowMissing?: boolean;
5920
- };
5921
- /**
5922
- * Service for managing {@link Volume}s.
5923
- *
5924
- * Normally only ever accessed via the client as:
5925
- * ```typescript
5926
- * const modal = new ModalClient();
5927
- * const volume = await modal.volumes.fromName("my-volume");
5928
- * ```
5929
- */
5930
- declare class VolumeService {
5931
- #private;
5932
- constructor(client: ModalClient);
5933
- /**
5934
- * Reference a {@link Volume} by its name.
5935
- */
5936
- fromName(name: string, params?: VolumeFromNameParams): Promise<Volume>;
6234
+ fromName(name: string, params?: VolumeFromNameParams): Promise<Volume>;
5937
6235
  /**
5938
6236
  * Create a nameless, temporary {@link Volume}.
5939
6237
  * It persists until closeEphemeral() is called, or the process exits.
@@ -5966,30 +6264,11 @@ declare class Volume {
5966
6264
  readonly _mountOptions: ResolvedMountOptions;
5967
6265
  /** @ignore */
5968
6266
  constructor(volumeId: string, name?: string, mountOptions?: ResolvedMountOptions, ephemeralHbManager?: EphemeralHeartbeatManager);
5969
- /**
5970
- * @deprecated Use {@link VolumeService#fromName client.volumes.fromName()} instead.
5971
- */
5972
- static fromName(name: string, options?: VolumeFromNameParams): Promise<Volume>;
5973
- /**
5974
- * Configure Volume to mount as read-only.
5975
- *
5976
- * @deprecated Use {@link withMountOptions} with `{ readOnly: true }` instead.
5977
- */
5978
- readOnly(): Volume;
5979
6267
  /**
5980
6268
  * Configure options used when mounting this Volume. Fields left undefined preserve their value
5981
6269
  * from any previous withMountOptions call on the same Volume (stacking).
5982
6270
  */
5983
6271
  withMountOptions(params?: VolumeMountOptions): Volume;
5984
- /**
5985
- * @deprecated Inspect mount configuration at the call site that configured it instead.
5986
- * Future versions of this SDK may remove direct mount-option accessors on Volume.
5987
- */
5988
- get isReadOnly(): boolean;
5989
- /**
5990
- * @deprecated Use {@link VolumeService#ephemeral client.volumes.ephemeral()} instead.
5991
- */
5992
- static ephemeral(options?: VolumeEphemeralParams): Promise<Volume>;
5993
6272
  /** Delete the ephemeral Volume. Only usable with emphemeral Volumes. */
5994
6273
  closeEphemeral(): void;
5995
6274
  }
@@ -5999,29 +6278,56 @@ type VolumeMountOptions = {
5999
6278
  subPath?: string;
6000
6279
  };
6001
6280
 
6002
- /** Optional parameters for {@link ClsService#fromName client.cls.fromName()}. */
6003
- type ClsFromNameParams = {
6281
+ /** Retry policy configuration for a Modal Function/Cls. */
6282
+ declare class Retries {
6283
+ readonly maxRetries: number;
6284
+ readonly backoffCoefficient: number;
6285
+ readonly initialDelayMs: number;
6286
+ readonly maxDelayMs: number;
6287
+ constructor(params: {
6288
+ maxRetries: number;
6289
+ backoffCoefficient?: number;
6290
+ initialDelayMs?: number;
6291
+ maxDelayMs?: number;
6292
+ });
6293
+ }
6294
+
6295
+ /** Optional parameters for `client.functions.fromName()`. */
6296
+ type FunctionFromNameParams = {
6004
6297
  environment?: string;
6005
6298
  createIfMissing?: boolean;
6006
6299
  };
6007
6300
  /**
6008
- * Service for managing {@link Cls}.
6301
+ * Service for managing {@link Function_ Function}s.
6009
6302
  *
6010
6303
  * Normally only ever accessed via the client as:
6011
6304
  * ```typescript
6012
6305
  * const modal = new ModalClient();
6013
- * const cls = await modal.cls.fromName("my-app", "MyCls");
6306
+ * const function = await modal.functions.fromName("my-app", "my-function");
6014
6307
  * ```
6015
6308
  */
6016
- declare class ClsService {
6309
+ declare class FunctionService {
6017
6310
  #private;
6018
6311
  constructor(client: ModalClient);
6019
6312
  /**
6020
- * Reference a {@link Cls} from a deployed {@link App} by its name.
6313
+ * Reference a {@link Function_ Function} by its name in an App.
6021
6314
  */
6022
- fromName(appName: string, name: string, params?: ClsFromNameParams): Promise<Cls>;
6315
+ fromName(appName: string, name: string, params?: FunctionFromNameParams): Promise<Function_>;
6316
+ }
6317
+ /** Simple data structure storing stats for a running {@link Function_ Function}. */
6318
+ interface FunctionStats {
6319
+ backlog: number;
6320
+ numTotalRunners: number;
6023
6321
  }
6024
- type ClsWithOptionsParams = {
6322
+ /** Optional parameters for {@link Function_#updateAutoscaler Function_.updateAutoscaler()}. */
6323
+ interface FunctionUpdateAutoscalerParams {
6324
+ minContainers?: number;
6325
+ maxContainers?: number;
6326
+ bufferContainers?: number;
6327
+ scaledownWindowMs?: number;
6328
+ }
6329
+ /** Configuration options for {@link Function_#withOptions Function_.withOptions()}. */
6330
+ type FunctionWithOptionsParams = {
6025
6331
  cpu?: number;
6026
6332
  cpuLimit?: number;
6027
6333
  memoryMiB?: number;
@@ -6036,29 +6342,81 @@ type ClsWithOptionsParams = {
6036
6342
  scaledownWindowMs?: number;
6037
6343
  timeoutMs?: number;
6038
6344
  };
6039
- type ClsWithConcurrencyParams = {
6345
+ /** Configuration options for {@link Function_#withConcurrency Function_.withConcurrency()}. */
6346
+ type FunctionWithConcurrencyParams = {
6040
6347
  maxInputs: number;
6041
6348
  targetInputs?: number;
6042
6349
  };
6043
- type ClsWithBatchingParams = {
6350
+ /** Configuration options for {@link Function_#withBatching Function_.withBatching()}. */
6351
+ type FunctionWithBatchingParams = {
6044
6352
  maxBatchSize: number;
6045
6353
  waitMs: number;
6046
6354
  };
6047
- type ServiceOptions = ClsWithOptionsParams & {
6355
+ /** Internal data structure holding configuration options for {@link Function_ Function}. */
6356
+ type FunctionOptions = FunctionWithOptionsParams & {
6048
6357
  maxConcurrentInputs?: number;
6049
6358
  targetConcurrentInputs?: number;
6050
6359
  batchMaxSize?: number;
6051
6360
  batchWaitMs?: number;
6052
6361
  };
6053
- /** Represents a deployed Modal Cls. */
6054
- declare class Cls {
6362
+ /** Represents a deployed Modal Function, which can be invoked remotely. */
6363
+ declare class Function_ {
6055
6364
  #private;
6365
+ readonly functionId: string;
6366
+ readonly methodName?: string;
6056
6367
  /** @ignore */
6057
- constructor(client: ModalClient, serviceFunctionId: string, serviceFunctionMetadata: FunctionHandleMetadata, options?: ServiceOptions);
6368
+ constructor(client: ModalClient, functionId: string, methodName?: string, functionHandleMetadata?: FunctionHandleMetadata, options?: FunctionOptions);
6369
+ /** Override the static Function configuration at runtime. */
6370
+ withOptions(options: FunctionWithOptionsParams): Function_;
6371
+ /** Override the static Function concurrency configuration at runtime. */
6372
+ withConcurrency(params: FunctionWithConcurrencyParams): Function_;
6373
+ /** Override the static Function batching configuration at runtime. */
6374
+ withBatching(params: FunctionWithBatchingParams): Function_;
6375
+ /** Create an instance of the Function with configuration specified by
6376
+ * {@link Function_#withOptions withOptions}, {@link Function_#withConcurrency withConcurrency},
6377
+ * and/or {@link Function_#withBatching withBatching}. */
6378
+ instance(): Promise<Function_>;
6379
+ remote(args?: any[], kwargs?: Record<string, any>): Promise<any>;
6380
+ spawn(args?: any[], kwargs?: Record<string, any>): Promise<FunctionCall>;
6381
+ getCurrentStats(): Promise<FunctionStats>;
6382
+ updateAutoscaler(params: FunctionUpdateAutoscalerParams): Promise<void>;
6383
+ /**
6384
+ * URL for addressing the Web Function via HTTP.
6385
+ * @returns The web URL, or undefined if this is not a Web Function
6386
+ */
6387
+ getWebUrl(): Promise<string | undefined>;
6388
+ }
6389
+
6390
+ /** Optional parameters for {@link ClsService#fromName client.cls.fromName()}. */
6391
+ type ClsFromNameParams = {
6392
+ environment?: string;
6393
+ createIfMissing?: boolean;
6394
+ };
6395
+ /**
6396
+ * Service for managing {@link Cls}.
6397
+ *
6398
+ * Normally only ever accessed via the client as:
6399
+ * ```typescript
6400
+ * const modal = new ModalClient();
6401
+ * const cls = await modal.cls.fromName("my-app", "MyCls");
6402
+ * ```
6403
+ */
6404
+ declare class ClsService {
6405
+ #private;
6406
+ constructor(client: ModalClient);
6058
6407
  /**
6059
- * @deprecated Use {@link ClsService#fromName client.cls.fromName()} instead.
6408
+ * Reference a {@link Cls} from a deployed {@link App} by its name.
6060
6409
  */
6061
- static lookup(appName: string, name: string, params?: ClsFromNameParams): Promise<Cls>;
6410
+ fromName(appName: string, name: string, params?: ClsFromNameParams): Promise<Cls>;
6411
+ }
6412
+ type ClsWithOptionsParams = FunctionWithOptionsParams;
6413
+ type ClsWithConcurrencyParams = FunctionWithConcurrencyParams;
6414
+ type ClsWithBatchingParams = FunctionWithBatchingParams;
6415
+ /** Represents a deployed Modal Cls. */
6416
+ declare class Cls {
6417
+ #private;
6418
+ /** @ignore */
6419
+ constructor(client: ModalClient, serviceFunctionId: string, serviceFunctionMetadata: FunctionHandleMetadata, options?: FunctionOptions);
6062
6420
  /** Create a new instance of the Cls with parameters and/or runtime options. */
6063
6421
  instance(parameters?: Record<string, any>): Promise<ClsInstance>;
6064
6422
  /** Override the static Function configuration at runtime. */
@@ -6075,6 +6433,11 @@ declare class ClsInstance {
6075
6433
  method(name: string): Function_;
6076
6434
  }
6077
6435
 
6436
+ /** Optional parameters for {@link ImageService#fromName client.images.fromName()}. */
6437
+ type ImageFromNameParams = {
6438
+ /** Modal Environment to resolve the named Image in. */
6439
+ environment?: string;
6440
+ };
6078
6441
  /**
6079
6442
  * Service for managing {@link Image}s.
6080
6443
  *
@@ -6093,6 +6456,14 @@ declare class ImageService {
6093
6456
  * @param imageId - Image ID.
6094
6457
  */
6095
6458
  fromId(imageId: string): Promise<Image>;
6459
+ /**
6460
+ * Reference a named {@link Image} that was previously published.
6461
+ *
6462
+ * @param name - Name of the published Image, optionally including a tag as `name:tag`.
6463
+ * If no tag is included, `:latest` is used.
6464
+ * @param params - Optional environment.
6465
+ */
6466
+ fromName(name: string, params?: ImageFromNameParams): Promise<Image>;
6096
6467
  /**
6097
6468
  * Creates an {@link Image} from a raw registry tag, optionally using a {@link Secret} for authentication.
6098
6469
  *
@@ -6128,6 +6499,11 @@ declare class ImageService {
6128
6499
  }
6129
6500
  /** Optional parameters for {@link ImageService#delete client.images.delete()}. */
6130
6501
  type ImageDeleteParams = Record<never, never>;
6502
+ /** Optional parameters for {@link Image#publish Image.publish()}. */
6503
+ type ImagePublishParams = {
6504
+ /** Modal Environment to publish the named Image in. */
6505
+ environment?: string;
6506
+ };
6131
6507
  /** Optional parameters for {@link Image#dockerfileCommands Image.dockerfileCommands()}. */
6132
6508
  type ImageDockerfileCommandsParams = {
6133
6509
  /** Environment variables to set in the build environment. */
@@ -6151,24 +6527,8 @@ type Layer = {
6151
6527
  declare class Image {
6152
6528
  #private;
6153
6529
  /** @ignore */
6154
- constructor(client: ModalClient, imageId: string, tag: string, imageRegistryConfig?: ImageRegistryConfig, layers?: Layer[]);
6530
+ constructor(client: ModalClient, imageId: string, tag: string, imageRegistryConfig?: ImageRegistryConfig, layers?: Layer[], baseImageId?: string);
6155
6531
  get imageId(): string;
6156
- /**
6157
- * @deprecated Use {@link ImageService#fromId client.images.fromId()} instead.
6158
- */
6159
- static fromId(imageId: string): Promise<Image>;
6160
- /**
6161
- * @deprecated Use {@link ImageService#fromRegistry client.images.fromRegistry()} instead.
6162
- */
6163
- static fromRegistry(tag: string, secret?: Secret): Image;
6164
- /**
6165
- * @deprecated Use {@link ImageService#fromAwsEcr client.images.fromAwsEcr()} instead.
6166
- */
6167
- static fromAwsEcr(tag: string, secret: Secret): Image;
6168
- /**
6169
- * @deprecated Use {@link ImageService#fromGcpArtifactRegistry client.images.fromGcpArtifactRegistry()} instead.
6170
- */
6171
- static fromGcpArtifactRegistry(tag: string, secret: Secret): Image;
6172
6532
  private static validateDockerfileCommands;
6173
6533
  /**
6174
6534
  * Extend an image with arbitrary Dockerfile-like commands.
@@ -6188,9 +6548,13 @@ declare class Image {
6188
6548
  */
6189
6549
  build(app: App): Promise<Image>;
6190
6550
  /**
6191
- * @deprecated Use {@link ImageService#delete client.images.delete()} instead.
6551
+ * Publish this built Image under a stable name and tag.
6552
+ *
6553
+ * @param name - Name to publish the Image under, optionally including a tag as `name:tag`.
6554
+ * If no tag is included, `:latest` is used.
6555
+ * @param params - Optional environment.
6192
6556
  */
6193
- static delete(imageId: string, _?: ImageDeleteParams): Promise<void>;
6557
+ publish(name: string, params?: ImagePublishParams): Promise<void>;
6194
6558
  }
6195
6559
 
6196
6560
  /**
@@ -6219,10 +6583,6 @@ declare class Proxy {
6219
6583
  readonly proxyId: string;
6220
6584
  /** @ignore */
6221
6585
  constructor(proxyId: string);
6222
- /**
6223
- * @deprecated Use {@link ProxyService#fromName client.proxies.fromName()} instead.
6224
- */
6225
- static fromName(name: string, params?: ProxyFromNameParams): Promise<Proxy>;
6226
6586
  }
6227
6587
 
6228
6588
  /** Optional parameters for {@link QueueService#fromName client.queues.fromName()}. */
@@ -6317,20 +6677,8 @@ declare class Queue {
6317
6677
  readonly name?: string;
6318
6678
  /** @ignore */
6319
6679
  constructor(client: ModalClient, queueId: string, name?: string, ephemeralHbManager?: EphemeralHeartbeatManager);
6320
- /**
6321
- * @deprecated Use {@link QueueService#ephemeral client.queues.ephemeral()} instead.
6322
- */
6323
- static ephemeral(params?: QueueEphemeralParams): Promise<Queue>;
6324
6680
  /** Delete the ephemeral Queue. Only usable with ephemeral Queues. */
6325
6681
  closeEphemeral(): void;
6326
- /**
6327
- * @deprecated Use {@link QueueService#fromName client.queues.fromName()} instead.
6328
- */
6329
- static lookup(name: string, options?: QueueFromNameParams): Promise<Queue>;
6330
- /**
6331
- * @deprecated Use {@link QueueService#delete client.queues.delete()} instead.
6332
- */
6333
- static delete(name: string, options?: QueueDeleteParams): Promise<void>;
6334
6682
  /**
6335
6683
  * Remove all objects from a Queue partition.
6336
6684
  */
@@ -6392,6 +6740,76 @@ declare enum TaskExecStdoutConfig {
6392
6740
  TASK_EXEC_STDOUT_CONFIG_PIPE = 1,
6393
6741
  UNRECOGNIZED = -1
6394
6742
  }
6743
+ interface SandboxWaitUntilReadyTcrResponse {
6744
+ readyAt: number;
6745
+ }
6746
+ declare const SandboxWaitUntilReadyTcrResponse: MessageFns<SandboxWaitUntilReadyTcrResponse>;
6747
+ interface TaskContainerCreateRequest {
6748
+ taskId: string;
6749
+ /** Logical container name. */
6750
+ containerName: string;
6751
+ imageId: string;
6752
+ args: string[];
6753
+ env: {
6754
+ [key: string]: string;
6755
+ };
6756
+ workdir: string;
6757
+ /** Secret IDs to inject into the container as environment variables. */
6758
+ secretIds: string[];
6759
+ /** Volumes to mount into the container. */
6760
+ volumeMounts: VolumeMount[];
6761
+ }
6762
+ declare const TaskContainerCreateRequest: MessageFns<TaskContainerCreateRequest>;
6763
+ interface TaskContainerCreateResponse {
6764
+ /** Fully qualified container ID (for example, ctr-<ulid>). */
6765
+ containerId: string;
6766
+ /** Logical container name associated with this container. */
6767
+ containerName: string;
6768
+ }
6769
+ declare const TaskContainerCreateResponse: MessageFns<TaskContainerCreateResponse>;
6770
+ interface TaskContainerGetRequest {
6771
+ taskId: string;
6772
+ containerName: string;
6773
+ /** Include the latest terminated container if the name is no longer active. */
6774
+ includeTerminated: boolean;
6775
+ }
6776
+ declare const TaskContainerGetRequest: MessageFns<TaskContainerGetRequest>;
6777
+ interface TaskContainerGetResponse {
6778
+ container: TaskContainerInfo | undefined;
6779
+ }
6780
+ declare const TaskContainerGetResponse: MessageFns<TaskContainerGetResponse>;
6781
+ interface TaskContainerInfo {
6782
+ containerId: string;
6783
+ containerName: string;
6784
+ status: string;
6785
+ result: GenericResult | undefined;
6786
+ }
6787
+ declare const TaskContainerInfo: MessageFns<TaskContainerInfo>;
6788
+ interface TaskContainerListRequest {
6789
+ taskId: string;
6790
+ /** Include all tracked terminated containers in addition to active ones. */
6791
+ includeTerminated: boolean;
6792
+ }
6793
+ declare const TaskContainerListRequest: MessageFns<TaskContainerListRequest>;
6794
+ interface TaskContainerListResponse {
6795
+ containers: TaskContainerInfo[];
6796
+ }
6797
+ declare const TaskContainerListResponse: MessageFns<TaskContainerListResponse>;
6798
+ interface TaskContainerTerminateRequest {
6799
+ taskId: string;
6800
+ containerId: string;
6801
+ }
6802
+ declare const TaskContainerTerminateRequest: MessageFns<TaskContainerTerminateRequest>;
6803
+ interface TaskContainerWaitRequest {
6804
+ taskId: string;
6805
+ containerId: string;
6806
+ timeout: number;
6807
+ }
6808
+ declare const TaskContainerWaitRequest: MessageFns<TaskContainerWaitRequest>;
6809
+ interface TaskContainerWaitResponse {
6810
+ result: GenericResult | undefined;
6811
+ }
6812
+ declare const TaskContainerWaitResponse: MessageFns<TaskContainerWaitResponse>;
6395
6813
  /**
6396
6814
  * The response to a TaskExecPollRequest. If the exec'd command has not
6397
6815
  * completed, exit_status will be unset.
@@ -6464,6 +6882,11 @@ interface TaskMountDirectoryRequest {
6464
6882
  taskId: string;
6465
6883
  path: Uint8Array;
6466
6884
  imageId: string;
6885
+ /**
6886
+ * Customer-supplied encryption key used to decrypt CSEK-encrypted image metadata keys.
6887
+ * This key is not persisted by Modal.
6888
+ */
6889
+ customerSuppliedEncryptionKey?: Uint8Array | undefined;
6467
6890
  }
6468
6891
  declare const TaskMountDirectoryRequest: MessageFns<TaskMountDirectoryRequest>;
6469
6892
  interface TaskSnapshotDirectoryRequest {
@@ -6485,6 +6908,11 @@ interface TaskSnapshotDirectoryRequest {
6485
6908
  * server.
6486
6909
  */
6487
6910
  ttlSeconds?: number | undefined;
6911
+ /**
6912
+ * Customer-supplied encryption key used to encrypt the resulting image's data and tree
6913
+ * metadata keys. This key is not persisted by Modal.
6914
+ */
6915
+ customerSuppliedEncryptionKey?: Uint8Array | undefined;
6488
6916
  }
6489
6917
  declare const TaskSnapshotDirectoryRequest: MessageFns<TaskSnapshotDirectoryRequest>;
6490
6918
  interface TaskSnapshotDirectoryResponse {
@@ -6505,6 +6933,11 @@ interface TaskSnapshotFilesystemRequest {
6505
6933
  * server.
6506
6934
  */
6507
6935
  ttlSeconds?: number | undefined;
6936
+ /**
6937
+ * Customer-supplied encryption key used to encrypt the resulting image's data and tree
6938
+ * metadata keys. This key is not persisted by Modal.
6939
+ */
6940
+ customerSuppliedEncryptionKey?: Uint8Array | undefined;
6508
6941
  }
6509
6942
  declare const TaskSnapshotFilesystemRequest: MessageFns<TaskSnapshotFilesystemRequest>;
6510
6943
  interface TaskSnapshotFilesystemResponse {
@@ -6566,50 +6999,28 @@ declare class TaskCommandRouterClientImpl {
6566
6999
  static tryInit(serverClient: ModalGrpcClient, taskId: string, sandboxId: string, isV2: boolean, logger: Logger, profile: Profile): Promise<TaskCommandRouterClientImpl | null>;
6567
7000
  private constructor();
6568
7001
  close(): void;
7002
+ /** Run a unary RPC against the command router with the default retry policy. */
7003
+ private callUnary;
6569
7004
  execStart(request: TaskExecStartRequest): Promise<TaskExecStartResponse>;
7005
+ containerCreate(request: TaskContainerCreateRequest): Promise<TaskContainerCreateResponse>;
7006
+ containerGet(request: TaskContainerGetRequest): Promise<TaskContainerGetResponse>;
7007
+ containerList(request: TaskContainerListRequest): Promise<TaskContainerListResponse>;
7008
+ containerTerminate(request: TaskContainerTerminateRequest): Promise<void>;
7009
+ containerWait(request: TaskContainerWaitRequest): Promise<TaskContainerWaitResponse>;
6570
7010
  execStdioRead(taskId: string, execId: string, fileDescriptor: FileDescriptor, deadline?: number | null): AsyncGenerator<TaskExecStdioReadResponse>;
6571
7011
  execStdinWrite(taskId: string, execId: string, offset: number, data: Uint8Array, eof: boolean): Promise<TaskExecStdinWriteResponse>;
6572
7012
  execPoll(taskId: string, execId: string, deadline?: number | null): Promise<TaskExecPollResponse>;
6573
7013
  execWait(taskId: string, execId: string, deadline?: number | null): Promise<TaskExecWaitResponse>;
6574
7014
  mountDirectory(request: TaskMountDirectoryRequest): Promise<void>;
6575
- snapshotDirectory(request: TaskSnapshotDirectoryRequest): Promise<TaskSnapshotDirectoryResponse>;
7015
+ snapshotDirectory(request: TaskSnapshotDirectoryRequest, options?: TimeoutOptions): Promise<TaskSnapshotDirectoryResponse>;
6576
7016
  snapshotFilesystem(request: TaskSnapshotFilesystemRequest, options?: TimeoutOptions): Promise<TaskSnapshotFilesystemResponse>;
6577
7017
  unmountDirectory(request: TaskUnmountDirectoryRequest): Promise<void>;
7018
+ sandboxWaitUntilReady(taskId: string, timeoutMs: number): Promise<SandboxWaitUntilReadyTcrResponse>;
6578
7019
  private refreshJwt;
6579
7020
  private callWithAuthRetry;
6580
7021
  private streamStdio;
6581
7022
  }
6582
7023
 
6583
- /** File open modes supported by the filesystem API. */
6584
- type SandboxFileMode = "r" | "w" | "a" | "r+" | "w+" | "a+";
6585
- /**
6586
- * SandboxFile represents an open file in the {@link Sandbox} filesystem.
6587
- * Provides read/write operations similar to Node.js `fsPromises.FileHandle`.
6588
- */
6589
- declare class SandboxFile {
6590
- #private;
6591
- /** @ignore */
6592
- constructor(client: ModalClient, fileDescriptor: string, taskId: string);
6593
- /**
6594
- * Read data from the file.
6595
- * @returns Promise that resolves to the read data as Uint8Array
6596
- */
6597
- read(): Promise<Uint8Array>;
6598
- /**
6599
- * Write data to the file.
6600
- * @param data - Data to write
6601
- */
6602
- write(data: Uint8Array): Promise<void>;
6603
- /**
6604
- * Flush any buffered data to the file.
6605
- */
6606
- flush(): Promise<void>;
6607
- /**
6608
- * Close the file handle.
6609
- */
6610
- close(): Promise<void>;
6611
- }
6612
-
6613
7024
  /** Type of a filesystem entry. */
6614
7025
  type FileType = "file" | "directory" | "symlink";
6615
7026
  /** Metadata for a file or directory entry in a Sandbox. */
@@ -6628,9 +7039,9 @@ interface FileInfo {
6628
7039
  }
6629
7040
  /** Namespace for Sandbox filesystem APIs. */
6630
7041
  declare class SandboxFilesystem {
6631
- private readonly sandbox;
7042
+ private readonly exec;
6632
7043
  /** @ignore */
6633
- constructor(sandbox: Sandbox);
7044
+ constructor(exec: (command: string[], params?: SandboxExecParams) => Promise<ContainerProcess>);
6634
7045
  /**
6635
7046
  * Copy a local file into the Sandbox.
6636
7047
  *
@@ -6777,6 +7188,94 @@ declare class SandboxFilesystem {
6777
7188
  writeText(data: string, remotePath: string): Promise<void>;
6778
7189
  }
6779
7190
 
7191
+ type SandboxSidecarCommandRouter = Pick<TaskCommandRouterClientImpl, "containerCreate" | "containerGet" | "containerList" | "containerTerminate" | "containerWait">;
7192
+ type SandboxSidecarAccess = {
7193
+ exec(command: string[], params: SandboxExecParams | undefined, containerId: string): Promise<ContainerProcess>;
7194
+ commandRouter(): Promise<[string, SandboxSidecarCommandRouter]>;
7195
+ };
7196
+ /** Options for {@link SidecarService#create SidecarService.create()}. */
7197
+ type SidecarCreateParams = {
7198
+ /** Command to run in the sidecar container on startup. */
7199
+ command?: string[];
7200
+ /** Environment variables to set in the sidecar container. */
7201
+ env?: Record<string, string>;
7202
+ /** {@link Secret}s to inject into the sidecar container as environment variables. */
7203
+ secrets?: Secret[];
7204
+ /** Working directory of the sidecar container. */
7205
+ workdir?: string;
7206
+ };
7207
+ /** Options for {@link SidecarService#get SidecarService.get()}. */
7208
+ type SidecarGetParams = {
7209
+ /** If true, return the latest container with the name even if it has terminated. */
7210
+ includeTerminated?: boolean;
7211
+ };
7212
+ /** Options for {@link SidecarService#list SidecarService.list()}. */
7213
+ type SidecarListParams = {
7214
+ /** If true, include terminated containers. */
7215
+ includeTerminated?: boolean;
7216
+ };
7217
+ /** Options for {@link SidecarContainer#exec SidecarContainer.exec()}. */
7218
+ type SidecarExecParams = SandboxExecParams;
7219
+ /** Options for {@link SidecarContainer#terminate SidecarContainer.terminate()}. */
7220
+ type SidecarTerminateParams = {
7221
+ /** If true, wait for the sidecar container to terminate. */
7222
+ wait?: boolean;
7223
+ };
7224
+ /**
7225
+ * Creates and manages sidecar containers inside a Sandbox.
7226
+ *
7227
+ * EXPERIMENTAL: the API is subject to change.
7228
+ */
7229
+ declare class SidecarService {
7230
+ #private;
7231
+ /** @internal @hidden */
7232
+ constructor(access: SandboxSidecarAccess);
7233
+ /**
7234
+ * Start a new sidecar container in the Sandbox. The {@link Image} must
7235
+ * already be built by calling {@link Image#build Image.build()} before it is
7236
+ * passed to `create`.
7237
+ */
7238
+ create(name: string, image: Image, params?: SidecarCreateParams): Promise<SidecarContainer>;
7239
+ /** Return a sidecar container by name. */
7240
+ get(name: string, params?: SidecarGetParams): Promise<SidecarContainer>;
7241
+ /** Return all sidecar containers (not including the main container). */
7242
+ list(params?: SidecarListParams): Promise<SidecarContainer[]>;
7243
+ }
7244
+ /**
7245
+ * A handle to a sidecar container running in a Sandbox.
7246
+ *
7247
+ * EXPERIMENTAL: the API is subject to change.
7248
+ */
7249
+ declare class SidecarContainer {
7250
+ #private;
7251
+ /** The fully qualified container ID. */
7252
+ readonly containerId: string;
7253
+ /** The logical name of the container within the Sandbox. */
7254
+ readonly containerName: string;
7255
+ /** @internal @hidden */
7256
+ constructor(access: SandboxSidecarAccess, containerId: string, containerName: string, result?: GenericResult);
7257
+ exec(command: string[], params?: SidecarExecParams & {
7258
+ mode?: "text";
7259
+ }): Promise<ContainerProcess<string>>;
7260
+ exec(command: string[], params: SidecarExecParams & {
7261
+ mode: "binary";
7262
+ }): Promise<ContainerProcess<Uint8Array>>;
7263
+ /** Namespace for filesystem APIs scoped to this sidecar container. */
7264
+ get filesystem(): SandboxFilesystem;
7265
+ /** Block until the sidecar container exits, and return its exit code. */
7266
+ wait(): Promise<number>;
7267
+ /**
7268
+ * Check if the sidecar container has finished running.
7269
+ *
7270
+ * Returns `null` if the container is still running, else the exit code.
7271
+ */
7272
+ poll(): Promise<number | null>;
7273
+ terminate(): Promise<void>;
7274
+ terminate(params: {
7275
+ wait: true;
7276
+ }): Promise<number>;
7277
+ }
7278
+
6780
7279
  /**
6781
7280
  * Wrapper around `ReadableStream` with convenience functions.
6782
7281
  *
@@ -6884,12 +7383,14 @@ type SandboxCreateParams = {
6884
7383
  blockNetwork?: boolean;
6885
7384
  /** List of CIDRs the Sandbox is allowed to access. If not set, all CIDRs are allowed. Cannot be used with blockNetwork. */
6886
7385
  outboundCidrAllowlist?: string[];
6887
- /**
6888
- * @deprecated Use {@link outboundCidrAllowlist} instead.
6889
- */
6890
- cidrAllowlist?: string[];
7386
+ /** List of domain names the Sandbox is allowed to access. Supports wildcard prefixes (`*.example.com`). Cannot be used with blockNetwork. */
7387
+ outboundDomainAllowlist?: string[];
6891
7388
  /** 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. */
6892
7389
  inboundCidrAllowlist?: string[];
7390
+ /** Enable private IPv6 networking (i6pn) so Sandboxes in the same workspace can address each
7391
+ * other directly at their `i6pn.modal.local` address. Pin every Sandbox in the group to the same specific region
7392
+ * (e.g. `regions: ["us-east-1"]`). Cannot be used with blockNetwork. */
7393
+ i6pn?: boolean;
6893
7394
  /** Cloud provider to run the Sandbox on. */
6894
7395
  cloud?: string;
6895
7396
  /** Region(s) to run the Sandbox on. */
@@ -6902,7 +7403,7 @@ type SandboxCreateParams = {
6902
7403
  readinessProbe?: Probe;
6903
7404
  /** Optional name for the Sandbox. Unique within an App. */
6904
7405
  name?: string;
6905
- /** Tags to attach to the Sandbox. Filterable via {@link SandboxService#list Sandbox.list}. */
7406
+ /** Tags to attach to the Sandbox. Filterable via {@link SandboxService#list client.sandboxes.list}. */
6906
7407
  tags?: Record<string, string>;
6907
7408
  /** Optional experimental options. */
6908
7409
  experimentalOptions?: Record<string, any>;
@@ -6933,11 +7434,12 @@ declare class SandboxService {
6933
7434
  * Create a new {@link Sandbox} using the experimental V2 backend.
6934
7435
  *
6935
7436
  * Supported features include exec, encrypted tunnels, wait/poll/terminate,
6936
- * CPU and memory configuration, and region placement.
7437
+ * CPU and memory configuration, region placement, volumes, cloud bucket
7438
+ * mounts (with static credentials via {@link Secret} or `oidcAuthRoleArn`),
7439
+ * OIDC identity tokens, {@link Proxy proxies}, and filesystem snapshots.
6937
7440
  *
6938
- * Features like tags, filesystem snapshots, memory snapshots, volumes, cloud
6939
- * bucket mounts, GPUs, custom domains, OIDC identity tokens, proxies, and
6940
- * readiness probes are not supported.
7441
+ * Features like tags, memory snapshots, GPUs, and custom domains are not
7442
+ * supported.
6941
7443
  *
6942
7444
  * V2 sandboxes created with this method are not currently returned by
6943
7445
  * {@link SandboxService#list client.sandboxes.list()} and cannot be looked up
@@ -7002,14 +7504,61 @@ type SandboxExecParams = {
7002
7504
  * process) is multiplexed into stdout, and the stderr stream is effectively empty. */
7003
7505
  pty?: boolean;
7004
7506
  };
7005
- /** Optional parameters for {@link Sandbox#createConnectToken Sandbox.createConnectToken()}. */
7507
+ /** Optional parameters for {@link Sandbox#terminate Sandbox.terminate()}. */
7006
7508
  type SandboxTerminateParams = {
7007
7509
  /** If true, wait for the Sandbox to finish and return the exit code. */
7008
7510
  wait?: boolean;
7009
7511
  };
7512
+ /** Optional parameters for {@link Sandbox#snapshotFilesystem Sandbox.snapshotFilesystem()}. */
7513
+ type SandboxSnapshotFilesystemParams = {
7514
+ /**
7515
+ * Overall budget for the snapshot call, in milliseconds. Defaults to
7516
+ * 55000. If it elapses before a snapshot completes, the call is cancelled
7517
+ * and an error is thrown.
7518
+ */
7519
+ timeoutMs?: number;
7520
+ /**
7521
+ * Lifetime of the resulting image in milliseconds, as a hard cutoff
7522
+ * measured from creation. Defaults to 30 days. Pass `null` to retain
7523
+ * the image indefinitely.
7524
+ */
7525
+ ttlMs?: number | null;
7526
+ };
7527
+ /** Optional parameters for {@link Sandbox#snapshotDirectory Sandbox.snapshotDirectory()}. */
7528
+ type SandboxSnapshotDirectoryParams = {
7529
+ /**
7530
+ * Overall budget for the snapshot call, in milliseconds. Defaults to
7531
+ * 55000. If it elapses before a snapshot completes, the call is cancelled
7532
+ * and an error is thrown.
7533
+ */
7534
+ timeoutMs?: number;
7535
+ /**
7536
+ * Lifetime of the resulting image in milliseconds, as a hard cutoff
7537
+ * measured from creation. Defaults to 30 days. Pass `null` to retain
7538
+ * the image indefinitely.
7539
+ */
7540
+ ttlMs?: number | null;
7541
+ /**
7542
+ * Experimental customer-supplied encryption key used to encrypt the
7543
+ * resulting snapshot. The same key is required when mounting the image.
7544
+ * Modal does not persist the key.
7545
+ */
7546
+ experimentalEncryptionKey?: Uint8Array;
7547
+ };
7548
+ /** Optional parameters for {@link Sandbox#mountImage Sandbox.mountImage()}. */
7549
+ type SandboxMountImageParams = {
7550
+ /**
7551
+ * Experimental customer-supplied encryption key used to decrypt the image.
7552
+ * Use the same key that encrypted the snapshot.
7553
+ */
7554
+ experimentalEncryptionKey?: Uint8Array;
7555
+ };
7556
+ /** Optional parameters for {@link Sandbox#createConnectToken Sandbox.createConnectToken()}. */
7010
7557
  type SandboxCreateConnectTokenParams = {
7011
7558
  /** Optional user-provided metadata string that will be added to the headers by the proxy when forwarding requests to the Sandbox. */
7012
7559
  userMetadata?: string;
7560
+ /** Container port that requests are routed to when using this token. Defaults to 8080. */
7561
+ port?: number;
7013
7562
  };
7014
7563
  /** Credentials returned by {@link Sandbox#createConnectToken Sandbox.createConnectToken()}. */
7015
7564
  type SandboxCreateConnectCredentials = {
@@ -7045,29 +7594,17 @@ declare class Sandbox {
7045
7594
  get stdout(): ModalReadStream<string>;
7046
7595
  get stderr(): ModalReadStream<string>;
7047
7596
  get filesystem(): SandboxFilesystem;
7048
- /** Set tags (key-value pairs) on the Sandbox. Tags can be used to filter results in {@link SandboxService#list Sandbox.list}. */
7049
- setTags(tags: Record<string, string>): Promise<void>;
7050
- /** Get tags (key-value pairs) currently attached to this Sandbox from the server. */
7051
- getTags(): Promise<Record<string, string>>;
7052
- /**
7053
- * @deprecated Use {@link SandboxService#fromId client.sandboxes.fromId()} instead.
7054
- */
7055
- static fromId(sandboxId: string): Promise<Sandbox>;
7056
7597
  /**
7057
- * @deprecated Use {@link SandboxService#fromName client.sandboxes.fromName()} instead.
7058
- */
7059
- static fromName(appName: string, name: string, environment?: string): Promise<Sandbox>;
7060
- /**
7061
- * Open a file in the Sandbox filesystem.
7062
- *
7063
- * @deprecated Use {@link SandboxFilesystem} methods: `sandbox.filesystem.readBytes()`,
7064
- * `writeBytes()`, or `copyToLocal()` instead for improved reliability.
7598
+ * Operations for managing sidecar containers that run alongside the
7599
+ * Sandbox's main container.
7065
7600
  *
7066
- * @param path - Path to the file to open
7067
- * @param mode - File open mode (r, w, a, r+, w+, a+)
7068
- * @returns Promise that resolves to a {@link SandboxFile}
7601
+ * EXPERIMENTAL: the API is subject to change.
7069
7602
  */
7070
- open(path: string, mode?: SandboxFileMode): Promise<SandboxFile>;
7603
+ get experimentalSidecars(): SidecarService;
7604
+ /** Set tags (key-value pairs) on the Sandbox. Tags can be used to filter results in {@link SandboxService#list client.sandboxes.list}. */
7605
+ setTags(tags: Record<string, string>): Promise<void>;
7606
+ /** Get tags (key-value pairs) currently attached to this Sandbox from the server. */
7607
+ getTags(): Promise<Record<string, string>>;
7071
7608
  exec(command: string[], params?: SandboxExecParams & {
7072
7609
  mode?: "text";
7073
7610
  }): Promise<ContainerProcess<string>>;
@@ -7111,21 +7648,22 @@ declare class Sandbox {
7111
7648
  *
7112
7649
  * Returns an {@link Image} object which can be used to spawn a new Sandbox with the same filesystem.
7113
7650
  *
7114
- * `timeoutMs` is propagated as the gRPC deadline. If the snapshot does
7115
- * not return within that window, the call is cancelled and an error is
7116
- * thrown.
7651
+ * The call has an overall `timeoutMs` budget (default: 55000). If it
7652
+ * elapses before a snapshot completes, the call is cancelled and an
7653
+ * error is thrown.
7117
7654
  *
7118
- * @param timeoutMs - Timeout for the snapshot operation in milliseconds.
7655
+ * @param params - Optional parameters; see {@link SandboxSnapshotFilesystemParams}.
7119
7656
  * @returns Promise that resolves to an {@link Image}
7120
7657
  */
7121
- snapshotFilesystem(timeoutMs?: number): Promise<Image>;
7658
+ snapshotFilesystem(params?: SandboxSnapshotFilesystemParams): Promise<Image>;
7122
7659
  /**
7123
7660
  * Mount an {@link Image} at a path in the Sandbox filesystem.
7124
7661
  *
7125
7662
  * @param path - The path where the directory should be mounted
7126
7663
  * @param image - Optional {@link Image} to mount. If undefined, mounts an empty directory.
7664
+ * @param params - Optional parameters; see {@link SandboxMountImageParams}.
7127
7665
  */
7128
- mountImage(path: string, image?: Image): Promise<void>;
7666
+ mountImage(path: string, image?: Image, params?: SandboxMountImageParams): Promise<void>;
7129
7667
  /**
7130
7668
  * Unmounts an {@link Image} previously mounted at a path in the Sandbox filesystem.
7131
7669
  *
@@ -7135,23 +7673,25 @@ declare class Sandbox {
7135
7673
  /**
7136
7674
  * Snapshots and creates a new {@link Image} from a directory in the running sandbox.
7137
7675
  *
7138
- * Directory snapshots are currently persisted for 30 days after they
7139
- * were created.
7676
+ * The resulting Image is retained for `ttlMs` (default: 30 days),
7677
+ * as a hard cutoff measured from creation — usage does not extend
7678
+ * the lifetime. Pass `ttlMs: null` to retain indefinitely.
7679
+ *
7680
+ * The call has an overall `timeoutMs` budget (default: 55000). If it
7681
+ * elapses before a snapshot completes, the call is cancelled and an
7682
+ * error is thrown.
7140
7683
  *
7141
7684
  * @param path - The path of the directory to snapshot
7685
+ * @param params - Optional parameters; see {@link SandboxSnapshotDirectoryParams}.
7142
7686
  * @returns Promise that resolves to an {@link Image}
7143
7687
  */
7144
- snapshotDirectory(path: string): Promise<Image>;
7688
+ snapshotDirectory(path: string, params?: SandboxSnapshotDirectoryParams): Promise<Image>;
7145
7689
  /**
7146
7690
  * Check if the Sandbox has finished running.
7147
7691
  *
7148
7692
  * Returns `null` if the Sandbox is still running, else returns the exit code.
7149
7693
  */
7150
7694
  poll(): Promise<number | null>;
7151
- /**
7152
- * @deprecated Use {@link SandboxService#list client.sandboxes.list()} instead.
7153
- */
7154
- static list(params?: SandboxListParams): AsyncGenerator<Sandbox, void, unknown>;
7155
7695
  }
7156
7696
  declare class ContainerProcess<R extends string | Uint8Array = any> {
7157
7697
  #private;
@@ -7232,9 +7772,18 @@ declare class ModalClient {
7232
7772
  private ipClients;
7233
7773
  private authTokenManager;
7234
7774
  private customMiddleware;
7775
+ private environmentManager;
7235
7776
  constructor(params?: ModalClientParams);
7236
7777
  environmentName(environment?: string): string;
7237
- imageBuilderVersion(version?: string): string;
7778
+ /**
7779
+ * Returns the image builder version by querying the server where the local profile takes
7780
+ * precedence.
7781
+ *
7782
+ * The image builder version is an environment-scoped server setting, so pass the environment
7783
+ * the image will be built in (e.g. an App's environment) to fetch the correct version. When
7784
+ * omitted, the profile's default environment is used.
7785
+ */
7786
+ getImageBuilderVersion(environmentName?: string): Promise<string>;
7238
7787
  /** @ignore */
7239
7788
  ipClient(serverUrl: string): ModalGrpcClient;
7240
7789
  close(): void;
@@ -7260,23 +7809,6 @@ type RetryOptions = {
7260
7809
  /** Additional status codes to retry. */
7261
7810
  additionalStatusCodes?: Status[];
7262
7811
  };
7263
- /**
7264
- * @deprecated Use {@link ModalClient `new ModalClient()`} instead.
7265
- */
7266
- type ClientOptions = {
7267
- tokenId: string;
7268
- tokenSecret: string;
7269
- environment?: string;
7270
- };
7271
- /**
7272
- * @deprecated Use {@link ModalClient `new ModalClient()`} instead.
7273
- */
7274
- declare function initializeClient(options: ClientOptions): void;
7275
- /**
7276
- * Stops the auth token refresh.
7277
- * @deprecated Use {@link ModalClient#close modalClient.close()} instead.
7278
- */
7279
- declare function close(): void;
7280
7812
 
7281
7813
  /**
7282
7814
  * Service for managing {@link App}s.
@@ -7300,45 +7832,13 @@ type AppFromNameParams = {
7300
7832
  environment?: string;
7301
7833
  createIfMissing?: boolean;
7302
7834
  };
7303
- /** @deprecated Use specific Params types instead. */
7304
- type LookupOptions = {
7305
- environment?: string;
7306
- createIfMissing?: boolean;
7307
- };
7308
- /** @deprecated Use specific Params types instead. */
7309
- type DeleteOptions = {
7310
- environment?: string;
7311
- };
7312
- /** @deprecated Use specific Params types instead. */
7313
- type EphemeralOptions = {
7314
- environment?: string;
7315
- };
7316
7835
  /** Represents a deployed Modal App. */
7317
7836
  declare class App {
7318
7837
  readonly appId: string;
7319
7838
  readonly name?: string;
7839
+ readonly environmentName?: string;
7320
7840
  /** @ignore */
7321
- constructor(appId: string, name?: string);
7322
- /**
7323
- * @deprecated Use {@link AppService#fromName client.apps.fromName()} instead.
7324
- */
7325
- static lookup(name: string, options?: LookupOptions): Promise<App>;
7326
- /**
7327
- * @deprecated Use {@link SandboxService#create client.sandboxes.create()} instead.
7328
- */
7329
- createSandbox(image: Image, options?: SandboxCreateParams): Promise<Sandbox>;
7330
- /**
7331
- * @deprecated Use {@link ImageService#fromRegistry client.images.fromRegistry()} instead.
7332
- */
7333
- imageFromRegistry(tag: string, secret?: Secret): Promise<Image>;
7334
- /**
7335
- * @deprecated Use {@link ImageService#fromAwsEcr client.images.fromAwsEcr()} instead.
7336
- */
7337
- imageFromAwsEcr(tag: string, secret: Secret): Promise<Image>;
7338
- /**
7339
- * @deprecated Use {@link ImageService#fromGcpArtifactRegistry client.images.fromGcpArtifactRegistry()} instead.
7340
- */
7341
- imageFromGcpArtifactRegistry(tag: string, secret: Secret): Promise<Image>;
7841
+ constructor(appId: string, name?: string, environmentName?: string);
7342
7842
  }
7343
7843
 
7344
7844
  /** An operation exceeds the allowed time limit. */
@@ -7420,4 +7920,4 @@ declare class ClientClosedError extends Error {
7420
7920
 
7421
7921
  declare function checkForRenamedParams(params: any, renames: Record<string, string>): void;
7422
7922
 
7423
- 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, type FileInfo, type FileType, 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, SandboxFilesystem, SandboxFilesystemDirectoryNotEmptyError, SandboxFilesystemError, SandboxFilesystemFileTooLargeError, SandboxFilesystemIsADirectoryError, SandboxFilesystemNotADirectoryError, SandboxFilesystemNotFoundError, SandboxFilesystemPathAlreadyExistsError, SandboxFilesystemPermissionError, 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, type VolumeMountOptions, VolumeService, checkForRenamedParams, close, initializeClient };
7923
+ export { AlreadyExistsError, App, type AppFromNameParams, AppService, ClientClosedError, CloudBucketMount, CloudBucketMountService, Cls, type ClsFromNameParams, ClsInstance, ClsService, type ClsWithBatchingParams, type ClsWithConcurrencyParams, type ClsWithOptionsParams, ContainerProcess, type FileInfo, type FileType, FunctionCall, type FunctionCallCancelParams, type FunctionCallGetParams, FunctionCallService, type FunctionFromNameParams, FunctionService, type FunctionStats, FunctionTimeoutError, type FunctionUpdateAutoscalerParams, type FunctionWithBatchingParams, type FunctionWithConcurrencyParams, type FunctionWithOptionsParams, Function_, Image, type ImageDeleteParams, type ImageDockerfileCommandsParams, type ImageFromNameParams, type ImagePublishParams, ImageService, InternalFailure, InvalidError, type LogLevel, type Logger, 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, SandboxFilesystem, SandboxFilesystemDirectoryNotEmptyError, SandboxFilesystemError, SandboxFilesystemFileTooLargeError, SandboxFilesystemIsADirectoryError, SandboxFilesystemNotADirectoryError, SandboxFilesystemNotFoundError, SandboxFilesystemPathAlreadyExistsError, SandboxFilesystemPermissionError, type SandboxFromNameParams, type SandboxListParams, type SandboxMountImageParams, SandboxService, type SandboxSnapshotDirectoryParams, type SandboxSnapshotFilesystemParams, type SandboxTerminateParams, SandboxTimeoutError, Secret, type SecretDeleteParams, type SecretFromNameParams, type SecretFromObjectParams, SecretService, SidecarContainer, type SidecarCreateParams, type SidecarExecParams, type SidecarGetParams, type SidecarListParams, SidecarService, type SidecarTerminateParams, type StdioBehavior, type StreamMode, TimeoutError, Tunnel, Volume, type VolumeDeleteParams, type VolumeEphemeralParams, type VolumeFromNameParams, type VolumeMountOptions, VolumeService, checkForRenamedParams };