modal 0.8.2 → 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,6 +1207,13 @@ 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;
1202
1219
  /** Let a Function container finish processing any inputs before exiting. */
@@ -1512,10 +1529,31 @@ declare const EndpointStopRequest: MessageFns$1<EndpointStopRequest>;
1512
1529
  interface EndpointStopResponse {
1513
1530
  }
1514
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>;
1515
1552
  interface EnvironmentCreateRequest {
1516
1553
  name: string;
1517
1554
  isManaged: boolean;
1518
1555
  settings: EnvironmentSettings | undefined;
1556
+ environmentType: EnvironmentType;
1519
1557
  }
1520
1558
  declare const EnvironmentCreateRequest: MessageFns$1<EnvironmentCreateRequest>;
1521
1559
  interface EnvironmentDeleteRequest {
@@ -1582,6 +1620,7 @@ interface EnvironmentListItem {
1582
1620
  effectiveCycleSpendLimit: number;
1583
1621
  currentCycleUsage: number;
1584
1622
  spendLimitReached: boolean;
1623
+ environmentType: EnvironmentType;
1585
1624
  }
1586
1625
  declare const EnvironmentListItem: MessageFns$1<EnvironmentListItem>;
1587
1626
  interface EnvironmentListResponse {
@@ -1591,6 +1630,7 @@ declare const EnvironmentListResponse: MessageFns$1<EnvironmentListResponse>;
1591
1630
  interface EnvironmentMetadata {
1592
1631
  name: string;
1593
1632
  settings: EnvironmentSettings | undefined;
1633
+ environmentType: EnvironmentType;
1594
1634
  }
1595
1635
  declare const EnvironmentMetadata: MessageFns$1<EnvironmentMetadata>;
1596
1636
  interface EnvironmentRoleSetRequest {
@@ -1877,6 +1917,7 @@ declare const FunctionCallFromIdRequest: MessageFns$1<FunctionCallFromIdRequest>
1877
1917
  interface FunctionCallFromIdResponse {
1878
1918
  functionCallId: string;
1879
1919
  numInputs: number;
1920
+ metadata: FunctionCallHandleMetadata | undefined;
1880
1921
  }
1881
1922
  declare const FunctionCallFromIdResponse: MessageFns$1<FunctionCallFromIdResponse>;
1882
1923
  interface FunctionCallGetDataRequest {
@@ -1885,6 +1926,11 @@ interface FunctionCallGetDataRequest {
1885
1926
  lastIndex: number;
1886
1927
  }
1887
1928
  declare const FunctionCallGetDataRequest: MessageFns$1<FunctionCallGetDataRequest>;
1929
+ interface FunctionCallHandleMetadata {
1930
+ appId: string;
1931
+ functionId: string;
1932
+ }
1933
+ declare const FunctionCallHandleMetadata: MessageFns$1<FunctionCallHandleMetadata>;
1888
1934
  interface FunctionCallInfo {
1889
1935
  functionCallId: string;
1890
1936
  idx: number;
@@ -2180,6 +2226,7 @@ interface FunctionHandleMetadata {
2180
2226
  ExperimentalFlashUrls: string[];
2181
2227
  supportedInputFormats: DataFormat[];
2182
2228
  supportedOutputFormats: DataFormat[];
2229
+ appId: string;
2183
2230
  }
2184
2231
  declare const FunctionHandleMetadata: MessageFns$1<FunctionHandleMetadata>;
2185
2232
  interface FunctionInput {
@@ -2545,11 +2592,11 @@ interface ImageMetadata {
2545
2592
  declare const ImageMetadata: MessageFns$1<ImageMetadata>;
2546
2593
  interface ImagePublishRequest {
2547
2594
  imageId: string;
2548
- /** Full "name:tag" string. Must be non-empty. Each ImagePublish RPC writes exactly one tag. */
2595
+ /** Full "name:tag" string. Must be non-empty. */
2549
2596
  tag: string;
2550
2597
  environmentName: string;
2551
- /** Marks the published tag as public. Public read protocol is defined separately. */
2552
- isPublic: boolean;
2598
+ /** Explicit opt-in required when publishing to a public environment. */
2599
+ allowPublic: boolean;
2553
2600
  }
2554
2601
  declare const ImagePublishRequest: MessageFns$1<ImagePublishRequest>;
2555
2602
  interface ImagePublishResponse {
@@ -2675,6 +2722,14 @@ interface MethodDefinition {
2675
2722
  supportedOutputFormats: DataFormat[];
2676
2723
  }
2677
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>;
2678
2733
  interface MountFile {
2679
2734
  filename: string;
2680
2735
  /** SHA-256 checksum of the file. */
@@ -3224,6 +3279,7 @@ interface SandboxCreateV2Request {
3224
3279
  appId: string;
3225
3280
  definition: Sandbox$1 | undefined;
3226
3281
  ephemeralSecrets: StringMap | undefined;
3282
+ tags: SandboxTag[];
3227
3283
  }
3228
3284
  declare const SandboxCreateV2Request: MessageFns$1<SandboxCreateV2Request>;
3229
3285
  interface SandboxCreateV2Response {
@@ -3237,7 +3293,8 @@ declare const SandboxCreateV2Response: MessageFns$1<SandboxCreateV2Response>;
3237
3293
  * For all other use cases, use TaskGetCommandRouterAccess instead.
3238
3294
  */
3239
3295
  interface SandboxGetCommandRouterAccessRequest {
3240
- sandboxId: string;
3296
+ sandboxId?: string | undefined;
3297
+ taskId?: string | undefined;
3241
3298
  }
3242
3299
  declare const SandboxGetCommandRouterAccessRequest: MessageFns$1<SandboxGetCommandRouterAccessRequest>;
3243
3300
  interface SandboxGetCommandRouterAccessResponse {
@@ -3666,6 +3723,7 @@ interface TaskClusterHelloRequest {
3666
3723
  taskId: string;
3667
3724
  containerIp: string;
3668
3725
  imexHostIp: string;
3726
+ imexFabricId: string;
3669
3727
  }
3670
3728
  declare const TaskClusterHelloRequest: MessageFns$1<TaskClusterHelloRequest>;
3671
3729
  interface TaskClusterHelloResponse {
@@ -3675,7 +3733,7 @@ interface TaskClusterHelloResponse {
3675
3733
  containerIps: string[];
3676
3734
  containerIpv4Ips: string[];
3677
3735
  /**
3678
- * 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,
3679
3737
  * and otherwise absent on non-NVL72 systems
3680
3738
  */
3681
3739
  imexPeerIps: string[];
@@ -3710,6 +3768,7 @@ interface TaskGetInfoResponse {
3710
3768
  declare const TaskGetInfoResponse: MessageFns$1<TaskGetInfoResponse>;
3711
3769
  interface TaskInfo {
3712
3770
  id: string;
3771
+ /** For Function containers, this corresponds to the "ready" time, after startup phase */
3713
3772
  startedAt: number;
3714
3773
  finishedAt: number;
3715
3774
  result: GenericResult | undefined;
@@ -3922,6 +3981,12 @@ interface VolumeCopyFilesRequest {
3922
3981
  recursive: boolean;
3923
3982
  }
3924
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>;
3925
3990
  interface VolumeDeleteRequest {
3926
3991
  volumeId: string;
3927
3992
  /** @deprecated */
@@ -3981,6 +4046,7 @@ interface VolumeGetOrCreateRequest {
3981
4046
  /** only used with OBJECT_CREATION_TYPE_ANONYMOUS_OWNED_BY_APP */
3982
4047
  appId: string;
3983
4048
  version: VolumeFsVersion;
4049
+ createOptions?: VolumeCreateOptions | undefined;
3984
4050
  }
3985
4051
  declare const VolumeGetOrCreateRequest: MessageFns$1<VolumeGetOrCreateRequest>;
3986
4052
  interface VolumeGetOrCreateResponse {
@@ -4229,10 +4295,6 @@ interface WorkspaceBillingReportItem {
4229
4295
  tags: {
4230
4296
  [key: string]: string;
4231
4297
  };
4232
- /** old field to be removed */
4233
- costByResourceFloat: {
4234
- [key: string]: number;
4235
- };
4236
4298
  costByResource: {
4237
4299
  [key: string]: string;
4238
4300
  };
@@ -4249,6 +4311,26 @@ interface WorkspaceBillingReportRequest {
4249
4311
  appIds: string[];
4250
4312
  }
4251
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>;
4252
4334
  interface WorkspaceDashboardUrlRequest {
4253
4335
  environmentName: string;
4254
4336
  }
@@ -4663,6 +4745,14 @@ declare const ModalClientDefinition: {
4663
4745
  readonly responseStream: false;
4664
4746
  readonly options: {};
4665
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
+ };
4666
4756
  readonly containerStop: {
4667
4757
  readonly name: "ContainerStop";
4668
4758
  readonly requestType: MessageFns$1<ContainerStopRequest>;
@@ -4844,6 +4934,14 @@ declare const ModalClientDefinition: {
4844
4934
  readonly options: {};
4845
4935
  };
4846
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
+ };
4847
4945
  readonly environmentCreate: {
4848
4946
  readonly name: "EnvironmentCreate";
4849
4947
  readonly requestType: MessageFns$1<EnvironmentCreateRequest>;
@@ -5245,6 +5343,14 @@ declare const ModalClientDefinition: {
5245
5343
  readonly options: {};
5246
5344
  };
5247
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
+ };
5248
5354
  readonly mountGetOrCreate: {
5249
5355
  readonly name: "MountGetOrCreate";
5250
5356
  readonly requestType: MessageFns$1<MountGetOrCreateRequest>;
@@ -5449,6 +5555,14 @@ declare const ModalClientDefinition: {
5449
5555
  readonly responseStream: false;
5450
5556
  readonly options: {};
5451
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
+ };
5452
5566
  readonly sandboxGetLogs: {
5453
5567
  readonly name: "SandboxGetLogs";
5454
5568
  readonly requestType: MessageFns$1<SandboxGetLogsRequest>;
@@ -5586,6 +5700,14 @@ declare const ModalClientDefinition: {
5586
5700
  readonly responseStream: false;
5587
5701
  readonly options: {};
5588
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
+ };
5589
5711
  readonly sandboxTagsSet: {
5590
5712
  readonly name: "SandboxTagsSet";
5591
5713
  readonly requestType: MessageFns$1<SandboxTagsSetRequest>;
@@ -5594,6 +5716,14 @@ declare const ModalClientDefinition: {
5594
5716
  readonly responseStream: false;
5595
5717
  readonly options: {};
5596
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
+ };
5597
5727
  readonly sandboxTerminate: {
5598
5728
  readonly name: "SandboxTerminate";
5599
5729
  readonly requestType: MessageFns$1<SandboxTerminateRequest>;
@@ -6060,6 +6190,14 @@ declare const ModalClientDefinition: {
6060
6190
  readonly responseStream: true;
6061
6191
  readonly options: {};
6062
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
+ };
6063
6201
  readonly workspaceDashboardUrlGet: {
6064
6202
  readonly name: "WorkspaceDashboardUrlGet";
6065
6203
  readonly requestType: MessageFns$1<WorkspaceDashboardUrlRequest>;
@@ -6151,7 +6289,16 @@ declare class SecretService {
6151
6289
  constructor(client: ModalClient);
6152
6290
  /** Reference a {@link Secret} by its name. */
6153
6291
  fromName(name: string, params?: SecretFromNameParams): Promise<Secret>;
6154
- /** 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
+ */
6155
6302
  fromObject(entries: Record<string, string>, params?: SecretFromObjectParams): Promise<Secret>;
6156
6303
  /**
6157
6304
  * Delete a named {@link Secret}.
@@ -6160,12 +6307,42 @@ declare class SecretService {
6160
6307
  */
6161
6308
  delete(name: string, params?: SecretDeleteParams): Promise<void>;
6162
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
+ }
6163
6321
  /** Secrets provide a dictionary of environment variables for {@link Image}s. */
6164
6322
  declare class Secret {
6165
- readonly secretId: string;
6323
+ #private;
6166
6324
  readonly name?: string;
6167
6325
  /** @ignore */
6168
- 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>;
6169
6346
  }
6170
6347
 
6171
6348
  declare class CloudBucketMountService {
@@ -6313,12 +6490,12 @@ declare class Volume {
6313
6490
  * Configure options used when mounting this Volume. Fields left undefined preserve their value
6314
6491
  * from any previous withMountOptions call on the same Volume (stacking).
6315
6492
  */
6316
- withMountOptions(params?: VolumeMountOptions): Volume;
6493
+ withMountOptions(params?: VolumeMountOptionsParams): Volume;
6317
6494
  /** Delete the ephemeral Volume. Only usable with emphemeral Volumes. */
6318
6495
  closeEphemeral(): void;
6319
6496
  }
6320
6497
  /** Options for mounting a {@link Volume}. */
6321
- type VolumeMountOptions = {
6498
+ type VolumeMountOptionsParams = {
6322
6499
  readOnly?: boolean;
6323
6500
  subPath?: string;
6324
6501
  };
@@ -6340,7 +6517,8 @@ declare class Retries {
6340
6517
  /** Optional parameters for `client.functions.fromName()`. */
6341
6518
  type FunctionFromNameParams = {
6342
6519
  environment?: string;
6343
- createIfMissing?: boolean;
6520
+ /** Look up a version-pinned Function deployed at this App version. */
6521
+ version?: number;
6344
6522
  };
6345
6523
  /**
6346
6524
  * Service for managing {@link Function_ Function}s.
@@ -6386,6 +6564,7 @@ type FunctionWithOptionsParams = {
6386
6564
  bufferContainers?: number;
6387
6565
  scaledownWindowMs?: number;
6388
6566
  timeoutMs?: number;
6567
+ routingRegion?: string;
6389
6568
  };
6390
6569
  /** Configuration options for {@link Function_#withConcurrency Function_.withConcurrency()}. */
6391
6570
  type FunctionWithConcurrencyParams = {
@@ -6435,7 +6614,8 @@ declare class Function_ {
6435
6614
  /** Optional parameters for {@link ClsService#fromName client.cls.fromName()}. */
6436
6615
  type ClsFromNameParams = {
6437
6616
  environment?: string;
6438
- createIfMissing?: boolean;
6617
+ /** Look up a version-pinned Cls deployed at this App version. */
6618
+ version?: number;
6439
6619
  };
6440
6620
  /**
6441
6621
  * Service for managing {@link Cls}.
@@ -6483,6 +6663,13 @@ type ImageFromNameParams = {
6483
6663
  /** Modal Environment to resolve the named Image in. */
6484
6664
  environment?: string;
6485
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>;
6486
6673
  /**
6487
6674
  * Service for managing {@link Image}s.
6488
6675
  *
@@ -6572,7 +6759,7 @@ type Layer = {
6572
6759
  declare class Image {
6573
6760
  #private;
6574
6761
  /** @ignore */
6575
- 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);
6576
6763
  get imageId(): string;
6577
6764
  private static validateDockerfileCommands;
6578
6765
  /**
@@ -7074,8 +7261,13 @@ declare class TaskCommandRouterClientImpl {
7074
7261
  snapshotFilesystem(request: TaskSnapshotFilesystemRequest, options?: TimeoutOptions): Promise<TaskSnapshotFilesystemResponse>;
7075
7262
  unmountDirectory(request: TaskUnmountDirectoryRequest): Promise<void>;
7076
7263
  setNetworkAccess(request: TaskSetNetworkAccessRequest): Promise<void>;
7077
- /** Reload all Volumes mounted in the task to reflect their latest committed state. */
7078
- reloadVolumes(request: TaskReloadVolumesRequest): 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>;
7079
7271
  sandboxWaitUntilReady(taskId: string, timeoutMs: number): Promise<SandboxWaitUntilReadyTcrResponse>;
7080
7272
  private refreshJwt;
7081
7273
  private callWithAuthRetry;
@@ -7098,6 +7290,20 @@ interface FileInfo {
7098
7290
  readonly modifiedTime: number;
7099
7291
  readonly symlinkTarget: string | null;
7100
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
+ }
7101
7307
  /** Namespace for Sandbox filesystem APIs. */
7102
7308
  declare class SandboxFilesystem {
7103
7309
  private readonly exec;
@@ -7219,6 +7425,36 @@ declare class SandboxFilesystem {
7219
7425
  * @throws {SandboxFilesystemError} the command fails for any other reason.
7220
7426
  */
7221
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>;
7222
7458
  /**
7223
7459
  * Write binary content to a file in the Sandbox.
7224
7460
  *
@@ -7251,6 +7487,7 @@ declare class SandboxFilesystem {
7251
7487
 
7252
7488
  type SandboxSidecarCommandRouter = Pick<TaskCommandRouterClientImpl, "containerCreate" | "containerGet" | "containerList" | "containerTerminate" | "containerWait">;
7253
7489
  type SandboxSidecarAccess = {
7490
+ client: ModalClient;
7254
7491
  exec(command: string[], params: SandboxExecParams | undefined, containerId: string): Promise<ContainerProcess>;
7255
7492
  commandRouter(): Promise<[string, SandboxSidecarCommandRouter]>;
7256
7493
  };
@@ -7503,11 +7740,11 @@ declare class SandboxService {
7503
7740
  * supported.
7504
7741
  *
7505
7742
  * V2 sandboxes created with this method are not currently returned by
7506
- * {@link SandboxService#list client.sandboxes.list()} and cannot be looked up
7507
- * with {@link SandboxService#fromName client.sandboxes.fromName()}. Store
7508
- * {@link Sandbox#sandboxId sandbox.sandboxId} if you need to retrieve the
7509
- * sandbox later, and use {@link SandboxService#fromId client.sandboxes.fromId()}
7510
- * 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.
7511
7748
  */
7512
7749
  experimentalCreate(app: App, image: Image, params?: SandboxCreateParams): Promise<Sandbox>;
7513
7750
  /** Returns a running {@link Sandbox} object from an ID.
@@ -7526,6 +7763,20 @@ declare class SandboxService {
7526
7763
  * @returns Promise that resolves to a Sandbox
7527
7764
  */
7528
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>;
7529
7780
  /**
7530
7781
  * List all {@link Sandbox}es for the current Environment or App ID (if specified).
7531
7782
  * If tags are specified, only Sandboxes that have at least those tags are returned.
@@ -7537,8 +7788,8 @@ declare class SandboxService {
7537
7788
  * This lists V2 Sandboxes, i.e. Sandboxes created via
7538
7789
  * {@link SandboxService#experimentalCreate client.sandboxes.experimentalCreate()}.
7539
7790
  * Such Sandboxes are not returned by
7540
- * {@link SandboxService#list client.sandboxes.list()}. Filtering based on tags
7541
- * is not yet supported.
7791
+ * {@link SandboxService#list client.sandboxes.list()}. If tags are specified,
7792
+ * only Sandboxes that have at least those tags are returned.
7542
7793
  *
7543
7794
  * Yields {@link Sandbox} objects that are currently running in the App.
7544
7795
  *
@@ -7559,11 +7810,17 @@ type SandboxListParams = {
7559
7810
  type SandboxExperimentalListParams = {
7560
7811
  /** The App to list Sandboxes under. */
7561
7812
  appId: string;
7813
+ /** Only return Sandboxes that include all specified tags. */
7814
+ tags?: Record<string, string>;
7562
7815
  };
7563
7816
  /** Optional parameters for {@link SandboxService#fromName client.sandboxes.fromName()}. */
7564
7817
  type SandboxFromNameParams = {
7565
7818
  environment?: string;
7566
7819
  };
7820
+ /** Optional parameters for {@link SandboxService#experimentalFromName client.sandboxes.experimentalFromName()}. */
7821
+ type SandboxExperimentalFromNameParams = {
7822
+ environment?: string;
7823
+ };
7567
7824
  /** Optional parameters for {@link Sandbox#exec Sandbox.exec()}. */
7568
7825
  type SandboxExecParams = {
7569
7826
  /** Specifies text or binary encoding for input and output streams. */
@@ -7604,6 +7861,16 @@ type SandboxSnapshotFilesystemParams = {
7604
7861
  */
7605
7862
  ttlMs?: number | null;
7606
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
+ };
7607
7874
  /** Optional parameters for {@link Sandbox#snapshotDirectory Sandbox.snapshotDirectory()}. */
7608
7875
  type SandboxSnapshotDirectoryParams = {
7609
7876
  /**
@@ -7775,8 +8042,15 @@ declare class Sandbox {
7775
8042
  updateNetworkPolicy(params: SandboxUpdateNetworkPolicyParams): Promise<void>;
7776
8043
  /**
7777
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}.
7778
8052
  */
7779
- reloadVolumes(): Promise<void>;
8053
+ reloadVolumes(params?: SandboxReloadVolumesParams): Promise<void>;
7780
8054
  /**
7781
8055
  * Snapshots and creates a new {@link Image} from a directory in the running sandbox.
7782
8056
  *
@@ -8027,4 +8301,4 @@ declare class ClientClosedError extends Error {
8027
8301
 
8028
8302
  declare function checkForRenamedParams(params: any, renames: Record<string, string>): void;
8029
8303
 
8030
- 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, type SandboxExperimentalListParams, SandboxFilesystem, SandboxFilesystemDirectoryNotEmptyError, SandboxFilesystemError, SandboxFilesystemFileTooLargeError, SandboxFilesystemIsADirectoryError, SandboxFilesystemNotADirectoryError, SandboxFilesystemNotFoundError, SandboxFilesystemPathAlreadyExistsError, SandboxFilesystemPermissionError, type SandboxFromNameParams, type SandboxListParams, type SandboxMountImageParams, 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 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 };