@tensorlakeai/tensorlake 0.5.152 → 0.5.153

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 +3515 -3394
  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 +3470 -3349
  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 +1270 -782
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +311 -21
  14. package/dist/index.d.ts +311 -21
  15. package/dist/index.js +1248 -773
  16. package/dist/index.js.map +1 -1
  17. package/dist/{remote-CC48cvYP.d.cts → remote-B3vn4tt1.d.cts} +1 -1
  18. package/dist/{remote-BbSrvgUn.d.ts → remote-DqBUuciu.d.ts} +1 -1
  19. package/dist/{sandbox-image-CAK_K7ND.d.cts → sandbox-image-BMiFlzAs.d.cts} +168 -13
  20. package/dist/{sandbox-image-CAK_K7ND.d.ts → sandbox-image-BMiFlzAs.d.ts} +168 -13
  21. package/dist/sandbox-image.cjs +339 -1300
  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 +338 -1299
  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
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- import { C as CloudClientOptions, A as ApplicationManifest, B as BinaryPayload, S as SandboxTemplate, a as ApplicationSummary, R as RequestInput, c as RequestMetadata, b as RequestOutput, d as SecretsList, e as Secret, N as NewSecret, U as UpsertSecretResponse, f as StartImageBuildRequest, g as BuildInfo, h as CreateApplicationBuildRequest, i as ApplicationBuildContext, j as ApplicationBuildResponse, k as BuildLogEntry, F as FileSystem } from './sandbox-image-CAK_K7ND.cjs';
2
- export { l as ApplicationBuildImageResult, m as CreateApplicationBuildImageRequest, n as CreateSandboxImageOptions, I as Image, o as ImageBuildOperation, p as ImageBuildOperationType, p as ImageBuildOperationTypeValue, q as ImageOptions, r as ImportSandboxImageOptions, s as RequestErrorInfo, t as SandboxImageSource, u as SecretsPagination, v as createSandboxImage, w as deleteSandboxImage, x as dockerfileContent, y as findSandboxImageByName, z as importSandboxImage, D as listSandboxImages } from './sandbox-image-CAK_K7ND.cjs';
3
- export { v as APIClient, A as ApplicationCapability, a as ApplicationOptions, F as File, b as FunctionOptions, c as Future, H as Headers, d as HeadersInit, e as HttpBody, P as Parameter, g as RegisteredFunction, h as RemoteOptions, j as RequestContext, S as Schema, l as SimpleApplicationOptions, m as SimpleFunctionOptions, T as TailCall, r as registerApplication, o as registerFunction, p as remoteOptions, q as retries, s as runLocal, t as runRemote, u as schema } from './remote-CC48cvYP.cjs';
1
+ import { C as CloudClientOptions, A as ApplicationManifest, B as BinaryPayload, S as SandboxTemplate, a as ApplicationSummary, R as RequestInput, c as RequestMetadata, b as RequestOutput, d as SecretsList, e as Secret, N as NewSecret, U as UpsertSecretResponse, f as StartImageBuildRequest, g as BuildInfo, h as CreateApplicationBuildRequest, i as ApplicationBuildContext, j as ApplicationBuildResponse, k as BuildLogEntry, I as Image, l as CreateSandboxImageDeps, F as FileSystem } from './sandbox-image-BMiFlzAs.cjs';
2
+ export { m as ApplicationBuildImageResult, n as CreateApplicationBuildImageRequest, o as CreateSandboxImageOptions, p as ImageBuildOperation, q as ImageBuildOperationType, q as ImageBuildOperationTypeValue, r as ImageOptions, s as ImportSandboxImageOptions, t as RequestErrorInfo, u as SandboxImageSource, v as SecretsPagination, w as createSandboxImage, x as deleteSandboxImage, y as dockerfileContent, z as findSandboxImageByName, D as importSandboxImage, E as listSandboxImages } from './sandbox-image-BMiFlzAs.cjs';
3
+ export { v as APIClient, A as ApplicationCapability, a as ApplicationOptions, F as File, b as FunctionOptions, c as Future, H as Headers, d as HeadersInit, e as HttpBody, P as Parameter, g as RegisteredFunction, h as RemoteOptions, j as RequestContext, S as Schema, l as SimpleApplicationOptions, m as SimpleFunctionOptions, T as TailCall, r as registerApplication, o as registerFunction, p as remoteOptions, q as retries, s as runLocal, t as runRemote, u as schema } from './remote-B3vn4tt1.cjs';
4
4
 
5
5
  /** An SDK result paired with its server-side W3C trace ID. */
6
6
  type Traced<T> = T & {
@@ -179,7 +179,9 @@ declare enum SnapshotStatus {
179
179
  IN_PROGRESS = "in_progress",
180
180
  LOCAL_READY = "local_ready",
181
181
  COMPLETED = "completed",
182
- FAILED = "failed"
182
+ FAILED = "failed",
183
+ DELETING = "deleting",
184
+ REPLICATING = "replicating"
183
185
  }
184
186
  /**
185
187
  * Snapshot type for sandbox snapshot creation.
@@ -466,6 +468,11 @@ interface CopySandboxResponse {
466
468
  sandboxes: CopiedSandboxResponse[];
467
469
  }
468
470
  interface SandboxInfo {
471
+ /**
472
+ * The runtime the server chose for this sandbox: `firecracker`,
473
+ * `cloud-hypervisor` or `gvisor`. Informational only; it is never sent and
474
+ * is `firecracker` when the server recorded none.
475
+ */
469
476
  runtime?: string;
470
477
  resourceResize?: SandboxResourceResizeInfo | null;
471
478
  sandboxId: string;
@@ -1211,9 +1218,8 @@ declare class Sandbox {
1211
1218
  *
1212
1219
  * Resource targets use create's cpus, memoryMb, and diskMb names. Resize
1213
1220
  * waits by default; wait=false returns admission. Timeout does not cancel it.
1214
- * CPU-only CAS sandboxes support CPU, memory, and root-disk resize; GPU CAS sandboxes
1215
- * support only root-disk growth and reject CPU and memory changes.
1216
- * Non-CAS sandboxes do not support live resize.
1221
+ * Which runtimes and dimensions support a live resize is decided by the
1222
+ * server, whose policy error is thrown unchanged.
1217
1223
  * Wait, timeout, and pollInterval are ignored on non-resource updates.
1218
1224
  * A no-op returns current resources with absent or earlier resize metadata.
1219
1225
  *
@@ -1536,9 +1542,9 @@ declare class SandboxClient {
1536
1542
  /** List sandbox processes available as persisted-log filters. */
1537
1543
  listLogProcesses(sandboxId: string): Promise<Traced<SandboxProcessLogFiltersResponse>>;
1538
1544
  /**
1539
- * Update properties or resize a running sandbox. CPU-only CAS sandboxes support
1540
- * CPU, memory, and root-disk resize; GPU CAS sandboxes support only root-disk
1541
- * growth. Non-CAS sandboxes do not support live resize.
1545
+ * Update properties or resize a running sandbox. Which runtimes and
1546
+ * dimensions support a live resize is decided by the server, whose policy
1547
+ * error is thrown unchanged.
1542
1548
  * Resource names match create. Resize waits by default; wait=false returns
1543
1549
  * admission. Timeout leaves the resize running and reports its generation.
1544
1550
  * Wait, timeout, and pollInterval are ignored on non-resource updates.
@@ -1671,6 +1677,8 @@ declare class SandboxClient {
1671
1677
 
1672
1678
  declare class CloudClient {
1673
1679
  private readonly transport;
1680
+ private readonly apiUrl;
1681
+ private readonly apiKey?;
1674
1682
  private readonly organizationId?;
1675
1683
  private readonly projectId?;
1676
1684
  private readonly namespace;
@@ -1679,28 +1687,39 @@ declare class CloudClient {
1679
1687
  close(): void;
1680
1688
  upsertApplication(manifest: ApplicationManifest, codeZip: BinaryPayload, upgradeRunningRequests?: boolean): Promise<void>;
1681
1689
  deleteApplication(applicationName: string): Promise<void>;
1690
+ /**
1691
+ * Delete a registered sandbox image by name or id through the merged
1692
+ * catalog, with this client's credentials: an `image_` id or a name the
1693
+ * Image Service knows deletes a CAS image, a `sandbox_template_` id or a
1694
+ * name registered only in the platform registry deletes a legacy image.
1695
+ * Rejects when neither catalog knows the reference. The same semantics
1696
+ * and accepted differences as the module-level `deleteSandboxImage`.
1697
+ */
1682
1698
  deleteSandboxImage(imageName: string): Promise<void>;
1683
1699
  /**
1684
- * Look up a registered sandbox image (template) by its registered name.
1685
- *
1686
- * Returns the template, or `null` when no image with that name exists.
1687
- * API-key clients may omit organization/project IDs and use the
1688
- * token-scoped Platform API route directly. Explicit scope remains
1689
- * available for PAT callers.
1700
+ * Look up a registered sandbox image by name or id through the merged
1701
+ * catalog, with this client's credentials. Returns the image in the
1702
+ * sandbox-template shape, or `null` when neither the Image Service nor the
1703
+ * platform registry knows the reference. An explicit organization/project
1704
+ * scope (the client's, or the call's override) addresses that project's
1705
+ * routes directly, as before; without one the key's own scope applies.
1690
1706
  */
1691
1707
  findSandboxImageByName(imageName: string, options?: {
1692
1708
  organizationId?: string;
1693
1709
  projectId?: string;
1694
1710
  }): Promise<SandboxTemplate | null>;
1695
1711
  /**
1696
- * List all registered sandbox images (templates), following pagination to
1697
- * the end. API-key clients may omit organization/project IDs and use the
1698
- * token-scoped Platform API route directly.
1712
+ * List every registered sandbox image of the project (CAS and legacy, in
1713
+ * the sandbox-template shape, newest first) through the merged catalog,
1714
+ * with this client's credentials. An explicit organization/project scope
1715
+ * (the client's, or the call's override) addresses that project's routes
1716
+ * directly, as before; without one the key's own scope applies.
1699
1717
  */
1700
1718
  listSandboxImages(options?: {
1701
1719
  organizationId?: string;
1702
1720
  projectId?: string;
1703
1721
  }): Promise<SandboxTemplate[]>;
1722
+ private catalogCredentials;
1704
1723
  applications(): Promise<ApplicationSummary[]>;
1705
1724
  applicationManifest(applicationName: string): Promise<ApplicationManifest>;
1706
1725
  runRequest(applicationName: string, inputs?: RequestInput[]): Promise<string>;
@@ -1735,7 +1754,6 @@ declare class CloudClient {
1735
1754
  private runMultipartRequest;
1736
1755
  private namespacePath;
1737
1756
  private existingApplicationPublicEndpointId;
1738
- private platformProjectPath;
1739
1757
  private secretCollectionPath;
1740
1758
  }
1741
1759
 
@@ -2017,6 +2035,278 @@ declare class RepositoryClient {
2017
2035
  private tracedJson;
2018
2036
  }
2019
2037
 
2038
+ /**
2039
+ * Image Service build operations for CAS sandbox images.
2040
+ *
2041
+ * A CAS (content-addressed streaming) image is built or imported by an Image
2042
+ * Service *build operation*. This module exposes that operation directly:
2043
+ * {@link startImageBuild} / {@link startImageImport} admit a build (and upload
2044
+ * and seal its context) and return an {@link ImageBuildHandle} without
2045
+ * waiting; {@link getImageBuild} looks a build up by id; the handle's
2046
+ * `refresh`, `wait` and `cancel` read, wait for and cancel it.
2047
+ *
2048
+ * **CAS only.** Everything here addresses the Image Service. Legacy images
2049
+ * (`createSandboxImage` without `cas`, `sandbox_template_` ids, `.tlsnap`
2050
+ * snapshots) have no build operation: a `sandbox_template_` or `image_`
2051
+ * reference passed as a build id is refused locally, before any request, and
2052
+ * the legacy functions in `sandbox-image.ts` keep their own requests,
2053
+ * results, errors and interruption behavior.
2054
+ *
2055
+ * **Build ids are the immutable record.** An image name and its `image_` id
2056
+ * name the *current* image; a rebuild replaces what they point at. A build id
2057
+ * and its result never change, so `wait` returns this build's own result even
2058
+ * after the image was rebuilt or deleted.
2059
+ *
2060
+ * **Cancellation by build id is sufficient.** Admission returns it, the CLI
2061
+ * prints it, and the `image_build_in_progress` conflict names it as
2062
+ * `activeBuildId`. The client request id (the admission's `Idempotency-Key`)
2063
+ * is kept on the handle only as a recovery aid for a lost admission answer.
2064
+ *
2065
+ * **AbortSignal versus timeout.** An `AbortSignal` passed to the new APIs (and
2066
+ * to `createSandboxImage`/`importSandboxImage` with `cas: true`) *requests
2067
+ * remote cancellation*: the Rust core runs a bounded (30 s) handshake and the
2068
+ * promise rejects with {@link ImageBuildInterruptedError} carrying the
2069
+ * outcome. A wait `timeoutMs` merely stops waiting: it rejects with
2070
+ * {@link ImageBuildTimeoutError} and leaves the build running. Abandoning a
2071
+ * promise, losing the process or dropping a handle never cancels the build.
2072
+ */
2073
+ /** Structured payload the native binding attaches to image-build failures. */
2074
+ interface ImageBuildErrorDetails {
2075
+ code: string;
2076
+ message: string;
2077
+ buildId?: string | null;
2078
+ clientRequestId?: string | null;
2079
+ imageName?: string | null;
2080
+ activeBuildId?: string | null;
2081
+ activeKind?: string | null;
2082
+ activeStatus?: string | null;
2083
+ error?: string | null;
2084
+ info?: Record<string, unknown> | null;
2085
+ outcome?: string | null;
2086
+ confirmed?: boolean | null;
2087
+ result?: Record<string, unknown> | null;
2088
+ waitedSecs?: number | null;
2089
+ status?: number | null;
2090
+ }
2091
+ /** An Image Service build operation failed. `code` is stable. */
2092
+ declare class ImageBuildError extends Error {
2093
+ readonly code: string;
2094
+ readonly buildId?: string;
2095
+ readonly clientRequestId?: string;
2096
+ readonly details: ImageBuildErrorDetails;
2097
+ constructor(details: ImageBuildErrorDetails);
2098
+ }
2099
+ /**
2100
+ * No such build is visible to the project: unknown, foreign or retired. A
2101
+ * finished build is kept only while it is its image's current build; a later
2102
+ * build of the image or deleting the image retires it.
2103
+ */
2104
+ declare class ImageBuildNotFoundError extends ImageBuildError {
2105
+ constructor(details: ImageBuildErrorDetails);
2106
+ }
2107
+ /**
2108
+ * The image name already has an unfinished build or import. Cancel
2109
+ * `activeBuildId` before starting another; the SDK never does so itself.
2110
+ */
2111
+ declare class ImageBuildInProgressError extends ImageBuildError {
2112
+ readonly imageName?: string;
2113
+ readonly activeBuildId?: string;
2114
+ readonly activeKind?: string;
2115
+ readonly activeStatus?: string;
2116
+ constructor(details: ImageBuildErrorDetails);
2117
+ }
2118
+ /** The service reports the build failed; `error` is its message. */
2119
+ declare class ImageBuildFailedError extends ImageBuildError {
2120
+ readonly error: string;
2121
+ readonly info?: ImageBuildInfo;
2122
+ constructor(details: ImageBuildErrorDetails);
2123
+ }
2124
+ /** The service reports the build was cancelled (a distinct outcome). */
2125
+ declare class ImageBuildCancelledError extends ImageBuildError {
2126
+ readonly info?: ImageBuildInfo;
2127
+ constructor(details: ImageBuildErrorDetails);
2128
+ }
2129
+ /** The caller stopped waiting. The build may still be running. */
2130
+ declare class ImageBuildTimeoutError extends ImageBuildError {
2131
+ constructor(details: ImageBuildErrorDetails);
2132
+ }
2133
+ /**
2134
+ * An `AbortSignal` ran the cancellation handshake. `outcome` is `cancelled`,
2135
+ * `already_completed`, `already_cancelled`, `already_failed`, `not_admitted`
2136
+ * or `unconfirmed`; `confirmed` is true only when the remote build is known
2137
+ * not to publish. `not_admitted` is an observation, not a cancellation.
2138
+ */
2139
+ declare class ImageBuildInterruptedError extends ImageBuildError {
2140
+ readonly outcome: string;
2141
+ readonly confirmed: boolean;
2142
+ readonly result?: Record<string, unknown>;
2143
+ constructor(details: ImageBuildErrorDetails);
2144
+ }
2145
+ type ImageBuildStatus = "pending" | "running" | "succeeded" | "failed" | "cancelled" | string;
2146
+ type ImageBuildPhase = "awaiting_context" | "starting_builder" | "executing" | "snapshotting" | "publishing" | "finished" | string;
2147
+ /**
2148
+ * The published image of a succeeded build, in the sandbox-template shape
2149
+ * the merged catalog answers (derived by the core from the Image Service's
2150
+ * trimmed record): one image representation for `findSandboxImageByName`,
2151
+ * `listSandboxImages` and build results.
2152
+ */
2153
+ type ImageBuildResult = SandboxTemplate;
2154
+ /**
2155
+ * One build or import as the Image Service reports it (the twelve-field
2156
+ * `BuildInfo`; the service exposes no cleanup state, phase deadline,
2157
+ * content digest or upload capability on a build).
2158
+ */
2159
+ interface ImageBuildInfo {
2160
+ buildId: string;
2161
+ clientRequestId?: string | null;
2162
+ kind: string;
2163
+ name?: string | null;
2164
+ status: ImageBuildStatus;
2165
+ phase?: ImageBuildPhase | null;
2166
+ attemptNo: number;
2167
+ builderSandboxId?: string | null;
2168
+ error?: string | null;
2169
+ result?: ImageBuildResult | null;
2170
+ operationDeadlineMs?: number | null;
2171
+ createdAtMs?: number | null;
2172
+ updatedAtMs?: number | null;
2173
+ /** The service record as received, snake_case, with unknown fields. */
2174
+ raw: Record<string, unknown>;
2175
+ }
2176
+ /**
2177
+ * The service's answer to a cancellation. `outcome` is `cancelled`
2178
+ * (durable), `already_cancelled`, `already_completed` (publication won),
2179
+ * `already_failed` or `not_admitted` (nothing indexed under the client
2180
+ * request id: not a cancellation and no promise about a delayed admission).
2181
+ */
2182
+ interface CancelImageBuildOutcome {
2183
+ outcome: string;
2184
+ build: ImageBuildInfo | null;
2185
+ /** Whether the build is known not to publish. */
2186
+ confirmed: boolean;
2187
+ }
2188
+ interface ImageBuildEvent {
2189
+ type: string;
2190
+ message?: string;
2191
+ stream?: string;
2192
+ build_id?: string;
2193
+ client_request_id?: string | null;
2194
+ status?: string;
2195
+ phase?: string | null;
2196
+ attempt?: number;
2197
+ outcome?: string;
2198
+ confirmed?: boolean;
2199
+ [key: string]: unknown;
2200
+ }
2201
+ interface ImageBuildWaitOptions {
2202
+ /**
2203
+ * Caller bound in milliseconds on top of the service-informed deadline.
2204
+ * Expiry rejects with {@link ImageBuildTimeoutError} and leaves the build
2205
+ * running; it does not cancel.
2206
+ */
2207
+ timeoutMs?: number;
2208
+ /** Stream `tl-image-builder` output as `build_log` events. */
2209
+ followLogs?: boolean;
2210
+ /** Requests remote cancellation (bounded handshake), unlike `timeoutMs`. */
2211
+ signal?: AbortSignal;
2212
+ /**
2213
+ * Event callback. A throwing callback is recorded and rethrown once the
2214
+ * native call returns; it does not cancel the build.
2215
+ */
2216
+ emit?: (event: ImageBuildEvent) => void;
2217
+ verbose?: boolean;
2218
+ }
2219
+ interface Credentials {
2220
+ apiUrl: string;
2221
+ bearerToken: string;
2222
+ namespace: string;
2223
+ }
2224
+ /**
2225
+ * One admitted CAS build. Holds the build identity and the caller's
2226
+ * credentials; creating or dropping it performs no network I/O.
2227
+ */
2228
+ declare class ImageBuildHandle {
2229
+ #private;
2230
+ readonly buildId: string;
2231
+ /**
2232
+ * The admission's request id, when this handle started the build. Never
2233
+ * needed to cancel; a recovery aid for a lost admission answer.
2234
+ */
2235
+ readonly clientRequestId: string | null;
2236
+ /** @internal */
2237
+ constructor(info: ImageBuildInfo, credentials: Credentials, clientRequestId?: string | null);
2238
+ /** The last observed state. */
2239
+ get info(): ImageBuildInfo;
2240
+ /** Re-read the current state. */
2241
+ refresh(): Promise<ImageBuildInfo>;
2242
+ /**
2243
+ * Wait for publication and return this build's immutable result. See
2244
+ * {@link ImageBuildWaitOptions} for the timeout/abort distinction.
2245
+ */
2246
+ wait(options?: ImageBuildWaitOptions): Promise<ImageBuildResult>;
2247
+ /** Cancel this build by its id (the sufficient selector). */
2248
+ cancel(): Promise<CancelImageBuildOutcome>;
2249
+ }
2250
+ interface StartImageBuildOptions {
2251
+ registeredName?: string;
2252
+ cpus?: number;
2253
+ memoryMb?: number;
2254
+ diskMb?: number;
2255
+ isPublic?: boolean;
2256
+ contextDir?: string;
2257
+ buildArgs?: Record<string, string>;
2258
+ dockerConfigJson?: string;
2259
+ /** Requests remote cancellation of the admission/upload in progress. */
2260
+ signal?: AbortSignal;
2261
+ emit?: (event: ImageBuildEvent) => void;
2262
+ verbose?: boolean;
2263
+ }
2264
+ interface StartImageImportOptions {
2265
+ registeredName?: string;
2266
+ cpus?: number;
2267
+ memoryMb?: number;
2268
+ diskMb?: number;
2269
+ isPublic?: boolean;
2270
+ dockerConfigJson?: string;
2271
+ signal?: AbortSignal;
2272
+ emit?: (event: ImageBuildEvent) => void;
2273
+ verbose?: boolean;
2274
+ }
2275
+ /**
2276
+ * Admit a CAS image build and return without waiting. Parses the source like
2277
+ * `createSandboxImage` with `cas: true`, admits under a fresh client request
2278
+ * id, uploads and seals the context, and returns a handle whose `wait`
2279
+ * finishes the operation. The build keeps running if this process exits.
2280
+ */
2281
+ declare function startImageBuild(source: string | Image, options?: StartImageBuildOptions, deps?: CreateSandboxImageDeps): Promise<ImageBuildHandle>;
2282
+ /** Admit a CAS registry import and return without waiting. */
2283
+ declare function startImageImport(imageReference: string, options?: StartImageImportOptions, deps?: CreateSandboxImageDeps): Promise<ImageBuildHandle>;
2284
+ /**
2285
+ * Look a build up by its service-generated id. Unknown and foreign builds
2286
+ * reject with {@link ImageBuildNotFoundError}; a legacy `sandbox_template_`
2287
+ * or an `image_` reference is refused before any request.
2288
+ */
2289
+ declare function getImageBuild(buildId: string): Promise<ImageBuildHandle>;
2290
+ /**
2291
+ * `getImageBuild(buildId)` then `wait(options)`, as one interruptible
2292
+ * operation: the lookup runs inside the native wait, under the same
2293
+ * `AbortSignal` and `timeoutMs`, so an abort during a slow or stalled first
2294
+ * request still cancels the build by its id.
2295
+ */
2296
+ declare function waitImageBuild(buildId: string, options?: ImageBuildWaitOptions): Promise<ImageBuildResult>;
2297
+ interface CancelImageBuildSelector {
2298
+ /** The sufficient, documented selector. */
2299
+ buildId?: string;
2300
+ /**
2301
+ * Only to recover an admission whose response was lost. Its `not_admitted`
2302
+ * outcome is an observation of absence, not a cancellation, and does not
2303
+ * prevent a delayed admission (cancel again by request id then).
2304
+ */
2305
+ clientRequestId?: string;
2306
+ }
2307
+ /** Cancel a build. Exactly one selector; the build id alone is sufficient. */
2308
+ declare function cancelImageBuild(selector: CancelImageBuildSelector): Promise<CancelImageBuildOutcome>;
2309
+
2020
2310
  /**
2021
2311
  * Compatibility helpers for Artifact Storage filesystems.
2022
2312
  *
@@ -2462,4 +2752,4 @@ declare class RequestExecutionError extends Error {
2462
2752
  constructor(message: string, functionName?: string);
2463
2753
  }
2464
2754
 
2465
- export { ApplicationBuildContext, ApplicationBuildResponse, ApplicationManifest, ApplicationSummary, type ArchivedSandboxInfo, type AttachFileSystemOptions, BinaryPayload, type Branch, BuildInfo, BuildLogEntry, type CheckpointOptions, type CheckpointType, type ClaimSandboxOptions, CliNotFoundError, CloudClient, CloudClientOptions, CommandExitReason, type CommandResult, type CommitJobError, type CommitJobReadBack, type CommitJobStatus, type ConflictPath, type ConflictTerm, type ConnectDesktopOptions, type ConnectOptions, type ContainerResourcesInfo, ContainerState, type CopiedSandboxResponse, type CopySandboxOptions, type CopySandboxResponse, type CreateAndConnectOptions, CreateApplicationBuildRequest, type CreatePoolOptions, type CreatePtyOptions, type CreatePtySessionOptions, type CreateSandboxOptions, type CreateSandboxPoolResponse, type CreateSandboxResponse, type CreateSnapshotResponse, type CreateTunnelOptions, type DaemonInfo, Desktop, type DesktopDoubleClickOptions, type DesktopPointerOptions, type DirectoryEntry, type FileEntry, FileNotFoundInFilesystemError, FileSystem, type FileSystemMount, Filesystem, FilesystemAPIError, FilesystemClient, type FilesystemClientOptions, FilesystemError, type FilesystemFileRead, type FilesystemInfo, FilesystemMount, FilesystemNotFoundError, type FilesystemReadOptions, type FilesystemSnapshot, type FilesystemSnapshotInfo, type FilesystemStatus, type FilesystemVersion, type GPUResources, type GetOrCreateOptions, type GetOrCreateOutcome, type GetSandboxLogsOptions, type GitCredential, type GitRef, type GitRepository, type GpuModel, type GpuRequest, type HealthResponse, type ListArchivedSandboxesOptions, type ListArchivedSandboxesResponse, type ListDirectoryResponse, type ManagedProcessExit, type ManagedProcessHealthStatus, type ManagedProcessInfo, type ManagedProcessStatus, type MergeConflict, type MergeConflictRecord, type MergeEntry, type MergeOptions, type MergeReport, type MergeStats, MountError, type MountStatus, type MouseButton, type NetworkConfig, NewSecret, type Operation, type OperationRef, type OutputEvent, OutputMode, type OutputResponse, PendingSandbox, type PendingSandboxRecord, type PoolContainerInfo, PoolInUseError, PoolNotFoundError, type ProcessHealthCheck, type ProcessHealthCheckType, type ProcessInfo, ProcessStatus, type ProcessUser, type ProcessUserSpec, Pty, type PtyConnectionOptions, type PtyDataHandler, type PtyExitHandler, type PtySessionInfo, type PushReport, type PushWorktreeOptions, ReadOnlyMountNotSupportedError, type ReadyOptions, RemoteAPIError, RepositoryClient, type RepositoryClientOptions, type RepositoryHandle, type RepositoryInfo, RepositoryMount, type RepositoryMountOptions, type RepositoryMountStatus, type RepositoryUnmountOptions, RequestExecutionError, RequestFailedError, RequestInput, RequestMetadata, RequestNotFinishedError, RequestOutput, ResizeErrorReason, ResizeStatus, type ResourceResizeWaitOptions, type RestartPolicy, type RestartPolicyConfig, type RunOptions, Sandbox, SandboxClient, type SandboxClientOptions, SandboxConnectionError, SandboxError, SandboxException, type SandboxInfo, type SandboxLogLevel, type SandboxLogSignal, type SandboxLogsResponse, SandboxNotFoundError, type SandboxOptions, SandboxPending, SandboxPendingReason, type SandboxPoolInfo, type SandboxPortAccess, type SandboxProcessLogFilter, type SandboxProcessLogFiltersResponse, SandboxResizeError, type SandboxResourceResizeInfo, SandboxStatus, SandboxTemplate, Secret, SecretsList, type SendSignalResponse, type SnapshotAndWaitOptions, type SnapshotInfo, type SnapshotOptions, SnapshotStatus, type SnapshotType, type SnapshotWaitCondition, StartImageBuildRequest, type StartProcessOptions, StdinMode, type SuspendResumeOptions, TERMINATION_REASON_CANCELLED, TERMINATION_REASON_NO_CAPACITY, TcpTunnel, type TunnelAddress, type UpdatePoolOptions, type UpdateSandboxOptions, UpsertSecretResponse, createFileSystem, deleteFileSystem, isSandboxPending, listFileSystems, sandboxUrlFromIngressEndpoint };
2755
+ export { ApplicationBuildContext, ApplicationBuildResponse, ApplicationManifest, ApplicationSummary, type ArchivedSandboxInfo, type AttachFileSystemOptions, BinaryPayload, type Branch, BuildInfo, BuildLogEntry, type CancelImageBuildOutcome, type CancelImageBuildSelector, type CheckpointOptions, type CheckpointType, type ClaimSandboxOptions, CliNotFoundError, CloudClient, CloudClientOptions, CommandExitReason, type CommandResult, type CommitJobError, type CommitJobReadBack, type CommitJobStatus, type ConflictPath, type ConflictTerm, type ConnectDesktopOptions, type ConnectOptions, type ContainerResourcesInfo, ContainerState, type CopiedSandboxResponse, type CopySandboxOptions, type CopySandboxResponse, type CreateAndConnectOptions, CreateApplicationBuildRequest, type CreatePoolOptions, type CreatePtyOptions, type CreatePtySessionOptions, type CreateSandboxOptions, type CreateSandboxPoolResponse, type CreateSandboxResponse, type CreateSnapshotResponse, type CreateTunnelOptions, type DaemonInfo, Desktop, type DesktopDoubleClickOptions, type DesktopPointerOptions, type DirectoryEntry, type FileEntry, FileNotFoundInFilesystemError, FileSystem, type FileSystemMount, Filesystem, FilesystemAPIError, FilesystemClient, type FilesystemClientOptions, FilesystemError, type FilesystemFileRead, type FilesystemInfo, FilesystemMount, FilesystemNotFoundError, type FilesystemReadOptions, type FilesystemSnapshot, type FilesystemSnapshotInfo, type FilesystemStatus, type FilesystemVersion, type GPUResources, type GetOrCreateOptions, type GetOrCreateOutcome, type GetSandboxLogsOptions, type GitCredential, type GitRef, type GitRepository, type GpuModel, type GpuRequest, type HealthResponse, Image, ImageBuildCancelledError, ImageBuildError, type ImageBuildErrorDetails, type ImageBuildEvent, ImageBuildFailedError, ImageBuildHandle, ImageBuildInProgressError, type ImageBuildInfo, ImageBuildInterruptedError, ImageBuildNotFoundError, type ImageBuildPhase, type ImageBuildResult, type ImageBuildStatus, ImageBuildTimeoutError, type ImageBuildWaitOptions, type ListArchivedSandboxesOptions, type ListArchivedSandboxesResponse, type ListDirectoryResponse, type ManagedProcessExit, type ManagedProcessHealthStatus, type ManagedProcessInfo, type ManagedProcessStatus, type MergeConflict, type MergeConflictRecord, type MergeEntry, type MergeOptions, type MergeReport, type MergeStats, MountError, type MountStatus, type MouseButton, type NetworkConfig, NewSecret, type Operation, type OperationRef, type OutputEvent, OutputMode, type OutputResponse, PendingSandbox, type PendingSandboxRecord, type PoolContainerInfo, PoolInUseError, PoolNotFoundError, type ProcessHealthCheck, type ProcessHealthCheckType, type ProcessInfo, ProcessStatus, type ProcessUser, type ProcessUserSpec, Pty, type PtyConnectionOptions, type PtyDataHandler, type PtyExitHandler, type PtySessionInfo, type PushReport, type PushWorktreeOptions, ReadOnlyMountNotSupportedError, type ReadyOptions, RemoteAPIError, RepositoryClient, type RepositoryClientOptions, type RepositoryHandle, type RepositoryInfo, RepositoryMount, type RepositoryMountOptions, type RepositoryMountStatus, type RepositoryUnmountOptions, RequestExecutionError, RequestFailedError, RequestInput, RequestMetadata, RequestNotFinishedError, RequestOutput, ResizeErrorReason, ResizeStatus, type ResourceResizeWaitOptions, type RestartPolicy, type RestartPolicyConfig, type RunOptions, Sandbox, SandboxClient, type SandboxClientOptions, SandboxConnectionError, SandboxError, SandboxException, type SandboxInfo, type SandboxLogLevel, type SandboxLogSignal, type SandboxLogsResponse, SandboxNotFoundError, type SandboxOptions, SandboxPending, SandboxPendingReason, type SandboxPoolInfo, type SandboxPortAccess, type SandboxProcessLogFilter, type SandboxProcessLogFiltersResponse, SandboxResizeError, type SandboxResourceResizeInfo, SandboxStatus, SandboxTemplate, Secret, SecretsList, type SendSignalResponse, type SnapshotAndWaitOptions, type SnapshotInfo, type SnapshotOptions, SnapshotStatus, type SnapshotType, type SnapshotWaitCondition, type StartImageBuildOptions, StartImageBuildRequest, type StartImageImportOptions, type StartProcessOptions, StdinMode, type SuspendResumeOptions, TERMINATION_REASON_CANCELLED, TERMINATION_REASON_NO_CAPACITY, TcpTunnel, type TunnelAddress, type UpdatePoolOptions, type UpdateSandboxOptions, UpsertSecretResponse, cancelImageBuild, createFileSystem, deleteFileSystem, getImageBuild, isSandboxPending, listFileSystems, sandboxUrlFromIngressEndpoint, startImageBuild, startImageImport, waitImageBuild };