tensorlake 0.4.42 → 0.4.43

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
@@ -1,5 +1,5 @@
1
- import { C as CreatePtySessionOptions, S as SandboxOptions, R as RunOptions, a as CommandResult, b as StartProcessOptions, P as ProcessInfo, c as SendSignalResponse, O as OutputResponse, d as OutputEvent, L as ListDirectoryResponse, e as PtySessionInfo, H as HealthResponse, D as DaemonInfo, f as SandboxClientOptions, g as CreateSandboxOptions, h as CreateSandboxResponse, i as SandboxInfo, U as UpdateSandboxOptions, j as SandboxPortAccess, k as CreateSnapshotResponse, l as SnapshotInfo, m as SnapshotAndWaitOptions, n as CreatePoolOptions, o as CreateSandboxPoolResponse, p as SandboxPoolInfo, q as UpdatePoolOptions, r as CreateAndConnectOptions } from './sandbox-image-DKPhc4Lv.cjs';
2
- export { s as ContainerResourcesInfo, t as ContainerState, u as CreateSandboxImageOptions, v as DirectoryEntry, w as DockerfileBuildPlan, x as DockerfileInstruction, I as Image, y as ImageBuildOperation, z as ImageBuildOperationType, z as ImageBuildOperationTypeValue, A as ImageOptions, N as NetworkConfig, B as OutputMode, E as PoolContainerInfo, F as ProcessStatus, G as SandboxImageSource, J as SandboxStatus, K as SnapshotStatus, M as StdinMode, Q as createSandboxImage, T as dockerfileContent } from './sandbox-image-DKPhc4Lv.cjs';
1
+ import { C as CreatePtySessionOptions, S as SandboxOptions, R as RunOptions, a as CommandResult, b as StartProcessOptions, P as ProcessInfo, c as SendSignalResponse, O as OutputResponse, d as OutputEvent, L as ListDirectoryResponse, e as PtySessionInfo, H as HealthResponse, D as DaemonInfo, f as SandboxClientOptions, g as CreateSandboxOptions, h as CreateSandboxResponse, i as SandboxInfo, U as UpdateSandboxOptions, j as SandboxPortAccess, k as SnapshotOptions, l as CreateSnapshotResponse, m as SnapshotInfo, n as SnapshotAndWaitOptions, o as CreatePoolOptions, p as CreateSandboxPoolResponse, q as SandboxPoolInfo, r as UpdatePoolOptions, s as CreateAndConnectOptions } from './sandbox-image-Dr9SQaCc.cjs';
2
+ export { t as ContainerResourcesInfo, u as ContainerState, v as CreateSandboxImageOptions, w as DirectoryEntry, x as DockerfileBuildPlan, y as DockerfileInstruction, I as Image, z as ImageBuildOperation, A as ImageBuildOperationType, A as ImageBuildOperationTypeValue, B as ImageOptions, N as NetworkConfig, E as OutputMode, F as PoolContainerInfo, G as ProcessStatus, J as SandboxImageSource, K as SandboxStatus, M as SnapshotContentMode, Q as SnapshotStatus, T as StdinMode, V as createSandboxImage, W as dockerfileContent } from './sandbox-image-Dr9SQaCc.cjs';
3
3
 
4
4
  type PtyDataHandler = (data: Uint8Array) => void;
5
5
  type PtyExitHandler = (exitCode: number) => void;
@@ -136,7 +136,7 @@ declare class SandboxClient {
136
136
  suspend(sandboxId: string): Promise<void>;
137
137
  resume(sandboxId: string): Promise<void>;
138
138
  claim(poolId: string): Promise<CreateSandboxResponse>;
139
- snapshot(sandboxId: string): Promise<CreateSnapshotResponse>;
139
+ snapshot(sandboxId: string, options?: SnapshotOptions): Promise<CreateSnapshotResponse>;
140
140
  getSnapshot(snapshotId: string): Promise<SnapshotInfo>;
141
141
  listSnapshots(): Promise<SnapshotInfo[]>;
142
142
  deleteSnapshot(snapshotId: string): Promise<void>;
@@ -395,4 +395,4 @@ declare class RequestExecutionError extends Error {
395
395
  constructor(message: string, functionName?: string);
396
396
  }
397
397
 
398
- export { APIClient, type ApiKeyIntrospection, type ApplicationBuildContext, type ApplicationBuildImageResult, type ApplicationBuildResponse, type ApplicationManifest, type ApplicationSummary, type BinaryPayload, type BuildInfo, type BuildLogEntry, CloudClient, type CloudClientOptions, CommandResult, CreateAndConnectOptions, type CreateApplicationBuildImageRequest, type CreateApplicationBuildRequest, CreatePoolOptions, type CreatePtyOptions, CreatePtySessionOptions, CreateSandboxOptions, CreateSandboxPoolResponse, CreateSandboxResponse, CreateSnapshotResponse, DaemonInfo, HealthResponse, ListDirectoryResponse, type NewSecret, OutputEvent, OutputResponse, PoolInUseError, PoolNotFoundError, ProcessInfo, Pty, type PtyConnectionOptions, type PtyDataHandler, type PtyExitHandler, PtySessionInfo, RemoteAPIError, type RequestErrorInfo, RequestExecutionError, RequestFailedError, type RequestInput, type RequestMetadata, RequestNotFinishedError, type RequestOutput, RunOptions, Sandbox, SandboxClient, SandboxClientOptions, SandboxConnectionError, SandboxError, SandboxException, SandboxInfo, SandboxNotFoundError, SandboxOptions, SandboxPoolInfo, SandboxPortAccess, type Secret, type SecretsList, type SecretsPagination, SendSignalResponse, SnapshotAndWaitOptions, SnapshotInfo, type StartImageBuildRequest, StartProcessOptions, UpdatePoolOptions, type UpsertSecretResponse };
398
+ export { APIClient, type ApiKeyIntrospection, type ApplicationBuildContext, type ApplicationBuildImageResult, type ApplicationBuildResponse, type ApplicationManifest, type ApplicationSummary, type BinaryPayload, type BuildInfo, type BuildLogEntry, CloudClient, type CloudClientOptions, CommandResult, CreateAndConnectOptions, type CreateApplicationBuildImageRequest, type CreateApplicationBuildRequest, CreatePoolOptions, type CreatePtyOptions, CreatePtySessionOptions, CreateSandboxOptions, CreateSandboxPoolResponse, CreateSandboxResponse, CreateSnapshotResponse, DaemonInfo, HealthResponse, ListDirectoryResponse, type NewSecret, OutputEvent, OutputResponse, PoolInUseError, PoolNotFoundError, ProcessInfo, Pty, type PtyConnectionOptions, type PtyDataHandler, type PtyExitHandler, PtySessionInfo, RemoteAPIError, type RequestErrorInfo, RequestExecutionError, RequestFailedError, type RequestInput, type RequestMetadata, RequestNotFinishedError, type RequestOutput, RunOptions, Sandbox, SandboxClient, SandboxClientOptions, SandboxConnectionError, SandboxError, SandboxException, SandboxInfo, SandboxNotFoundError, SandboxOptions, SandboxPoolInfo, SandboxPortAccess, type Secret, type SecretsList, type SecretsPagination, SendSignalResponse, SnapshotAndWaitOptions, SnapshotInfo, SnapshotOptions, type StartImageBuildRequest, StartProcessOptions, UpdatePoolOptions, type UpsertSecretResponse };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CreatePtySessionOptions, S as SandboxOptions, R as RunOptions, a as CommandResult, b as StartProcessOptions, P as ProcessInfo, c as SendSignalResponse, O as OutputResponse, d as OutputEvent, L as ListDirectoryResponse, e as PtySessionInfo, H as HealthResponse, D as DaemonInfo, f as SandboxClientOptions, g as CreateSandboxOptions, h as CreateSandboxResponse, i as SandboxInfo, U as UpdateSandboxOptions, j as SandboxPortAccess, k as CreateSnapshotResponse, l as SnapshotInfo, m as SnapshotAndWaitOptions, n as CreatePoolOptions, o as CreateSandboxPoolResponse, p as SandboxPoolInfo, q as UpdatePoolOptions, r as CreateAndConnectOptions } from './sandbox-image-DKPhc4Lv.js';
2
- export { s as ContainerResourcesInfo, t as ContainerState, u as CreateSandboxImageOptions, v as DirectoryEntry, w as DockerfileBuildPlan, x as DockerfileInstruction, I as Image, y as ImageBuildOperation, z as ImageBuildOperationType, z as ImageBuildOperationTypeValue, A as ImageOptions, N as NetworkConfig, B as OutputMode, E as PoolContainerInfo, F as ProcessStatus, G as SandboxImageSource, J as SandboxStatus, K as SnapshotStatus, M as StdinMode, Q as createSandboxImage, T as dockerfileContent } from './sandbox-image-DKPhc4Lv.js';
1
+ import { C as CreatePtySessionOptions, S as SandboxOptions, R as RunOptions, a as CommandResult, b as StartProcessOptions, P as ProcessInfo, c as SendSignalResponse, O as OutputResponse, d as OutputEvent, L as ListDirectoryResponse, e as PtySessionInfo, H as HealthResponse, D as DaemonInfo, f as SandboxClientOptions, g as CreateSandboxOptions, h as CreateSandboxResponse, i as SandboxInfo, U as UpdateSandboxOptions, j as SandboxPortAccess, k as SnapshotOptions, l as CreateSnapshotResponse, m as SnapshotInfo, n as SnapshotAndWaitOptions, o as CreatePoolOptions, p as CreateSandboxPoolResponse, q as SandboxPoolInfo, r as UpdatePoolOptions, s as CreateAndConnectOptions } from './sandbox-image-Dr9SQaCc.js';
2
+ export { t as ContainerResourcesInfo, u as ContainerState, v as CreateSandboxImageOptions, w as DirectoryEntry, x as DockerfileBuildPlan, y as DockerfileInstruction, I as Image, z as ImageBuildOperation, A as ImageBuildOperationType, A as ImageBuildOperationTypeValue, B as ImageOptions, N as NetworkConfig, E as OutputMode, F as PoolContainerInfo, G as ProcessStatus, J as SandboxImageSource, K as SandboxStatus, M as SnapshotContentMode, Q as SnapshotStatus, T as StdinMode, V as createSandboxImage, W as dockerfileContent } from './sandbox-image-Dr9SQaCc.js';
3
3
 
4
4
  type PtyDataHandler = (data: Uint8Array) => void;
5
5
  type PtyExitHandler = (exitCode: number) => void;
@@ -136,7 +136,7 @@ declare class SandboxClient {
136
136
  suspend(sandboxId: string): Promise<void>;
137
137
  resume(sandboxId: string): Promise<void>;
138
138
  claim(poolId: string): Promise<CreateSandboxResponse>;
139
- snapshot(sandboxId: string): Promise<CreateSnapshotResponse>;
139
+ snapshot(sandboxId: string, options?: SnapshotOptions): Promise<CreateSnapshotResponse>;
140
140
  getSnapshot(snapshotId: string): Promise<SnapshotInfo>;
141
141
  listSnapshots(): Promise<SnapshotInfo[]>;
142
142
  deleteSnapshot(snapshotId: string): Promise<void>;
@@ -395,4 +395,4 @@ declare class RequestExecutionError extends Error {
395
395
  constructor(message: string, functionName?: string);
396
396
  }
397
397
 
398
- export { APIClient, type ApiKeyIntrospection, type ApplicationBuildContext, type ApplicationBuildImageResult, type ApplicationBuildResponse, type ApplicationManifest, type ApplicationSummary, type BinaryPayload, type BuildInfo, type BuildLogEntry, CloudClient, type CloudClientOptions, CommandResult, CreateAndConnectOptions, type CreateApplicationBuildImageRequest, type CreateApplicationBuildRequest, CreatePoolOptions, type CreatePtyOptions, CreatePtySessionOptions, CreateSandboxOptions, CreateSandboxPoolResponse, CreateSandboxResponse, CreateSnapshotResponse, DaemonInfo, HealthResponse, ListDirectoryResponse, type NewSecret, OutputEvent, OutputResponse, PoolInUseError, PoolNotFoundError, ProcessInfo, Pty, type PtyConnectionOptions, type PtyDataHandler, type PtyExitHandler, PtySessionInfo, RemoteAPIError, type RequestErrorInfo, RequestExecutionError, RequestFailedError, type RequestInput, type RequestMetadata, RequestNotFinishedError, type RequestOutput, RunOptions, Sandbox, SandboxClient, SandboxClientOptions, SandboxConnectionError, SandboxError, SandboxException, SandboxInfo, SandboxNotFoundError, SandboxOptions, SandboxPoolInfo, SandboxPortAccess, type Secret, type SecretsList, type SecretsPagination, SendSignalResponse, SnapshotAndWaitOptions, SnapshotInfo, type StartImageBuildRequest, StartProcessOptions, UpdatePoolOptions, type UpsertSecretResponse };
398
+ export { APIClient, type ApiKeyIntrospection, type ApplicationBuildContext, type ApplicationBuildImageResult, type ApplicationBuildResponse, type ApplicationManifest, type ApplicationSummary, type BinaryPayload, type BuildInfo, type BuildLogEntry, CloudClient, type CloudClientOptions, CommandResult, CreateAndConnectOptions, type CreateApplicationBuildImageRequest, type CreateApplicationBuildRequest, CreatePoolOptions, type CreatePtyOptions, CreatePtySessionOptions, CreateSandboxOptions, CreateSandboxPoolResponse, CreateSandboxResponse, CreateSnapshotResponse, DaemonInfo, HealthResponse, ListDirectoryResponse, type NewSecret, OutputEvent, OutputResponse, PoolInUseError, PoolNotFoundError, ProcessInfo, Pty, type PtyConnectionOptions, type PtyDataHandler, type PtyExitHandler, PtySessionInfo, RemoteAPIError, type RequestErrorInfo, RequestExecutionError, RequestFailedError, type RequestInput, type RequestMetadata, RequestNotFinishedError, type RequestOutput, RunOptions, Sandbox, SandboxClient, SandboxClientOptions, SandboxConnectionError, SandboxError, SandboxException, SandboxInfo, SandboxNotFoundError, SandboxOptions, SandboxPoolInfo, SandboxPortAccess, type Secret, type SecretsList, type SecretsPagination, SendSignalResponse, SnapshotAndWaitOptions, SnapshotInfo, SnapshotOptions, type StartImageBuildRequest, StartProcessOptions, UpdatePoolOptions, type UpsertSecretResponse };
package/dist/index.js CHANGED
@@ -1149,10 +1149,12 @@ var SandboxClient = class _SandboxClient {
1149
1149
  return fromSnakeKeys(raw, "sandboxId");
1150
1150
  }
1151
1151
  // --- Snapshots ---
1152
- async snapshot(sandboxId) {
1152
+ async snapshot(sandboxId, options) {
1153
+ const requestOptions = options?.contentMode != null ? { body: { snapshot_content_mode: options.contentMode } } : void 0;
1153
1154
  const raw = await this.http.requestJson(
1154
1155
  "POST",
1155
- this.path(`sandboxes/${sandboxId}/snapshot`)
1156
+ this.path(`sandboxes/${sandboxId}/snapshot`),
1157
+ requestOptions
1156
1158
  );
1157
1159
  return fromSnakeKeys(raw, "snapshotId");
1158
1160
  }
@@ -1181,7 +1183,9 @@ var SandboxClient = class _SandboxClient {
1181
1183
  async snapshotAndWait(sandboxId, options) {
1182
1184
  const timeout = options?.timeout ?? 300;
1183
1185
  const pollInterval = options?.pollInterval ?? 1;
1184
- const result = await this.snapshot(sandboxId);
1186
+ const result = await this.snapshot(sandboxId, {
1187
+ contentMode: options?.contentMode
1188
+ });
1185
1189
  const deadline = Date.now() + timeout * 1e3;
1186
1190
  while (Date.now() < deadline) {
1187
1191
  const info = await this.getSnapshot(result.snapshotId);
@@ -2502,7 +2506,9 @@ async function createSandboxImage(source, options = {}, deps = {}) {
2502
2506
  });
2503
2507
  await executeDockerfilePlan(sandbox, plan, emit, sleep4);
2504
2508
  emit({ type: "status", message: "Creating snapshot..." });
2505
- const snapshot = await client.snapshotAndWait(sandbox.sandboxId);
2509
+ const snapshot = await client.snapshotAndWait(sandbox.sandboxId, {
2510
+ contentMode: "filesystem_only"
2511
+ });
2506
2512
  emit({
2507
2513
  type: "snapshot_created",
2508
2514
  snapshot_id: snapshot.snapshotId,