modal 0.8.1 → 0.9.0

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
@@ -168,6 +168,16 @@ declare enum EnvironmentRole {
168
168
  ENVIRONMENT_ROLE_CONTRIBUTOR = 2,
169
169
  UNRECOGNIZED = -1
170
170
  }
171
+ /**
172
+ * Creation-time environment classification. Captures whether an environment
173
+ * is public. is_managed and machine_generated may be folded in as future
174
+ * values.
175
+ */
176
+ declare enum EnvironmentType {
177
+ ENVIRONMENT_TYPE_UNSPECIFIED = 0,
178
+ ENVIRONMENT_TYPE_PUBLIC = 1,
179
+ UNRECOGNIZED = -1
180
+ }
171
181
  declare enum ExecOutputOption {
172
182
  EXEC_OUTPUT_OPTION_UNSPECIFIED = 0,
173
183
  EXEC_OUTPUT_OPTION_DEVNULL = 1,
@@ -1197,8 +1207,17 @@ declare const ContainerReloadVolumesRequest: MessageFns$1<ContainerReloadVolumes
1197
1207
  interface ContainerReloadVolumesResponse {
1198
1208
  }
1199
1209
  declare const ContainerReloadVolumesResponse: MessageFns$1<ContainerReloadVolumesResponse>;
1210
+ /**
1211
+ * Sent by server containers once lifecycle enter methods have completed.
1212
+ * Only handled on worker by server_io_manager.
1213
+ */
1214
+ interface ContainerServerLifecycleReadyRequest {
1215
+ }
1216
+ declare const ContainerServerLifecycleReadyRequest: MessageFns$1<ContainerServerLifecycleReadyRequest>;
1200
1217
  interface ContainerStopRequest {
1201
1218
  taskId: string;
1219
+ /** Let a Function container finish processing any inputs before exiting. */
1220
+ graceful: boolean;
1202
1221
  }
1203
1222
  declare const ContainerStopRequest: MessageFns$1<ContainerStopRequest>;
1204
1223
  interface ContainerStopResponse {
@@ -1510,10 +1529,31 @@ declare const EndpointStopRequest: MessageFns$1<EndpointStopRequest>;
1510
1529
  interface EndpointStopResponse {
1511
1530
  }
1512
1531
  declare const EndpointStopResponse: MessageFns$1<EndpointStopResponse>;
1532
+ interface EnvironmentBillingSummaryRequest {
1533
+ startTimestamp: Date | undefined;
1534
+ endTimestamp: Date | undefined;
1535
+ environmentId: string;
1536
+ }
1537
+ declare const EnvironmentBillingSummaryRequest: MessageFns$1<EnvironmentBillingSummaryRequest>;
1538
+ interface EnvironmentBillingSummaryResponse {
1539
+ startTimestamp: Date | undefined;
1540
+ endTimestamp: Date | undefined;
1541
+ /**
1542
+ * not showing credits, reservations, etc as those are applied
1543
+ * at the workspace level
1544
+ */
1545
+ meteredCost: string;
1546
+ /** keyed by deployed, ephemeral, volume, notebook */
1547
+ meteredCostBreakdown: {
1548
+ [key: string]: string;
1549
+ };
1550
+ }
1551
+ declare const EnvironmentBillingSummaryResponse: MessageFns$1<EnvironmentBillingSummaryResponse>;
1513
1552
  interface EnvironmentCreateRequest {
1514
1553
  name: string;
1515
1554
  isManaged: boolean;
1516
1555
  settings: EnvironmentSettings | undefined;
1556
+ environmentType: EnvironmentType;
1517
1557
  }
1518
1558
  declare const EnvironmentCreateRequest: MessageFns$1<EnvironmentCreateRequest>;
1519
1559
  interface EnvironmentDeleteRequest {
@@ -1580,6 +1620,7 @@ interface EnvironmentListItem {
1580
1620
  effectiveCycleSpendLimit: number;
1581
1621
  currentCycleUsage: number;
1582
1622
  spendLimitReached: boolean;
1623
+ environmentType: EnvironmentType;
1583
1624
  }
1584
1625
  declare const EnvironmentListItem: MessageFns$1<EnvironmentListItem>;
1585
1626
  interface EnvironmentListResponse {
@@ -1589,6 +1630,7 @@ declare const EnvironmentListResponse: MessageFns$1<EnvironmentListResponse>;
1589
1630
  interface EnvironmentMetadata {
1590
1631
  name: string;
1591
1632
  settings: EnvironmentSettings | undefined;
1633
+ environmentType: EnvironmentType;
1592
1634
  }
1593
1635
  declare const EnvironmentMetadata: MessageFns$1<EnvironmentMetadata>;
1594
1636
  interface EnvironmentRoleSetRequest {
@@ -1875,6 +1917,7 @@ declare const FunctionCallFromIdRequest: MessageFns$1<FunctionCallFromIdRequest>
1875
1917
  interface FunctionCallFromIdResponse {
1876
1918
  functionCallId: string;
1877
1919
  numInputs: number;
1920
+ metadata: FunctionCallHandleMetadata | undefined;
1878
1921
  }
1879
1922
  declare const FunctionCallFromIdResponse: MessageFns$1<FunctionCallFromIdResponse>;
1880
1923
  interface FunctionCallGetDataRequest {
@@ -1883,6 +1926,11 @@ interface FunctionCallGetDataRequest {
1883
1926
  lastIndex: number;
1884
1927
  }
1885
1928
  declare const FunctionCallGetDataRequest: MessageFns$1<FunctionCallGetDataRequest>;
1929
+ interface FunctionCallHandleMetadata {
1930
+ appId: string;
1931
+ functionId: string;
1932
+ }
1933
+ declare const FunctionCallHandleMetadata: MessageFns$1<FunctionCallHandleMetadata>;
1886
1934
  interface FunctionCallInfo {
1887
1935
  functionCallId: string;
1888
1936
  idx: number;
@@ -2178,6 +2226,7 @@ interface FunctionHandleMetadata {
2178
2226
  ExperimentalFlashUrls: string[];
2179
2227
  supportedInputFormats: DataFormat[];
2180
2228
  supportedOutputFormats: DataFormat[];
2229
+ appId: string;
2181
2230
  }
2182
2231
  declare const FunctionHandleMetadata: MessageFns$1<FunctionHandleMetadata>;
2183
2232
  interface FunctionInput {
@@ -2233,6 +2282,7 @@ interface FunctionOptions$1 {
2233
2282
  replaceCloudBucketMounts: boolean;
2234
2283
  cloudBucketMounts: CloudBucketMount$1[];
2235
2284
  pinnedAppVersion?: number | undefined;
2285
+ routingRegion?: string | undefined;
2236
2286
  }
2237
2287
  declare const FunctionOptions$1: MessageFns$1<FunctionOptions$1>;
2238
2288
  interface FunctionPrecreateRequest {
@@ -2542,11 +2592,11 @@ interface ImageMetadata {
2542
2592
  declare const ImageMetadata: MessageFns$1<ImageMetadata>;
2543
2593
  interface ImagePublishRequest {
2544
2594
  imageId: string;
2545
- /** Full "name:tag" string. Must be non-empty. Each ImagePublish RPC writes exactly one tag. */
2595
+ /** Full "name:tag" string. Must be non-empty. */
2546
2596
  tag: string;
2547
2597
  environmentName: string;
2548
- /** Marks the published tag as public. Public read protocol is defined separately. */
2549
- isPublic: boolean;
2598
+ /** Explicit opt-in required when publishing to a public environment. */
2599
+ allowPublic: boolean;
2550
2600
  }
2551
2601
  declare const ImagePublishRequest: MessageFns$1<ImagePublishRequest>;
2552
2602
  interface ImagePublishResponse {
@@ -2563,6 +2613,7 @@ interface ImageTagRevisionsItem {
2563
2613
  imageId: string;
2564
2614
  revisionId: string;
2565
2615
  createdAt: number;
2616
+ publishedBy: string;
2566
2617
  }
2567
2618
  declare const ImageTagRevisionsItem: MessageFns$1<ImageTagRevisionsItem>;
2568
2619
  interface ImageTagRevisionsRequest {
@@ -2671,6 +2722,14 @@ interface MethodDefinition {
2671
2722
  supportedOutputFormats: DataFormat[];
2672
2723
  }
2673
2724
  declare const MethodDefinition: MessageFns$1<MethodDefinition>;
2725
+ interface MountBatchedCheckExistenceRequest {
2726
+ sha256HexHashes: string[];
2727
+ }
2728
+ declare const MountBatchedCheckExistenceRequest: MessageFns$1<MountBatchedCheckExistenceRequest>;
2729
+ interface MountBatchedCheckExistenceResponse {
2730
+ missingSha256HexHashes: string[];
2731
+ }
2732
+ declare const MountBatchedCheckExistenceResponse: MessageFns$1<MountBatchedCheckExistenceResponse>;
2674
2733
  interface MountFile {
2675
2734
  filename: string;
2676
2735
  /** SHA-256 checksum of the file. */
@@ -3220,6 +3279,7 @@ interface SandboxCreateV2Request {
3220
3279
  appId: string;
3221
3280
  definition: Sandbox$1 | undefined;
3222
3281
  ephemeralSecrets: StringMap | undefined;
3282
+ tags: SandboxTag[];
3223
3283
  }
3224
3284
  declare const SandboxCreateV2Request: MessageFns$1<SandboxCreateV2Request>;
3225
3285
  interface SandboxCreateV2Response {
@@ -3233,7 +3293,8 @@ declare const SandboxCreateV2Response: MessageFns$1<SandboxCreateV2Response>;
3233
3293
  * For all other use cases, use TaskGetCommandRouterAccess instead.
3234
3294
  */
3235
3295
  interface SandboxGetCommandRouterAccessRequest {
3236
- sandboxId: string;
3296
+ sandboxId?: string | undefined;
3297
+ taskId?: string | undefined;
3237
3298
  }
3238
3299
  declare const SandboxGetCommandRouterAccessRequest: MessageFns$1<SandboxGetCommandRouterAccessRequest>;
3239
3300
  interface SandboxGetCommandRouterAccessResponse {
@@ -3662,6 +3723,7 @@ interface TaskClusterHelloRequest {
3662
3723
  taskId: string;
3663
3724
  containerIp: string;
3664
3725
  imexHostIp: string;
3726
+ imexFabricId: string;
3665
3727
  }
3666
3728
  declare const TaskClusterHelloRequest: MessageFns$1<TaskClusterHelloRequest>;
3667
3729
  interface TaskClusterHelloResponse {
@@ -3671,7 +3733,7 @@ interface TaskClusterHelloResponse {
3671
3733
  containerIps: string[];
3672
3734
  containerIpv4Ips: string[];
3673
3735
  /**
3674
- * Host IPs of every gang member's nvidia-imex daemon, ordered by cluster rank,
3736
+ * All nvidia-imex IPs in fabric, ordered by cluster rank,
3675
3737
  * and otherwise absent on non-NVL72 systems
3676
3738
  */
3677
3739
  imexPeerIps: string[];
@@ -3706,6 +3768,7 @@ interface TaskGetInfoResponse {
3706
3768
  declare const TaskGetInfoResponse: MessageFns$1<TaskGetInfoResponse>;
3707
3769
  interface TaskInfo {
3708
3770
  id: string;
3771
+ /** For Function containers, this corresponds to the "ready" time, after startup phase */
3709
3772
  startedAt: number;
3710
3773
  finishedAt: number;
3711
3774
  result: GenericResult | undefined;
@@ -3918,6 +3981,12 @@ interface VolumeCopyFilesRequest {
3918
3981
  recursive: boolean;
3919
3982
  }
3920
3983
  declare const VolumeCopyFilesRequest: MessageFns$1<VolumeCopyFilesRequest>;
3984
+ interface VolumeCreateOptions {
3985
+ experimentalOptions: {
3986
+ [key: string]: string;
3987
+ };
3988
+ }
3989
+ declare const VolumeCreateOptions: MessageFns$1<VolumeCreateOptions>;
3921
3990
  interface VolumeDeleteRequest {
3922
3991
  volumeId: string;
3923
3992
  /** @deprecated */
@@ -3977,6 +4046,7 @@ interface VolumeGetOrCreateRequest {
3977
4046
  /** only used with OBJECT_CREATION_TYPE_ANONYMOUS_OWNED_BY_APP */
3978
4047
  appId: string;
3979
4048
  version: VolumeFsVersion;
4049
+ createOptions?: VolumeCreateOptions | undefined;
3980
4050
  }
3981
4051
  declare const VolumeGetOrCreateRequest: MessageFns$1<VolumeGetOrCreateRequest>;
3982
4052
  interface VolumeGetOrCreateResponse {
@@ -4225,10 +4295,6 @@ interface WorkspaceBillingReportItem {
4225
4295
  tags: {
4226
4296
  [key: string]: string;
4227
4297
  };
4228
- /** old field to be removed */
4229
- costByResourceFloat: {
4230
- [key: string]: number;
4231
- };
4232
4298
  costByResource: {
4233
4299
  [key: string]: string;
4234
4300
  };
@@ -4245,6 +4311,26 @@ interface WorkspaceBillingReportRequest {
4245
4311
  appIds: string[];
4246
4312
  }
4247
4313
  declare const WorkspaceBillingReportRequest: MessageFns$1<WorkspaceBillingReportRequest>;
4314
+ interface WorkspaceBillingSummaryRequest {
4315
+ startTimestamp: Date | undefined;
4316
+ endTimestamp: Date | undefined;
4317
+ }
4318
+ declare const WorkspaceBillingSummaryRequest: MessageFns$1<WorkspaceBillingSummaryRequest>;
4319
+ interface WorkspaceBillingSummaryResponse {
4320
+ startTimestamp: Date | undefined;
4321
+ endTimestamp: Date | undefined;
4322
+ meteredCost: string;
4323
+ planCost: string;
4324
+ creditsApplied: string;
4325
+ reservationsDiscount: string;
4326
+ volumesDiscount: string;
4327
+ billedCost: string;
4328
+ /** keyed by deployed, ephemeral, volume, notebook */
4329
+ meteredCostBreakdown: {
4330
+ [key: string]: string;
4331
+ };
4332
+ }
4333
+ declare const WorkspaceBillingSummaryResponse: MessageFns$1<WorkspaceBillingSummaryResponse>;
4248
4334
  interface WorkspaceDashboardUrlRequest {
4249
4335
  environmentName: string;
4250
4336
  }
@@ -4277,6 +4363,23 @@ interface WorkspaceNameLookupResponse {
4277
4363
  username: string;
4278
4364
  }
4279
4365
  declare const WorkspaceNameLookupResponse: MessageFns$1<WorkspaceNameLookupResponse>;
4366
+ interface WorkspaceSetDefaultEnvironmentRequest {
4367
+ environmentName: string;
4368
+ }
4369
+ declare const WorkspaceSetDefaultEnvironmentRequest: MessageFns$1<WorkspaceSetDefaultEnvironmentRequest>;
4370
+ interface WorkspaceSetImageBuilderVersionRequest {
4371
+ newImageBuilderVersion: string;
4372
+ }
4373
+ declare const WorkspaceSetImageBuilderVersionRequest: MessageFns$1<WorkspaceSetImageBuilderVersionRequest>;
4374
+ interface WorkspaceSetImageBuilderVersionResponse {
4375
+ imageBuilderVersion: string;
4376
+ }
4377
+ declare const WorkspaceSetImageBuilderVersionResponse: MessageFns$1<WorkspaceSetImageBuilderVersionResponse>;
4378
+ interface WorkspaceSettingsResponse {
4379
+ defaultEnvironmentName: string;
4380
+ imageBuilderVersion: string;
4381
+ }
4382
+ declare const WorkspaceSettingsResponse: MessageFns$1<WorkspaceSettingsResponse>;
4280
4383
  type ModalClientDefinition = typeof ModalClientDefinition;
4281
4384
  declare const ModalClientDefinition: {
4282
4385
  readonly name: "ModalClient";
@@ -4642,6 +4745,14 @@ declare const ModalClientDefinition: {
4642
4745
  readonly responseStream: false;
4643
4746
  readonly options: {};
4644
4747
  };
4748
+ readonly containerServerLifecycleReady: {
4749
+ readonly name: "ContainerServerLifecycleReady";
4750
+ readonly requestType: MessageFns$1<ContainerServerLifecycleReadyRequest>;
4751
+ readonly requestStream: false;
4752
+ readonly responseType: MessageFns$2<Empty>;
4753
+ readonly responseStream: false;
4754
+ readonly options: {};
4755
+ };
4645
4756
  readonly containerStop: {
4646
4757
  readonly name: "ContainerStop";
4647
4758
  readonly requestType: MessageFns$1<ContainerStopRequest>;
@@ -4823,6 +4934,14 @@ declare const ModalClientDefinition: {
4823
4934
  readonly options: {};
4824
4935
  };
4825
4936
  /** Environments */
4937
+ readonly environmentBillingSummary: {
4938
+ readonly name: "EnvironmentBillingSummary";
4939
+ readonly requestType: MessageFns$1<EnvironmentBillingSummaryRequest>;
4940
+ readonly requestStream: false;
4941
+ readonly responseType: MessageFns$1<EnvironmentBillingSummaryResponse>;
4942
+ readonly responseStream: false;
4943
+ readonly options: {};
4944
+ };
4826
4945
  readonly environmentCreate: {
4827
4946
  readonly name: "EnvironmentCreate";
4828
4947
  readonly requestType: MessageFns$1<EnvironmentCreateRequest>;
@@ -5224,6 +5343,14 @@ declare const ModalClientDefinition: {
5224
5343
  readonly options: {};
5225
5344
  };
5226
5345
  /** Mounts */
5346
+ readonly mountBatchedCheckExistence: {
5347
+ readonly name: "MountBatchedCheckExistence";
5348
+ readonly requestType: MessageFns$1<MountBatchedCheckExistenceRequest>;
5349
+ readonly requestStream: false;
5350
+ readonly responseType: MessageFns$1<MountBatchedCheckExistenceResponse>;
5351
+ readonly responseStream: false;
5352
+ readonly options: {};
5353
+ };
5227
5354
  readonly mountGetOrCreate: {
5228
5355
  readonly name: "MountGetOrCreate";
5229
5356
  readonly requestType: MessageFns$1<MountGetOrCreateRequest>;
@@ -5428,6 +5555,14 @@ declare const ModalClientDefinition: {
5428
5555
  readonly responseStream: false;
5429
5556
  readonly options: {};
5430
5557
  };
5558
+ readonly sandboxGetFromNameV2: {
5559
+ readonly name: "SandboxGetFromNameV2";
5560
+ readonly requestType: MessageFns$1<SandboxGetFromNameRequest>;
5561
+ readonly requestStream: false;
5562
+ readonly responseType: MessageFns$1<SandboxGetFromNameResponse>;
5563
+ readonly responseStream: false;
5564
+ readonly options: {};
5565
+ };
5431
5566
  readonly sandboxGetLogs: {
5432
5567
  readonly name: "SandboxGetLogs";
5433
5568
  readonly requestType: MessageFns$1<SandboxGetLogsRequest>;
@@ -5565,6 +5700,14 @@ declare const ModalClientDefinition: {
5565
5700
  readonly responseStream: false;
5566
5701
  readonly options: {};
5567
5702
  };
5703
+ readonly sandboxTagsGetV2: {
5704
+ readonly name: "SandboxTagsGetV2";
5705
+ readonly requestType: MessageFns$1<SandboxTagsGetRequest>;
5706
+ readonly requestStream: false;
5707
+ readonly responseType: MessageFns$1<SandboxTagsGetResponse>;
5708
+ readonly responseStream: false;
5709
+ readonly options: {};
5710
+ };
5568
5711
  readonly sandboxTagsSet: {
5569
5712
  readonly name: "SandboxTagsSet";
5570
5713
  readonly requestType: MessageFns$1<SandboxTagsSetRequest>;
@@ -5573,6 +5716,14 @@ declare const ModalClientDefinition: {
5573
5716
  readonly responseStream: false;
5574
5717
  readonly options: {};
5575
5718
  };
5719
+ readonly sandboxTagsSetV2: {
5720
+ readonly name: "SandboxTagsSetV2";
5721
+ readonly requestType: MessageFns$1<SandboxTagsSetRequest>;
5722
+ readonly requestStream: false;
5723
+ readonly responseType: MessageFns$2<Empty>;
5724
+ readonly responseStream: false;
5725
+ readonly options: {};
5726
+ };
5576
5727
  readonly sandboxTerminate: {
5577
5728
  readonly name: "SandboxTerminate";
5578
5729
  readonly requestType: MessageFns$1<SandboxTerminateRequest>;
@@ -6039,6 +6190,14 @@ declare const ModalClientDefinition: {
6039
6190
  readonly responseStream: true;
6040
6191
  readonly options: {};
6041
6192
  };
6193
+ readonly workspaceBillingSummary: {
6194
+ readonly name: "WorkspaceBillingSummary";
6195
+ readonly requestType: MessageFns$1<WorkspaceBillingSummaryRequest>;
6196
+ readonly requestStream: false;
6197
+ readonly responseType: MessageFns$1<WorkspaceBillingSummaryResponse>;
6198
+ readonly responseStream: false;
6199
+ readonly options: {};
6200
+ };
6042
6201
  readonly workspaceDashboardUrlGet: {
6043
6202
  readonly name: "WorkspaceDashboardUrlGet";
6044
6203
  readonly requestType: MessageFns$1<WorkspaceDashboardUrlRequest>;
@@ -6063,6 +6222,30 @@ declare const ModalClientDefinition: {
6063
6222
  readonly responseStream: false;
6064
6223
  readonly options: {};
6065
6224
  };
6225
+ readonly workspaceSetDefaultEnvironment: {
6226
+ readonly name: "WorkspaceSetDefaultEnvironment";
6227
+ readonly requestType: MessageFns$1<WorkspaceSetDefaultEnvironmentRequest>;
6228
+ readonly requestStream: false;
6229
+ readonly responseType: MessageFns$2<Empty>;
6230
+ readonly responseStream: false;
6231
+ readonly options: {};
6232
+ };
6233
+ readonly workspaceSetImageBuilderVersion: {
6234
+ readonly name: "WorkspaceSetImageBuilderVersion";
6235
+ readonly requestType: MessageFns$1<WorkspaceSetImageBuilderVersionRequest>;
6236
+ readonly requestStream: false;
6237
+ readonly responseType: MessageFns$1<WorkspaceSetImageBuilderVersionResponse>;
6238
+ readonly responseStream: false;
6239
+ readonly options: {};
6240
+ };
6241
+ readonly workspaceSettings: {
6242
+ readonly name: "WorkspaceSettings";
6243
+ readonly requestType: MessageFns$2<Empty>;
6244
+ readonly requestStream: false;
6245
+ readonly responseType: MessageFns$1<WorkspaceSettingsResponse>;
6246
+ readonly responseStream: false;
6247
+ readonly options: {};
6248
+ };
6066
6249
  };
6067
6250
  };
6068
6251
  type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | undefined;
@@ -6106,7 +6289,16 @@ declare class SecretService {
6106
6289
  constructor(client: ModalClient);
6107
6290
  /** Reference a {@link Secret} by its name. */
6108
6291
  fromName(name: string, params?: SecretFromNameParams): Promise<Secret>;
6109
- /** Create a {@link Secret} from a plain object of key-value pairs. */
6292
+ /**
6293
+ * Create a {@link Secret} from a plain object of key-value pairs.
6294
+ *
6295
+ * The returned Secret is lazy: no server-side Secret is created (and
6296
+ * {@link Secret#secretId secretId} stays empty) until it is first used. When
6297
+ * used with {@link Sandbox#exec Sandbox.exec()} or
6298
+ * {@link SandboxService#experimentalCreate client.sandboxes.experimentalCreate()},
6299
+ * the values are sent directly to the worker as environment variables,
6300
+ * avoiding a `SecretGetOrCreate` round-trip entirely.
6301
+ */
6110
6302
  fromObject(entries: Record<string, string>, params?: SecretFromObjectParams): Promise<Secret>;
6111
6303
  /**
6112
6304
  * Delete a named {@link Secret}.
@@ -6115,12 +6307,42 @@ declare class SecretService {
6115
6307
  */
6116
6308
  delete(name: string, params?: SecretDeleteParams): Promise<void>;
6117
6309
  }
6310
+ /**
6311
+ * Resolves a lazy {@link Secret} to a server-side secretId. Each construction
6312
+ * path (fromName, fromObject, ...) supplies its own implementation carrying
6313
+ * whatever inputs that path needs.
6314
+ *
6315
+ * @internal
6316
+ * @hidden
6317
+ */
6318
+ interface SecretHydrator {
6319
+ hydrate(client: ModalClient): Promise<string>;
6320
+ }
6118
6321
  /** Secrets provide a dictionary of environment variables for {@link Image}s. */
6119
6322
  declare class Secret {
6120
- readonly secretId: string;
6323
+ #private;
6121
6324
  readonly name?: string;
6122
6325
  /** @ignore */
6123
- constructor(secretId: string, name?: string);
6326
+ constructor(secretId: string, name?: string, hydrator?: SecretHydrator);
6327
+ /** The ID of the server-side Secret, or an empty string if not yet hydrated. */
6328
+ get secretId(): string;
6329
+ /**
6330
+ * The hydrator resolving a lazy Secret to a secretId, or `undefined` for
6331
+ * Secrets that already reference a server-side Secret (e.g. from fromName).
6332
+ *
6333
+ * @internal
6334
+ * @hidden
6335
+ */
6336
+ get _hydrator(): SecretHydrator | undefined;
6337
+ /**
6338
+ * Lazily create the ephemeral server-side Secret backing a fromObject Secret
6339
+ * and populate {@link Secret#secretId secretId}. A no-op once secretId is set
6340
+ * (e.g. for Secrets returned by fromName).
6341
+ *
6342
+ * @internal
6343
+ * @hidden
6344
+ */
6345
+ _hydrate(client: ModalClient): Promise<void>;
6124
6346
  }
6125
6347
 
6126
6348
  declare class CloudBucketMountService {
@@ -6268,12 +6490,12 @@ declare class Volume {
6268
6490
  * Configure options used when mounting this Volume. Fields left undefined preserve their value
6269
6491
  * from any previous withMountOptions call on the same Volume (stacking).
6270
6492
  */
6271
- withMountOptions(params?: VolumeMountOptions): Volume;
6493
+ withMountOptions(params?: VolumeMountOptionsParams): Volume;
6272
6494
  /** Delete the ephemeral Volume. Only usable with emphemeral Volumes. */
6273
6495
  closeEphemeral(): void;
6274
6496
  }
6275
6497
  /** Options for mounting a {@link Volume}. */
6276
- type VolumeMountOptions = {
6498
+ type VolumeMountOptionsParams = {
6277
6499
  readOnly?: boolean;
6278
6500
  subPath?: string;
6279
6501
  };
@@ -6295,7 +6517,8 @@ declare class Retries {
6295
6517
  /** Optional parameters for `client.functions.fromName()`. */
6296
6518
  type FunctionFromNameParams = {
6297
6519
  environment?: string;
6298
- createIfMissing?: boolean;
6520
+ /** Look up a version-pinned Function deployed at this App version. */
6521
+ version?: number;
6299
6522
  };
6300
6523
  /**
6301
6524
  * Service for managing {@link Function_ Function}s.
@@ -6341,6 +6564,7 @@ type FunctionWithOptionsParams = {
6341
6564
  bufferContainers?: number;
6342
6565
  scaledownWindowMs?: number;
6343
6566
  timeoutMs?: number;
6567
+ routingRegion?: string;
6344
6568
  };
6345
6569
  /** Configuration options for {@link Function_#withConcurrency Function_.withConcurrency()}. */
6346
6570
  type FunctionWithConcurrencyParams = {
@@ -6390,7 +6614,8 @@ declare class Function_ {
6390
6614
  /** Optional parameters for {@link ClsService#fromName client.cls.fromName()}. */
6391
6615
  type ClsFromNameParams = {
6392
6616
  environment?: string;
6393
- createIfMissing?: boolean;
6617
+ /** Look up a version-pinned Cls deployed at this App version. */
6618
+ version?: number;
6394
6619
  };
6395
6620
  /**
6396
6621
  * Service for managing {@link Cls}.
@@ -6438,6 +6663,13 @@ type ImageFromNameParams = {
6438
6663
  /** Modal Environment to resolve the named Image in. */
6439
6664
  environment?: string;
6440
6665
  };
6666
+ /**
6667
+ * A closure that hydrates the registry-auth {@link Secret} (if any) and builds
6668
+ * the {@link ImageRegistryConfig} for the base build layer. It runs at build
6669
+ * time rather than when the Image is constructed, since the Secret may be lazy
6670
+ * (created via {@link SecretService#fromObject}).
6671
+ */
6672
+ type BuildRegistryConfig = (client: ModalClient) => Promise<ImageRegistryConfig>;
6441
6673
  /**
6442
6674
  * Service for managing {@link Image}s.
6443
6675
  *
@@ -6527,7 +6759,7 @@ type Layer = {
6527
6759
  declare class Image {
6528
6760
  #private;
6529
6761
  /** @ignore */
6530
- constructor(client: ModalClient, imageId: string, tag: string, imageRegistryConfig?: ImageRegistryConfig, layers?: Layer[], baseImageId?: string);
6762
+ constructor(client: ModalClient, imageId: string, tag: string, buildRegistryConfig?: BuildRegistryConfig, layers?: Layer[], baseImageId?: string);
6531
6763
  get imageId(): string;
6532
6764
  private static validateDockerfileCommands;
6533
6765
  /**
@@ -6889,6 +7121,19 @@ interface TaskMountDirectoryRequest {
6889
7121
  customerSuppliedEncryptionKey?: Uint8Array | undefined;
6890
7122
  }
6891
7123
  declare const TaskMountDirectoryRequest: MessageFns<TaskMountDirectoryRequest>;
7124
+ interface TaskReloadVolumesRequest {
7125
+ taskId: string;
7126
+ }
7127
+ declare const TaskReloadVolumesRequest: MessageFns<TaskReloadVolumesRequest>;
7128
+ interface TaskSetNetworkAccessRequest {
7129
+ taskId: string;
7130
+ /**
7131
+ * Replaces the task's network access policy. Only ALLOWLIST is currently
7132
+ * supported; open access is expressed as an allow-all allowlist.
7133
+ */
7134
+ networkAccess: NetworkAccess | undefined;
7135
+ }
7136
+ declare const TaskSetNetworkAccessRequest: MessageFns<TaskSetNetworkAccessRequest>;
6892
7137
  interface TaskSnapshotDirectoryRequest {
6893
7138
  taskId: string;
6894
7139
  path: Uint8Array;
@@ -7015,6 +7260,14 @@ declare class TaskCommandRouterClientImpl {
7015
7260
  snapshotDirectory(request: TaskSnapshotDirectoryRequest, options?: TimeoutOptions): Promise<TaskSnapshotDirectoryResponse>;
7016
7261
  snapshotFilesystem(request: TaskSnapshotFilesystemRequest, options?: TimeoutOptions): Promise<TaskSnapshotFilesystemResponse>;
7017
7262
  unmountDirectory(request: TaskUnmountDirectoryRequest): Promise<void>;
7263
+ setNetworkAccess(request: TaskSetNetworkAccessRequest): Promise<void>;
7264
+ /**
7265
+ * Reload all Volumes mounted in the task to reflect their latest committed state.
7266
+ *
7267
+ * `timeoutMs` is the client-side deadline. If the reload does not complete
7268
+ * within this window, the call is cancelled and a TimeoutError is thrown.
7269
+ */
7270
+ reloadVolumes(request: TaskReloadVolumesRequest, options?: TimeoutOptions): Promise<void>;
7018
7271
  sandboxWaitUntilReady(taskId: string, timeoutMs: number): Promise<SandboxWaitUntilReadyTcrResponse>;
7019
7272
  private refreshJwt;
7020
7273
  private callWithAuthRetry;
@@ -7037,6 +7290,20 @@ interface FileInfo {
7037
7290
  readonly modifiedTime: number;
7038
7291
  readonly symlinkTarget: string | null;
7039
7292
  }
7293
+ /** Type of a filesystem watch event. */
7294
+ type FileWatchEventType = "Access" | "Create" | "Modify" | "Remove" | "Unknown";
7295
+ /** A filesystem change event.
7296
+ *
7297
+ * `paths` contains the absolute path(s) affected by the event. For most event
7298
+ * types it holds a single entry. Rename operations are reported as `Modify`
7299
+ * events: when both the source and destination fall within the watched scope,
7300
+ * `paths` holds `[source, destination]`; when only one side of the rename is
7301
+ * visible, `paths` holds that single path.
7302
+ */
7303
+ interface FileWatchEvent {
7304
+ readonly eventType: FileWatchEventType;
7305
+ readonly paths: string[];
7306
+ }
7040
7307
  /** Namespace for Sandbox filesystem APIs. */
7041
7308
  declare class SandboxFilesystem {
7042
7309
  private readonly exec;
@@ -7158,6 +7425,36 @@ declare class SandboxFilesystem {
7158
7425
  * @throws {SandboxFilesystemError} the command fails for any other reason.
7159
7426
  */
7160
7427
  stat(remotePath: string): Promise<FileInfo>;
7428
+ /**
7429
+ * Watch a path in the Sandbox for filesystem changes.
7430
+ *
7431
+ * `remotePath` must be an absolute path in the Sandbox. If it points to a
7432
+ * file, events for that file are reported. If it points to a directory,
7433
+ * events for entries directly inside it are reported. Set `recursive: true`
7434
+ * to also receive events for all nested subdirectories. If `remotePath` is
7435
+ * a symlink, it is followed and events reference paths under the resolved
7436
+ * target.
7437
+ *
7438
+ * Yields {@link FileWatchEvent} objects as changes occur, until either the
7439
+ * timeout elapses, the iterator is closed, or the Sandbox is terminated.
7440
+ *
7441
+ * Optionally restrict the kinds of events emitted to those included in
7442
+ * `filter`. An undefined `filter` permits all types; passing an empty array
7443
+ * suppresses all events.
7444
+ *
7445
+ * `timeoutMs` is truncated to whole seconds. Omit it to watch indefinitely.
7446
+ * When the timeout elapses, the iterator stops without raising an exception.
7447
+ *
7448
+ * @throws {SandboxFilesystemNotFoundError} `remotePath` does not exist.
7449
+ * @throws {SandboxFilesystemPermissionError} watch access is denied.
7450
+ * @throws {InvalidError} the filesystem does not support watching.
7451
+ * @throws {SandboxFilesystemError} the command fails for any other reason.
7452
+ */
7453
+ watch(remotePath: string, params?: {
7454
+ filter?: FileWatchEventType[];
7455
+ recursive?: boolean;
7456
+ timeoutMs?: number;
7457
+ }): AsyncIterable<FileWatchEvent>;
7161
7458
  /**
7162
7459
  * Write binary content to a file in the Sandbox.
7163
7460
  *
@@ -7190,6 +7487,7 @@ declare class SandboxFilesystem {
7190
7487
 
7191
7488
  type SandboxSidecarCommandRouter = Pick<TaskCommandRouterClientImpl, "containerCreate" | "containerGet" | "containerList" | "containerTerminate" | "containerWait">;
7192
7489
  type SandboxSidecarAccess = {
7490
+ client: ModalClient;
7193
7491
  exec(command: string[], params: SandboxExecParams | undefined, containerId: string): Promise<ContainerProcess>;
7194
7492
  commandRouter(): Promise<[string, SandboxSidecarCommandRouter]>;
7195
7493
  };
@@ -7442,11 +7740,11 @@ declare class SandboxService {
7442
7740
  * supported.
7443
7741
  *
7444
7742
  * V2 sandboxes created with this method are not currently returned by
7445
- * {@link SandboxService#list client.sandboxes.list()} and cannot be looked up
7446
- * with {@link SandboxService#fromName client.sandboxes.fromName()}. Store
7447
- * {@link Sandbox#sandboxId sandbox.sandboxId} if you need to retrieve the
7448
- * sandbox later, and use {@link SandboxService#fromId client.sandboxes.fromId()}
7449
- * to reattach.
7743
+ * {@link SandboxService#list client.sandboxes.list()}. A named Sandbox can be
7744
+ * looked up with
7745
+ * {@link SandboxService#experimentalFromName client.sandboxes.experimentalFromName()};
7746
+ * otherwise store {@link Sandbox#sandboxId sandbox.sandboxId} and use
7747
+ * {@link SandboxService#fromId client.sandboxes.fromId()} to reattach.
7450
7748
  */
7451
7749
  experimentalCreate(app: App, image: Image, params?: SandboxCreateParams): Promise<Sandbox>;
7452
7750
  /** Returns a running {@link Sandbox} object from an ID.
@@ -7465,11 +7763,39 @@ declare class SandboxService {
7465
7763
  * @returns Promise that resolves to a Sandbox
7466
7764
  */
7467
7765
  fromName(appName: string, name: string, params?: SandboxFromNameParams): Promise<Sandbox>;
7766
+ /**
7767
+ * Get a running V2 {@link Sandbox} by name from a deployed {@link App}.
7768
+ *
7769
+ * This looks up V2 Sandboxes, i.e. Sandboxes created via
7770
+ * {@link SandboxService#experimentalCreate client.sandboxes.experimentalCreate()}.
7771
+ *
7772
+ * EXPERIMENTAL: the API is subject to change.
7773
+ *
7774
+ * @param appName - Name of the deployed App
7775
+ * @param name - Name of the Sandbox
7776
+ * @param params - Optional parameters for getting the Sandbox
7777
+ * @returns Promise that resolves to a Sandbox
7778
+ */
7779
+ experimentalFromName(appName: string, name: string, params?: SandboxExperimentalFromNameParams): Promise<Sandbox>;
7468
7780
  /**
7469
7781
  * List all {@link Sandbox}es for the current Environment or App ID (if specified).
7470
7782
  * If tags are specified, only Sandboxes that have at least those tags are returned.
7471
7783
  */
7472
7784
  list(params?: SandboxListParams): AsyncGenerator<Sandbox, void, unknown>;
7785
+ /**
7786
+ * List the V2 {@link Sandbox}es in an {@link App}.
7787
+ *
7788
+ * This lists V2 Sandboxes, i.e. Sandboxes created via
7789
+ * {@link SandboxService#experimentalCreate client.sandboxes.experimentalCreate()}.
7790
+ * Such Sandboxes are not returned by
7791
+ * {@link SandboxService#list client.sandboxes.list()}. If tags are specified,
7792
+ * only Sandboxes that have at least those tags are returned.
7793
+ *
7794
+ * Yields {@link Sandbox} objects that are currently running in the App.
7795
+ *
7796
+ * EXPERIMENTAL: the API is subject to change.
7797
+ */
7798
+ experimentalList(params: SandboxExperimentalListParams): AsyncGenerator<Sandbox, void, unknown>;
7473
7799
  }
7474
7800
  /** Optional parameters for {@link SandboxService#list client.sandboxes.list()}. */
7475
7801
  type SandboxListParams = {
@@ -7480,10 +7806,21 @@ type SandboxListParams = {
7480
7806
  /** Override environment for the request; defaults to current profile. */
7481
7807
  environment?: string;
7482
7808
  };
7809
+ /** Parameters for {@link SandboxService#experimentalList client.sandboxes.experimentalList()}. */
7810
+ type SandboxExperimentalListParams = {
7811
+ /** The App to list Sandboxes under. */
7812
+ appId: string;
7813
+ /** Only return Sandboxes that include all specified tags. */
7814
+ tags?: Record<string, string>;
7815
+ };
7483
7816
  /** Optional parameters for {@link SandboxService#fromName client.sandboxes.fromName()}. */
7484
7817
  type SandboxFromNameParams = {
7485
7818
  environment?: string;
7486
7819
  };
7820
+ /** Optional parameters for {@link SandboxService#experimentalFromName client.sandboxes.experimentalFromName()}. */
7821
+ type SandboxExperimentalFromNameParams = {
7822
+ environment?: string;
7823
+ };
7487
7824
  /** Optional parameters for {@link Sandbox#exec Sandbox.exec()}. */
7488
7825
  type SandboxExecParams = {
7489
7826
  /** Specifies text or binary encoding for input and output streams. */
@@ -7524,6 +7861,16 @@ type SandboxSnapshotFilesystemParams = {
7524
7861
  */
7525
7862
  ttlMs?: number | null;
7526
7863
  };
7864
+ /** Optional parameters for {@link Sandbox#reloadVolumes Sandbox.reloadVolumes()}. */
7865
+ type SandboxReloadVolumesParams = {
7866
+ /**
7867
+ * Overall budget for the reload call, in milliseconds. Defaults to 55000.
7868
+ * If the reload does not complete within this window, the call is cancelled
7869
+ * and a `TimeoutError` is thrown; note that the reload may still complete in
7870
+ * the background.
7871
+ */
7872
+ timeoutMs?: number;
7873
+ };
7527
7874
  /** Optional parameters for {@link Sandbox#snapshotDirectory Sandbox.snapshotDirectory()}. */
7528
7875
  type SandboxSnapshotDirectoryParams = {
7529
7876
  /**
@@ -7560,6 +7907,21 @@ type SandboxCreateConnectTokenParams = {
7560
7907
  /** Container port that requests are routed to when using this token. Defaults to 8080. */
7561
7908
  port?: number;
7562
7909
  };
7910
+ /**
7911
+ * Parameters for {@link Sandbox#updateNetworkPolicy Sandbox.updateNetworkPolicy()}.
7912
+ *
7913
+ * Each dimension is independent: `undefined` leaves that dimension unchanged,
7914
+ * while a defined value replaces it (an empty array blocks all egress for that
7915
+ * dimension; a wildcard entry such as `"0.0.0.0/0"` or `"*"` allows everything).
7916
+ *
7917
+ * Currently, both dimensions must be provided (the underlying transport does
7918
+ * not yet support partial updates). This requirement will be relaxed in a
7919
+ * future release.
7920
+ */
7921
+ type SandboxUpdateNetworkPolicyParams = {
7922
+ outboundCidrAllowlist?: string[];
7923
+ outboundDomainAllowlist?: string[];
7924
+ };
7563
7925
  /** Credentials returned by {@link Sandbox#createConnectToken Sandbox.createConnectToken()}. */
7564
7926
  type SandboxCreateConnectCredentials = {
7565
7927
  url: string;
@@ -7670,6 +8032,25 @@ declare class Sandbox {
7670
8032
  * @param path - The mount path to unmount
7671
8033
  */
7672
8034
  unmountImage(path: string): Promise<void>;
8035
+ /**
8036
+ * Updates the outbound network policy of a running Sandbox.
8037
+ *
8038
+ * Established connections that the new policy no longer permits are terminated.
8039
+ *
8040
+ * @param params - Both `outboundCidrAllowlist` and `outboundDomainAllowlist` must be provided.
8041
+ */
8042
+ updateNetworkPolicy(params: SandboxUpdateNetworkPolicyParams): Promise<void>;
8043
+ /**
8044
+ * Reload all Volumes mounted in the Sandbox.
8045
+ *
8046
+ * Blocks until the Volumes have been reloaded, bounded by `timeoutMs` (55000
8047
+ * by default). If the reload does not complete within that window, a
8048
+ * `TimeoutError` is thrown; note that the reload may still complete in the
8049
+ * background.
8050
+ *
8051
+ * @param params - Optional parameters; see {@link SandboxReloadVolumesParams}.
8052
+ */
8053
+ reloadVolumes(params?: SandboxReloadVolumesParams): Promise<void>;
7673
8054
  /**
7674
8055
  * Snapshots and creates a new {@link Image} from a directory in the running sandbox.
7675
8056
  *
@@ -7920,4 +8301,4 @@ declare class ClientClosedError extends Error {
7920
8301
 
7921
8302
  declare function checkForRenamedParams(params: any, renames: Record<string, string>): void;
7922
8303
 
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 };
8304
+ 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, type FileWatchEvent, type FileWatchEventType, 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, type SandboxExperimentalFromNameParams, type SandboxExperimentalListParams, SandboxFilesystem, SandboxFilesystemDirectoryNotEmptyError, SandboxFilesystemError, SandboxFilesystemFileTooLargeError, SandboxFilesystemIsADirectoryError, SandboxFilesystemNotADirectoryError, SandboxFilesystemNotFoundError, SandboxFilesystemPathAlreadyExistsError, SandboxFilesystemPermissionError, type SandboxFromNameParams, type SandboxListParams, type SandboxMountImageParams, type SandboxReloadVolumesParams, SandboxService, type SandboxSnapshotDirectoryParams, type SandboxSnapshotFilesystemParams, type SandboxTerminateParams, SandboxTimeoutError, type SandboxUpdateNetworkPolicyParams, 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 VolumeMountOptionsParams, VolumeService, checkForRenamedParams };