@tensorlakeai/tensorlake 0.5.153 → 0.5.156

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.
Files changed (35) hide show
  1. package/dist/applications/index.cjs +260 -71
  2. package/dist/applications/index.cjs.map +1 -1
  3. package/dist/applications/index.d.cts +3 -3
  4. package/dist/applications/index.d.ts +3 -3
  5. package/dist/applications/index.js +260 -71
  6. package/dist/applications/index.js.map +1 -1
  7. package/dist/function-agent/main.cjs +1 -1
  8. package/dist/function-agent/main.js +1 -1
  9. package/dist/function-executor/main.cjs +2 -2
  10. package/dist/function-executor/main.js +2 -2
  11. package/dist/index.cjs +344 -106
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +95 -38
  14. package/dist/index.d.ts +95 -38
  15. package/dist/index.js +339 -106
  16. package/dist/index.js.map +1 -1
  17. package/dist/{remote-B3vn4tt1.d.cts → remote-CEs4GFGP.d.cts} +1 -1
  18. package/dist/{remote-DqBUuciu.d.ts → remote-DYBXCTNC.d.ts} +1 -1
  19. package/dist/{sandbox-image-BMiFlzAs.d.cts → sandbox-image-C2GTVnx3.d.cts} +99 -52
  20. package/dist/{sandbox-image-BMiFlzAs.d.ts → sandbox-image-C2GTVnx3.d.ts} +99 -52
  21. package/dist/sandbox-image.cjs +248 -61
  22. package/dist/sandbox-image.cjs.map +1 -1
  23. package/dist/sandbox-image.d.cts +1 -1
  24. package/dist/sandbox-image.d.ts +1 -1
  25. package/dist/sandbox-image.js +248 -61
  26. package/dist/sandbox-image.js.map +1 -1
  27. package/package.json +7 -7
  28. package/runtime/function-executor/manifest.json +5 -5
  29. package/runtime/function-executor/package/dist/function-executor/main.js +2 -2
  30. package/runtime/function-executor/package/npm-shrinkwrap.json +2 -2
  31. package/runtime/function-executor/package/package.json +1 -1
  32. package/runtime/typescript-function-runner/manifest.json +5 -5
  33. package/runtime/typescript-function-runner/package/dist/function-agent/main.js +1 -1
  34. package/runtime/typescript-function-runner/package/npm-shrinkwrap.json +26 -26
  35. package/runtime/typescript-function-runner/package/package.json +7 -7
@@ -1,4 +1,4 @@
1
- import { C as CloudClientOptions, A as ApplicationManifest, F as FileSystem, a as ApplicationSummary, R as RequestInput, b as RequestOutput, I as Image } from './sandbox-image-BMiFlzAs.cjs';
1
+ import { C as CloudClientOptions, A as ApplicationManifest, F as FileSystem, a as ApplicationSummary, R as RequestInput, b as RequestOutput, I as Image } from './sandbox-image-C2GTVnx3.cjs';
2
2
 
3
3
  declare class APIClient {
4
4
  private readonly cloudClient;
@@ -1,4 +1,4 @@
1
- import { C as CloudClientOptions, A as ApplicationManifest, F as FileSystem, a as ApplicationSummary, R as RequestInput, b as RequestOutput, I as Image } from './sandbox-image-BMiFlzAs.js';
1
+ import { C as CloudClientOptions, A as ApplicationManifest, F as FileSystem, a as ApplicationSummary, R as RequestInput, b as RequestOutput, I as Image } from './sandbox-image-C2GTVnx3.js';
2
2
 
3
3
  declare class APIClient {
4
4
  private readonly cloudClient;
@@ -137,12 +137,12 @@ interface ApplicationBuildResponse {
137
137
  imageBuilds: ApplicationBuildImageResult[];
138
138
  }
139
139
  /**
140
- * A registered sandbox image in the platform template shape. Both image
141
- * families answer it: legacy templates verbatim from the platform API, and
142
- * CAS images (`snapshotFormatVersion === "content_addressed_streaming_v1"`)
143
- * derived by the core from the Image Service's trimmed record (id, name,
144
- * snapshot id, visibility, sizes, timestamps); no content digest or build
145
- * provenance rides on either.
140
+ * A registered CAS or legacy sandbox image in the sandbox-template shape.
141
+ * Both image families answer it: legacy images verbatim from the legacy image
142
+ * registry, and CAS images (`snapshotFormatVersion ===
143
+ * "content_addressed_streaming_v1"`) derived by the core from the CAS image
144
+ * registry's trimmed record (id, name, snapshot id, visibility, sizes,
145
+ * timestamps); no content digest or build provenance rides on either.
146
146
  */
147
147
  interface SandboxTemplate {
148
148
  id?: string;
@@ -208,10 +208,11 @@ declare class Image {
208
208
  run(commands: string | string[], options?: Record<string, string> | undefined): this;
209
209
  workdir(directory: string): this;
210
210
  /**
211
- * Build this image as a sandbox template and register it.
211
+ * Build this image and register it as a CAS sandbox image (the default) or,
212
+ * with `cas: false`, a legacy sandbox image.
212
213
  *
213
214
  * Materializes the image in a build sandbox, snapshots the filesystem,
214
- * and registers the snapshot as a named sandbox template.
215
+ * and registers the snapshot under the image's name.
215
216
  */
216
217
  build(options?: CreateSandboxImageOptions): Promise<Record<string, unknown>>;
217
218
  private _addOperation;
@@ -235,6 +236,14 @@ interface CreateSandboxImageOptions {
235
236
  * Pass "{}" to disable discovery and use no registry credentials.
236
237
  */
237
238
  dockerConfigJson?: string;
239
+ /**
240
+ * Name to register the image under. Defaults to the image's `name` or the
241
+ * Dockerfile stem (the parent directory's name for a file named
242
+ * `Dockerfile`).
243
+ * A CAS image name is lowercased, as the CAS image registry stores it; a
244
+ * default CAS image name is also made valid (other characters become `-`).
245
+ * Legacy image names are kept as given.
246
+ */
238
247
  registeredName?: string;
239
248
  cpus?: number;
240
249
  memoryMb?: number;
@@ -257,22 +266,22 @@ interface CreateSandboxImageOptions {
257
266
  */
258
267
  dockerCompat?: boolean;
259
268
  /**
260
- * Build a CAS (content-addressed streaming) image through the Image
261
- * Service instead of a legacy template. Off by default.
269
+ * Build a CAS (content-addressed streaming) image, the default. Pass
270
+ * `false` to build a legacy image instead.
262
271
  */
263
272
  cas?: boolean;
264
273
  /**
265
274
  * Dockerfile build args (`--build-arg KEY=VALUE`), forwarded to BuildKit
266
- * and expanded in `FROM` references. CAS builds only; a legacy build with
267
- * build args is rejected.
275
+ * and expanded in `FROM` references. CAS images only; a legacy image build
276
+ * with build args is rejected.
268
277
  */
269
278
  buildArgs?: Record<string, string>;
270
279
  /**
271
- * CAS builds only (`cas: true`): aborting requests *remote cancellation*
272
- * of the Image Service build through a bounded handshake, and the call
273
- * rejects with `ImageBuildInterruptedError` carrying the outcome. It is
274
- * rejected for legacy builds, which have no build operation to cancel.
275
- * Abandoning the promise alone never cancels anything.
280
+ * CAS images only: aborting requests *remote cancellation* of the CAS
281
+ * image build through a bounded handshake, and the call rejects with
282
+ * `ImageBuildInterruptedError` carrying the outcome. It is rejected for a
283
+ * legacy image build (`cas: false`), which has no build operation to
284
+ * cancel. Abandoning the promise alone never cancels anything.
276
285
  */
277
286
  signal?: AbortSignal;
278
287
  /**
@@ -293,6 +302,9 @@ interface ImportSandboxImageOptions {
293
302
  * Name to register the image under. Defaults to the image reference's last
294
303
  * path segment with any tag/digest stripped (e.g. `pytorch/pytorch:2.4.1`
295
304
  * -> `pytorch`).
305
+ * A CAS image name is lowercased, as the CAS image registry stores it; a
306
+ * default CAS image name is also made valid (other characters become `-`).
307
+ * Legacy image names are kept as given.
296
308
  */
297
309
  registeredName?: string;
298
310
  cpus?: number;
@@ -306,13 +318,13 @@ interface ImportSandboxImageOptions {
306
318
  */
307
319
  dockerCompat?: boolean;
308
320
  /**
309
- * Import as a CAS (content-addressed streaming) image through the Image
310
- * Service instead of a legacy template. Off by default.
321
+ * Import as a CAS (content-addressed streaming) image, the default. Pass
322
+ * `false` to import a legacy image instead.
311
323
  */
312
324
  cas?: boolean;
313
325
  /**
314
- * CAS imports only (`cas: true`): aborting requests remote cancellation of
315
- * the Image Service import; see `CreateSandboxImageOptions.signal`.
326
+ * CAS images only: aborting requests remote cancellation of the CAS image
327
+ * import; see `CreateSandboxImageOptions.signal`.
316
328
  */
317
329
  signal?: AbortSignal;
318
330
  /**
@@ -415,8 +427,12 @@ interface NativeBinding {
415
427
  listSandboxImages(options: NativeBindingCatalogOptions): Promise<string>;
416
428
  /** JSON record of one image by name or id, or null when unknown. */
417
429
  findSandboxImage(options: NativeBindingCatalogOptions, reference: string): Promise<string | null>;
418
- /** Delete one image by name or id; unknown in both catalogs rejects. */
419
- deleteSandboxImage(options: NativeBindingCatalogOptions, reference: string): Promise<void>;
430
+ /**
431
+ * Delete one image by name or id; a name is deleted from both catalogs.
432
+ * Unknown in both catalogs rejects. Resolves to the same-named legacy
433
+ * image a name's CAS delete could not remove, or null.
434
+ */
435
+ deleteSandboxImage(options: NativeBindingCatalogOptions, reference: string): Promise<NativeLegacyCleanupFailure | null | undefined>;
420
436
  }
421
437
  /** Test seam: replace the native binding with a stub. */
422
438
  declare function __setNativeBindingForTest(binding: NativeBinding | undefined): void;
@@ -431,9 +447,9 @@ interface BuildContext {
431
447
  }
432
448
  declare function buildContextFromEnv(): BuildContext;
433
449
  /**
434
- * @internal Shared with `image-builds.ts`, which implements the Image
435
- * Service build operations on top of the same native binding and
436
- * environment context.
450
+ * @internal Shared with `image-builds.ts`, which implements the CAS image
451
+ * build operations on top of the same native binding and environment
452
+ * context.
437
453
  */
438
454
  declare const __imageBuildInternals: {
439
455
  loadNativeBinding: () => NativeBinding;
@@ -444,6 +460,11 @@ declare const __imageBuildInternals: {
444
460
  imageRequiresContext: (image: Image) => boolean;
445
461
  defaultRegisteredName: (dockerfilePath: string) => string;
446
462
  defaultRegisteredNameFromImage: (reference: string) => string;
463
+ registeredImageName: (explicit: string | undefined, generated: string | undefined, cas: boolean, fallback?: string) => string;
464
+ casImageNameFrom: (raw: string, fallback: string) => string;
465
+ canonicalCasImageName: (name: string) => string;
466
+ isAddressableCasImageName: (name: string) => boolean;
467
+ defaultImportedImageName: string;
447
468
  };
448
469
  declare function createSandboxImage(source: SandboxImageSource, options?: CreateSandboxImageOptions, deps?: CreateSandboxImageDeps): Promise<Record<string, unknown>>;
449
470
  /**
@@ -466,47 +487,73 @@ interface SandboxImageCatalogCredentials {
466
487
  projectId?: string;
467
488
  }
468
489
  /**
469
- * Delete a registered sandbox image by name or id. Both families are
470
- * covered: an `image_` id or a name registered in the Image Service deletes
471
- * a CAS image, a `sandbox_template_` id or a name registered only in the
472
- * platform registry deletes a legacy image. Rejects when neither catalog
473
- * knows the reference.
490
+ * Delete a registered CAS or legacy sandbox image by name or id. Both
491
+ * families are covered: an `image_` id or a name registered in the CAS image
492
+ * registry deletes a CAS image, a `sandbox_template_` id or a name registered
493
+ * only in the legacy image registry deletes a legacy image. Rejects when
494
+ * neither the CAS nor the legacy image registry knows the reference.
495
+ *
496
+ * A name is deleted from both the CAS and the legacy image registries: once
497
+ * its CAS image is deleted, a legacy image of the same name can no longer
498
+ * start sandboxes, so it is deleted too. CAS image names ignore case
499
+ * (`MyProject` deletes the CAS image `myproject`), legacy image names match
500
+ * exactly. Failing to delete that legacy image
501
+ * does not reject, since the CAS image is already gone: a `console.warn`
502
+ * names the legacy image, the error and the call that deletes it. An
503
+ * `image_` or `sandbox_template_` id deletes only the image it names.
474
504
  *
475
- * Deleting removes a *published* image. An unfinished CAS build is cancelled
476
- * with `cancelImageBuild({ buildId })` (or `tl sbx image build cancel
477
- * BUILD_ID`), never by deleting its name: a name whose only state is an
478
- * unfinished first build has no image, so the Image Service answers 404 and
479
- * the lookup falls through to the platform registry as usual. A 202
480
- * (deletion in progress) counts as success; a 409 `image_build_in_progress`,
481
- * a 5xx or a transport failure rejects as is and never falls through.
505
+ * Deleting removes a *published* image. An unfinished CAS image build is
506
+ * cancelled with `cancelImageBuild({ buildId })` (or `tl sbx image build
507
+ * cancel BUILD_ID`), never by deleting its name: a name whose only state is
508
+ * an unfinished first build has no CAS image, so the CAS image registry
509
+ * answers 404 and the lookup falls through to the legacy image registry as
510
+ * usual. A 202 (deletion in progress) counts as success; a 409
511
+ * `image_build_in_progress`, a 5xx or a transport failure rejects as is and
512
+ * never falls through.
482
513
  *
483
514
  * Accepted merged-catalog differences from the released SDKs, for legacy
484
- * images: this deletes the platform-api template itself (the released SDKs
485
- * only removed the engine registration and left the template listed), and
486
- * an unknown name rejects instead of succeeding silently.
515
+ * images: this removes the legacy image from the legacy image registry (the
516
+ * released SDKs only made it unusable and left it listed), and an unknown
517
+ * name rejects instead of succeeding silently.
487
518
  */
488
519
  declare function deleteSandboxImage(imageName: string): Promise<void>;
489
520
  /** @internal `APIClient.deleteSandboxImage` with the client's credentials. */
490
521
  declare function deleteSandboxImageWithCredentials(credentials: SandboxImageCatalogCredentials, imageName: string): Promise<void>;
491
522
  /**
492
- * Look up a registered sandbox image by its registered name or id.
523
+ * The same-named legacy image a name's CAS delete could not remove. Its name
524
+ * is the deleted CAS image's name, in the CAS image registry's lowercase
525
+ * spelling.
526
+ */
527
+ interface NativeLegacyCleanupFailure {
528
+ legacyImageName: string;
529
+ legacyImageId?: string | null;
530
+ error: string;
531
+ }
532
+ /**
533
+ * Look up a registered CAS or legacy sandbox image by its registered name or
534
+ * id.
493
535
  *
494
536
  * Returns the image in the sandbox-template shape (CAS images carry
495
537
  * `snapshotFormatVersion === "content_addressed_streaming_v1"`; the shape is
496
- * derived from the Image Service's trimmed record, so no content digest or
497
- * build provenance rides on it), or `null` if neither the Image Service nor
498
- * the platform registry knows the reference. Uses the same environment-based Tensorlake
499
- * auth as `createSandboxImage`. Ingress derives project scope from the API key.
538
+ * derived from the CAS image registry's trimmed record, so no content digest
539
+ * or build provenance rides on it), or `null` if neither the CAS nor the
540
+ * legacy image registry knows the reference. Uses the same environment-based
541
+ * Tensorlake auth as `createSandboxImage`. Ingress derives project scope from
542
+ * the API key.
500
543
  *
501
- * An `image_` id names the *current* image under its name; a rebuild
544
+ * An `image_` id names the *current* CAS image under its name; a rebuild
502
545
  * replaces it. A build's own immutable result is read with `getImageBuild`.
503
546
  *
547
+ * A name is looked up in the CAS image registry in lowercase, as the
548
+ * registry stores it, and in the legacy image registry exactly as given.
549
+ *
504
550
  * Accepted merged-catalog difference from the released SDKs, for legacy
505
- * images: a name that fits the Image Service grammar is looked up there first
506
- * and only a clean 404 falls through to the platform registry, so Image
507
- * Service unavailability (or a deploy 5xx) rejects the lookup of a legacy name
508
- * where the released SDKs touched only platform-api. A `sandbox_template_` id
509
- * never consults the Image Service.
551
+ * images: a name that fits the CAS image registry's grammar is looked up
552
+ * there first and only a clean 404 falls through to the legacy image
553
+ * registry, so CAS image registry unavailability (or a deploy 5xx) rejects
554
+ * the lookup of a legacy image name where the released SDKs touched only the
555
+ * legacy image registry. A `sandbox_template_` id never consults the CAS
556
+ * image registry.
510
557
  */
511
558
  declare function findSandboxImageByName(imageName: string): Promise<SandboxTemplate | null>;
512
559
  /** @internal `CloudClient.findSandboxImageByName` with the client's credentials. */
@@ -137,12 +137,12 @@ interface ApplicationBuildResponse {
137
137
  imageBuilds: ApplicationBuildImageResult[];
138
138
  }
139
139
  /**
140
- * A registered sandbox image in the platform template shape. Both image
141
- * families answer it: legacy templates verbatim from the platform API, and
142
- * CAS images (`snapshotFormatVersion === "content_addressed_streaming_v1"`)
143
- * derived by the core from the Image Service's trimmed record (id, name,
144
- * snapshot id, visibility, sizes, timestamps); no content digest or build
145
- * provenance rides on either.
140
+ * A registered CAS or legacy sandbox image in the sandbox-template shape.
141
+ * Both image families answer it: legacy images verbatim from the legacy image
142
+ * registry, and CAS images (`snapshotFormatVersion ===
143
+ * "content_addressed_streaming_v1"`) derived by the core from the CAS image
144
+ * registry's trimmed record (id, name, snapshot id, visibility, sizes,
145
+ * timestamps); no content digest or build provenance rides on either.
146
146
  */
147
147
  interface SandboxTemplate {
148
148
  id?: string;
@@ -208,10 +208,11 @@ declare class Image {
208
208
  run(commands: string | string[], options?: Record<string, string> | undefined): this;
209
209
  workdir(directory: string): this;
210
210
  /**
211
- * Build this image as a sandbox template and register it.
211
+ * Build this image and register it as a CAS sandbox image (the default) or,
212
+ * with `cas: false`, a legacy sandbox image.
212
213
  *
213
214
  * Materializes the image in a build sandbox, snapshots the filesystem,
214
- * and registers the snapshot as a named sandbox template.
215
+ * and registers the snapshot under the image's name.
215
216
  */
216
217
  build(options?: CreateSandboxImageOptions): Promise<Record<string, unknown>>;
217
218
  private _addOperation;
@@ -235,6 +236,14 @@ interface CreateSandboxImageOptions {
235
236
  * Pass "{}" to disable discovery and use no registry credentials.
236
237
  */
237
238
  dockerConfigJson?: string;
239
+ /**
240
+ * Name to register the image under. Defaults to the image's `name` or the
241
+ * Dockerfile stem (the parent directory's name for a file named
242
+ * `Dockerfile`).
243
+ * A CAS image name is lowercased, as the CAS image registry stores it; a
244
+ * default CAS image name is also made valid (other characters become `-`).
245
+ * Legacy image names are kept as given.
246
+ */
238
247
  registeredName?: string;
239
248
  cpus?: number;
240
249
  memoryMb?: number;
@@ -257,22 +266,22 @@ interface CreateSandboxImageOptions {
257
266
  */
258
267
  dockerCompat?: boolean;
259
268
  /**
260
- * Build a CAS (content-addressed streaming) image through the Image
261
- * Service instead of a legacy template. Off by default.
269
+ * Build a CAS (content-addressed streaming) image, the default. Pass
270
+ * `false` to build a legacy image instead.
262
271
  */
263
272
  cas?: boolean;
264
273
  /**
265
274
  * Dockerfile build args (`--build-arg KEY=VALUE`), forwarded to BuildKit
266
- * and expanded in `FROM` references. CAS builds only; a legacy build with
267
- * build args is rejected.
275
+ * and expanded in `FROM` references. CAS images only; a legacy image build
276
+ * with build args is rejected.
268
277
  */
269
278
  buildArgs?: Record<string, string>;
270
279
  /**
271
- * CAS builds only (`cas: true`): aborting requests *remote cancellation*
272
- * of the Image Service build through a bounded handshake, and the call
273
- * rejects with `ImageBuildInterruptedError` carrying the outcome. It is
274
- * rejected for legacy builds, which have no build operation to cancel.
275
- * Abandoning the promise alone never cancels anything.
280
+ * CAS images only: aborting requests *remote cancellation* of the CAS
281
+ * image build through a bounded handshake, and the call rejects with
282
+ * `ImageBuildInterruptedError` carrying the outcome. It is rejected for a
283
+ * legacy image build (`cas: false`), which has no build operation to
284
+ * cancel. Abandoning the promise alone never cancels anything.
276
285
  */
277
286
  signal?: AbortSignal;
278
287
  /**
@@ -293,6 +302,9 @@ interface ImportSandboxImageOptions {
293
302
  * Name to register the image under. Defaults to the image reference's last
294
303
  * path segment with any tag/digest stripped (e.g. `pytorch/pytorch:2.4.1`
295
304
  * -> `pytorch`).
305
+ * A CAS image name is lowercased, as the CAS image registry stores it; a
306
+ * default CAS image name is also made valid (other characters become `-`).
307
+ * Legacy image names are kept as given.
296
308
  */
297
309
  registeredName?: string;
298
310
  cpus?: number;
@@ -306,13 +318,13 @@ interface ImportSandboxImageOptions {
306
318
  */
307
319
  dockerCompat?: boolean;
308
320
  /**
309
- * Import as a CAS (content-addressed streaming) image through the Image
310
- * Service instead of a legacy template. Off by default.
321
+ * Import as a CAS (content-addressed streaming) image, the default. Pass
322
+ * `false` to import a legacy image instead.
311
323
  */
312
324
  cas?: boolean;
313
325
  /**
314
- * CAS imports only (`cas: true`): aborting requests remote cancellation of
315
- * the Image Service import; see `CreateSandboxImageOptions.signal`.
326
+ * CAS images only: aborting requests remote cancellation of the CAS image
327
+ * import; see `CreateSandboxImageOptions.signal`.
316
328
  */
317
329
  signal?: AbortSignal;
318
330
  /**
@@ -415,8 +427,12 @@ interface NativeBinding {
415
427
  listSandboxImages(options: NativeBindingCatalogOptions): Promise<string>;
416
428
  /** JSON record of one image by name or id, or null when unknown. */
417
429
  findSandboxImage(options: NativeBindingCatalogOptions, reference: string): Promise<string | null>;
418
- /** Delete one image by name or id; unknown in both catalogs rejects. */
419
- deleteSandboxImage(options: NativeBindingCatalogOptions, reference: string): Promise<void>;
430
+ /**
431
+ * Delete one image by name or id; a name is deleted from both catalogs.
432
+ * Unknown in both catalogs rejects. Resolves to the same-named legacy
433
+ * image a name's CAS delete could not remove, or null.
434
+ */
435
+ deleteSandboxImage(options: NativeBindingCatalogOptions, reference: string): Promise<NativeLegacyCleanupFailure | null | undefined>;
420
436
  }
421
437
  /** Test seam: replace the native binding with a stub. */
422
438
  declare function __setNativeBindingForTest(binding: NativeBinding | undefined): void;
@@ -431,9 +447,9 @@ interface BuildContext {
431
447
  }
432
448
  declare function buildContextFromEnv(): BuildContext;
433
449
  /**
434
- * @internal Shared with `image-builds.ts`, which implements the Image
435
- * Service build operations on top of the same native binding and
436
- * environment context.
450
+ * @internal Shared with `image-builds.ts`, which implements the CAS image
451
+ * build operations on top of the same native binding and environment
452
+ * context.
437
453
  */
438
454
  declare const __imageBuildInternals: {
439
455
  loadNativeBinding: () => NativeBinding;
@@ -444,6 +460,11 @@ declare const __imageBuildInternals: {
444
460
  imageRequiresContext: (image: Image) => boolean;
445
461
  defaultRegisteredName: (dockerfilePath: string) => string;
446
462
  defaultRegisteredNameFromImage: (reference: string) => string;
463
+ registeredImageName: (explicit: string | undefined, generated: string | undefined, cas: boolean, fallback?: string) => string;
464
+ casImageNameFrom: (raw: string, fallback: string) => string;
465
+ canonicalCasImageName: (name: string) => string;
466
+ isAddressableCasImageName: (name: string) => boolean;
467
+ defaultImportedImageName: string;
447
468
  };
448
469
  declare function createSandboxImage(source: SandboxImageSource, options?: CreateSandboxImageOptions, deps?: CreateSandboxImageDeps): Promise<Record<string, unknown>>;
449
470
  /**
@@ -466,47 +487,73 @@ interface SandboxImageCatalogCredentials {
466
487
  projectId?: string;
467
488
  }
468
489
  /**
469
- * Delete a registered sandbox image by name or id. Both families are
470
- * covered: an `image_` id or a name registered in the Image Service deletes
471
- * a CAS image, a `sandbox_template_` id or a name registered only in the
472
- * platform registry deletes a legacy image. Rejects when neither catalog
473
- * knows the reference.
490
+ * Delete a registered CAS or legacy sandbox image by name or id. Both
491
+ * families are covered: an `image_` id or a name registered in the CAS image
492
+ * registry deletes a CAS image, a `sandbox_template_` id or a name registered
493
+ * only in the legacy image registry deletes a legacy image. Rejects when
494
+ * neither the CAS nor the legacy image registry knows the reference.
495
+ *
496
+ * A name is deleted from both the CAS and the legacy image registries: once
497
+ * its CAS image is deleted, a legacy image of the same name can no longer
498
+ * start sandboxes, so it is deleted too. CAS image names ignore case
499
+ * (`MyProject` deletes the CAS image `myproject`), legacy image names match
500
+ * exactly. Failing to delete that legacy image
501
+ * does not reject, since the CAS image is already gone: a `console.warn`
502
+ * names the legacy image, the error and the call that deletes it. An
503
+ * `image_` or `sandbox_template_` id deletes only the image it names.
474
504
  *
475
- * Deleting removes a *published* image. An unfinished CAS build is cancelled
476
- * with `cancelImageBuild({ buildId })` (or `tl sbx image build cancel
477
- * BUILD_ID`), never by deleting its name: a name whose only state is an
478
- * unfinished first build has no image, so the Image Service answers 404 and
479
- * the lookup falls through to the platform registry as usual. A 202
480
- * (deletion in progress) counts as success; a 409 `image_build_in_progress`,
481
- * a 5xx or a transport failure rejects as is and never falls through.
505
+ * Deleting removes a *published* image. An unfinished CAS image build is
506
+ * cancelled with `cancelImageBuild({ buildId })` (or `tl sbx image build
507
+ * cancel BUILD_ID`), never by deleting its name: a name whose only state is
508
+ * an unfinished first build has no CAS image, so the CAS image registry
509
+ * answers 404 and the lookup falls through to the legacy image registry as
510
+ * usual. A 202 (deletion in progress) counts as success; a 409
511
+ * `image_build_in_progress`, a 5xx or a transport failure rejects as is and
512
+ * never falls through.
482
513
  *
483
514
  * Accepted merged-catalog differences from the released SDKs, for legacy
484
- * images: this deletes the platform-api template itself (the released SDKs
485
- * only removed the engine registration and left the template listed), and
486
- * an unknown name rejects instead of succeeding silently.
515
+ * images: this removes the legacy image from the legacy image registry (the
516
+ * released SDKs only made it unusable and left it listed), and an unknown
517
+ * name rejects instead of succeeding silently.
487
518
  */
488
519
  declare function deleteSandboxImage(imageName: string): Promise<void>;
489
520
  /** @internal `APIClient.deleteSandboxImage` with the client's credentials. */
490
521
  declare function deleteSandboxImageWithCredentials(credentials: SandboxImageCatalogCredentials, imageName: string): Promise<void>;
491
522
  /**
492
- * Look up a registered sandbox image by its registered name or id.
523
+ * The same-named legacy image a name's CAS delete could not remove. Its name
524
+ * is the deleted CAS image's name, in the CAS image registry's lowercase
525
+ * spelling.
526
+ */
527
+ interface NativeLegacyCleanupFailure {
528
+ legacyImageName: string;
529
+ legacyImageId?: string | null;
530
+ error: string;
531
+ }
532
+ /**
533
+ * Look up a registered CAS or legacy sandbox image by its registered name or
534
+ * id.
493
535
  *
494
536
  * Returns the image in the sandbox-template shape (CAS images carry
495
537
  * `snapshotFormatVersion === "content_addressed_streaming_v1"`; the shape is
496
- * derived from the Image Service's trimmed record, so no content digest or
497
- * build provenance rides on it), or `null` if neither the Image Service nor
498
- * the platform registry knows the reference. Uses the same environment-based Tensorlake
499
- * auth as `createSandboxImage`. Ingress derives project scope from the API key.
538
+ * derived from the CAS image registry's trimmed record, so no content digest
539
+ * or build provenance rides on it), or `null` if neither the CAS nor the
540
+ * legacy image registry knows the reference. Uses the same environment-based
541
+ * Tensorlake auth as `createSandboxImage`. Ingress derives project scope from
542
+ * the API key.
500
543
  *
501
- * An `image_` id names the *current* image under its name; a rebuild
544
+ * An `image_` id names the *current* CAS image under its name; a rebuild
502
545
  * replaces it. A build's own immutable result is read with `getImageBuild`.
503
546
  *
547
+ * A name is looked up in the CAS image registry in lowercase, as the
548
+ * registry stores it, and in the legacy image registry exactly as given.
549
+ *
504
550
  * Accepted merged-catalog difference from the released SDKs, for legacy
505
- * images: a name that fits the Image Service grammar is looked up there first
506
- * and only a clean 404 falls through to the platform registry, so Image
507
- * Service unavailability (or a deploy 5xx) rejects the lookup of a legacy name
508
- * where the released SDKs touched only platform-api. A `sandbox_template_` id
509
- * never consults the Image Service.
551
+ * images: a name that fits the CAS image registry's grammar is looked up
552
+ * there first and only a clean 404 falls through to the legacy image
553
+ * registry, so CAS image registry unavailability (or a deploy 5xx) rejects
554
+ * the lookup of a legacy image name where the released SDKs touched only the
555
+ * legacy image registry. A `sandbox_template_` id never consults the CAS
556
+ * image registry.
510
557
  */
511
558
  declare function findSandboxImageByName(imageName: string): Promise<SandboxTemplate | null>;
512
559
  /** @internal `CloudClient.findSandboxImageByName` with the client's credentials. */