tensorlake 0.5.85 → 0.5.89

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
@@ -40,6 +40,8 @@ interface TracedJson {
40
40
  interface TracedBytes {
41
41
  traceId: string;
42
42
  data: Buffer;
43
+ contentId?: string;
44
+ fullSize?: number;
43
45
  }
44
46
  interface TracedEvents {
45
47
  traceId: string;
@@ -122,16 +124,30 @@ interface NativeRepositoryClient {
122
124
  mergeRepo(repo: string, ours: string, theirs: string, preflight: boolean, deep: boolean, materialize: boolean, message?: string | null, base?: string | null): Promise<TracedJson>;
123
125
  commitConflicts(repo: string, commit: string): Promise<TracedJson>;
124
126
  createFilesystem(name: string): Promise<string>;
127
+ forkFilesystem(name: string, base: string, snapshot?: string | null): Promise<TracedJson>;
125
128
  listFilesystems(): Promise<TracedJson>;
126
129
  filesystemMeta(name: string): Promise<TracedJson>;
127
130
  deleteFilesystem(name: string): Promise<string>;
128
131
  filesystemRefStatus(name: string, refspec: string): Promise<TracedJson>;
129
- readFilesystemFile(name: string, path: string, version: string): Promise<TracedBytes>;
132
+ retainFilesystemSnapshot(name: string, message: string, requestId: string): Promise<TracedJson>;
133
+ listFilesystemSnapshots(name: string): Promise<TracedJson>;
134
+ deleteFilesystemSnapshot(name: string, snapshot: string): Promise<string>;
135
+ readFilesystemFile(name: string, path: string, version: string, offset?: number, length?: number): Promise<TracedBytes>;
130
136
  listFilesystemTree(name: string, dirPath: string, version: string): Promise<TracedJson>;
131
137
  pushFilesystemFiles(name: string, files: Array<{
132
138
  path: string;
133
139
  content: Buffer;
134
- }>, deletes: string[], message: string, branch: string, idempotencyKey?: string | null): Promise<TracedJson>;
140
+ }>, deletes: string[], moves: Array<{
141
+ from: string;
142
+ to: string;
143
+ }>, copies: Array<{
144
+ from: string;
145
+ to: string;
146
+ }>, message: string, branch: string, idempotencyKey?: string | null): Promise<TracedJson>;
147
+ pushFilesystemPaths(name: string, files: Array<{
148
+ path: string;
149
+ localPath: string;
150
+ }>, message: string, branch: string, idempotencyKey?: string | null): Promise<TracedJson>;
135
151
  }
136
152
 
137
153
  declare enum SandboxStatus {
@@ -1474,7 +1490,6 @@ declare function deleteFileSystem(fileSystemId: string): Promise<void>;
1474
1490
  interface FilesystemInfo {
1475
1491
  name: string;
1476
1492
  fullName: string;
1477
- defaultBranch: string;
1478
1493
  status: string;
1479
1494
  kind: string;
1480
1495
  }
@@ -1482,13 +1497,12 @@ interface FilesystemInfo {
1482
1497
  interface FilesystemStatus {
1483
1498
  name: string;
1484
1499
  status: string;
1485
- defaultBranch: string;
1486
1500
  /**
1487
- * Commit hash the default branch currently points at; null for an empty
1488
- * filesystem that has never been written to.
1501
+ * Current native version id; null for an empty filesystem that has never
1502
+ * been written to.
1489
1503
  */
1490
- headCommit: string | null;
1491
- /** Server-side movement counter for the default branch, when reported. */
1504
+ versionId: string | null;
1505
+ /** Server-side movement counter for the live version, when reported. */
1492
1506
  generation: number | null;
1493
1507
  }
1494
1508
  /** One directory entry from a filesystem listing. */
@@ -1496,26 +1510,55 @@ interface FileEntry {
1496
1510
  name: string;
1497
1511
  /** Path of the entry relative to the filesystem root. */
1498
1512
  path: string;
1499
- /** Git blob/tree object id. */
1500
- oid: string;
1501
- /** Raw git mode (0o100644 file, 0o100755 executable, 0o120000 symlink, 0o40000 dir). */
1502
- mode: number;
1513
+ /** Stable native content identity for the file or directory. */
1514
+ contentId: string;
1515
+ /** Native entry kind. */
1516
+ kind: "file" | "directory" | "symlink";
1517
+ /** Whether a regular file is executable. */
1518
+ executable: boolean;
1503
1519
  /** Blob size in bytes when cheaply known server-side. */
1504
1520
  size: number | null;
1505
1521
  isDir: boolean;
1506
1522
  isSymlink: boolean;
1507
1523
  }
1508
- /** A durable version of the filesystem (a commit). */
1509
- interface Snapshot {
1510
- /** Commit hash — pass as `version` to read the filesystem at this point. */
1511
- commit: string;
1512
- tree: string;
1513
- refName: string;
1514
- parent: string | null;
1524
+ /** Bytes plus immutable identity/size returned by one file request. */
1525
+ interface FilesystemFileRead {
1526
+ data: Uint8Array;
1527
+ /** Stable native identity for the complete file content. */
1528
+ contentId: string;
1529
+ /** Size of the complete file, even when `data` is a requested range. */
1530
+ size: number;
1531
+ }
1532
+ interface FilesystemReadOptions {
1533
+ /** Current `main` head when omitted; otherwise one retained snapshot id. */
1534
+ version?: string;
1535
+ /** Half-open byte selection expressed as offset + length. */
1536
+ range?: {
1537
+ offset: number;
1538
+ length: number;
1539
+ };
1540
+ }
1541
+ /** The durable live version produced by one atomic filesystem publication. */
1542
+ interface FilesystemVersion {
1543
+ /** Native version id — pass as `version` to read the filesystem at this point. */
1544
+ versionId: string;
1545
+ /** Version replaced by this publication, or null for the first publication. */
1546
+ previousVersionId: string | null;
1515
1547
  /** False when the write was a no-op (content identical to the parent). */
1516
1548
  created: boolean;
1517
1549
  message: string;
1518
1550
  }
1551
+ /** One newly retained native filesystem snapshot. */
1552
+ interface FilesystemSnapshot {
1553
+ id: string;
1554
+ message: string;
1555
+ }
1556
+ /** One explicitly retained native filesystem snapshot. */
1557
+ interface FilesystemSnapshotInfo {
1558
+ id: string;
1559
+ createdAt: Date;
1560
+ message: string;
1561
+ }
1519
1562
  /**
1520
1563
  * Status of a local mount as reported by `tl fs status --json`.
1521
1564
  *
@@ -1559,13 +1602,14 @@ declare class CliNotFoundError extends MountError {
1559
1602
  * Client for Tensorlake filesystems.
1560
1603
  *
1561
1604
  * A filesystem is a durable, versioned file tree that lives in Tensorlake
1562
- * Cloud. Every write produces a {@link Snapshot} (a durable version), files
1563
- * can be read at any version, and a filesystem can be mounted to a local
1564
- * path through the `tl` CLI's FUSE/FSKit daemon.
1605
+ * Cloud. Every write publishes a durable live version; {@link Filesystem.snapshot}
1606
+ * retains the current version permanently. Files can be read at any retained
1607
+ * version, and a filesystem can be mounted to a local path through the `tl`
1608
+ * CLI's FUSE/FSKit daemon.
1565
1609
  *
1566
- * Reads and writes are served by the shared Rust cloud-sdk core (the same
1567
- * engine behind the `tl` CLI), so uploads get content-defined chunking,
1568
- * dedup, transient retries, and idempotent commit reattachment for free.
1610
+ * Server-side SDK writes hash complete files locally, upload missing bytes
1611
+ * directly to checksum-bound object-store targets, and atomically publish
1612
+ * one durable snapshot. Payload bytes never transit the API service.
1569
1613
  *
1570
1614
  * @example
1571
1615
  * const client = new FilesystemClient(); // env-based auth
@@ -1618,6 +1662,11 @@ declare class FilesystemClient {
1618
1662
  constructor(options?: FilesystemClientOptions);
1619
1663
  /** Create a new filesystem and return a handle to it. */
1620
1664
  create(name: string): Promise<Filesystem>;
1665
+ /**
1666
+ * Fork a filesystem at its live head or an explicit retained snapshot.
1667
+ * The server shares immutable content and publishes only metadata.
1668
+ */
1669
+ fork(name: string, baseFilesystem: string, snapshot?: string): Promise<Filesystem>;
1621
1670
  /** Return a handle to an existing filesystem (verifies it exists). */
1622
1671
  get(name: string): Promise<Filesystem>;
1623
1672
  /** List all filesystems in the project. */
@@ -1652,28 +1701,59 @@ declare class Filesystem {
1652
1701
  */
1653
1702
  private branch;
1654
1703
  /** Write one file. Returns the snapshot (version) the write produced. */
1655
- writeFile(path: string, data: FileData, message?: string): Promise<Snapshot>;
1704
+ writeFile(path: string, data: FileData, message?: string): Promise<FilesystemVersion>;
1656
1705
  /** Write several files (and/or delete paths) in one atomic snapshot. */
1657
- writeFiles(files: Map<string, FileData> | Record<string, FileData>, message?: string, deletes?: string[]): Promise<Snapshot>;
1658
- /** Delete one file. Returns the snapshot the deletion produced. */
1659
- deleteFile(path: string, message?: string): Promise<Snapshot>;
1706
+ writeFiles(files: Map<string, FileData> | Record<string, FileData>, message?: string, deletes?: string[]): Promise<FilesystemVersion>;
1707
+ /**
1708
+ * Stream one local file directly to object storage in bounded parts.
1709
+ * This is the memory-bounded API for multi-GiB files.
1710
+ */
1711
+ writeFileFromPath(path: string, localPath: string, message?: string): Promise<FilesystemVersion>;
1712
+ /**
1713
+ * Atomically publish local files without loading their complete payloads
1714
+ * into JavaScript or Rust memory.
1715
+ */
1716
+ writeFilesFromPaths(files: Map<string, string> | Record<string, string>, message?: string): Promise<FilesystemVersion>;
1717
+ /**
1718
+ * Move a file or directory without downloading or re-uploading its bytes.
1719
+ * The source removal and destination creation publish as one atomic snapshot.
1720
+ */
1721
+ moveFile(from: string, to: string, message?: string): Promise<FilesystemVersion>;
1722
+ /**
1723
+ * Copy a file or directory by reusing immutable content references. No
1724
+ * payload bytes traverse the client, API server, or object store.
1725
+ */
1726
+ copyFile(from: string, to: string, message?: string): Promise<FilesystemVersion>;
1727
+ private publishChanges;
1728
+ /** Delete one file. Returns the durable version the deletion produced. */
1729
+ deleteFile(path: string, message?: string): Promise<FilesystemVersion>;
1660
1730
  /**
1661
1731
  * Return the filesystem's current version as a snapshot.
1662
1732
  *
1663
- * Writes already create snapshots implicitly; this pins the current head
1664
- * without changing any content.
1733
+ * Writes publish durable live versions. This retains the current head
1734
+ * permanently in one metadata-only server operation without changing or
1735
+ * copying any content.
1665
1736
  */
1666
- snapshot(message?: string): Promise<Snapshot>;
1737
+ snapshot(message?: string): Promise<FilesystemSnapshot>;
1738
+ /** List explicitly retained snapshots without reading filesystem contents. */
1739
+ listSnapshots(): Promise<FilesystemSnapshotInfo[]>;
1740
+ /** Delete one permanent retention point; shared/head-reachable bytes remain. */
1741
+ deleteSnapshot(snapshot: string): Promise<void>;
1667
1742
  /**
1668
- * Read a file's bytes at `version` (branch, ref, or snapshot commit;
1669
- * defaults to the filesystem's default branch).
1743
+ * Read a file's bytes at `version` (the current `main` head or a retained
1744
+ * snapshot id; defaults to the filesystem's current head).
1670
1745
  */
1671
1746
  readFile(path: string, version?: string): Promise<Uint8Array>;
1747
+ /**
1748
+ * Read bytes and immutable metadata in one request. A range is executed by
1749
+ * Artifact Storage, so callers never download the unrequested remainder.
1750
+ */
1751
+ readFileWithMetadata(path: string, options?: FilesystemReadOptions): Promise<FilesystemFileRead>;
1672
1752
  /** Read a file as UTF-8 text at `version`. Throws on non-UTF-8 content. */
1673
1753
  readText(path: string, version?: string): Promise<string>;
1674
1754
  /** List one directory (non-recursive) at `version`. */
1675
1755
  listFiles(dirPath?: string, version?: string): Promise<FileEntry[]>;
1676
- /** Remote status: identity plus the current head snapshot. */
1756
+ /** Remote status: identity plus the current native version. */
1677
1757
  status(): Promise<FilesystemStatus>;
1678
1758
  /** Mount this filesystem to a local path (requires the `tl` CLI). */
1679
1759
  mount(localPath: string, readonly?: boolean): Promise<FilesystemMount>;
@@ -1764,4 +1844,4 @@ declare class RequestExecutionError extends Error {
1764
1844
  constructor(message: string, functionName?: string);
1765
1845
  }
1766
1846
 
1767
- export { APIClient, ApiKeyIntrospection, ApplicationBuildContext, ApplicationBuildResponse, ApplicationManifest, ApplicationSummary, type ArchivedSandboxInfo, BinaryPayload, type Branch, BuildInfo, BuildLogEntry, type CheckpointOptions, type CheckpointType, CliNotFoundError, CloudClient, CloudClientOptions, 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 FilesystemInfo, FilesystemMount, FilesystemNotFoundError, type FilesystemStatus, type GPUResources, type GetSandboxLogsOptions, type GitCredential, type GitRef, type GitRepository, 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, 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, RemoteAPIError, RepositoryClient, type RepositoryClientOptions, type RepositoryHandle, type RepositoryInfo, RequestExecutionError, RequestFailedError, RequestInput, RequestMetadata, RequestNotFinishedError, RequestOutput, type RestartPolicy, type RestartPolicyConfig, type RunOptions, Sandbox, SandboxClient, type SandboxClientOptions, SandboxConnectionError, SandboxError, SandboxException, type SandboxInfo, type SandboxLogLevel, type SandboxLogSignal, type SandboxLogsResponse, SandboxNotFoundError, type SandboxOptions, type SandboxPoolInfo, type SandboxPortAccess, type SandboxProcessLogFilter, type SandboxProcessLogFiltersResponse, SandboxStatus, SandboxTemplate, Secret, SecretsList, type SendSignalResponse, type Snapshot, type SnapshotAndWaitOptions, type SnapshotInfo, type SnapshotOptions, SnapshotStatus, type SnapshotType, type SnapshotWaitCondition, StartImageBuildRequest, type StartProcessOptions, StdinMode, type SuspendResumeOptions, TcpTunnel, type TunnelAddress, type UpdatePoolOptions, UpsertSecretResponse, createFileSystem, deleteFileSystem, listFileSystems, sandboxUrlFromIngressEndpoint };
1847
+ export { APIClient, ApiKeyIntrospection, ApplicationBuildContext, ApplicationBuildResponse, ApplicationManifest, ApplicationSummary, type ArchivedSandboxInfo, BinaryPayload, type Branch, BuildInfo, BuildLogEntry, type CheckpointOptions, type CheckpointType, CliNotFoundError, CloudClient, CloudClientOptions, 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 GetSandboxLogsOptions, type GitCredential, type GitRef, type GitRepository, 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, 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, RemoteAPIError, RepositoryClient, type RepositoryClientOptions, type RepositoryHandle, type RepositoryInfo, RequestExecutionError, RequestFailedError, RequestInput, RequestMetadata, RequestNotFinishedError, RequestOutput, type RestartPolicy, type RestartPolicyConfig, type RunOptions, Sandbox, SandboxClient, type SandboxClientOptions, SandboxConnectionError, SandboxError, SandboxException, type SandboxInfo, type SandboxLogLevel, type SandboxLogSignal, type SandboxLogsResponse, SandboxNotFoundError, type SandboxOptions, type SandboxPoolInfo, type SandboxPortAccess, type SandboxProcessLogFilter, type SandboxProcessLogFiltersResponse, SandboxStatus, SandboxTemplate, Secret, SecretsList, type SendSignalResponse, type SnapshotAndWaitOptions, type SnapshotInfo, type SnapshotOptions, SnapshotStatus, type SnapshotType, type SnapshotWaitCondition, StartImageBuildRequest, type StartProcessOptions, StdinMode, type SuspendResumeOptions, TcpTunnel, type TunnelAddress, type UpdatePoolOptions, UpsertSecretResponse, createFileSystem, deleteFileSystem, listFileSystems, sandboxUrlFromIngressEndpoint };
package/dist/index.d.ts CHANGED
@@ -40,6 +40,8 @@ interface TracedJson {
40
40
  interface TracedBytes {
41
41
  traceId: string;
42
42
  data: Buffer;
43
+ contentId?: string;
44
+ fullSize?: number;
43
45
  }
44
46
  interface TracedEvents {
45
47
  traceId: string;
@@ -122,16 +124,30 @@ interface NativeRepositoryClient {
122
124
  mergeRepo(repo: string, ours: string, theirs: string, preflight: boolean, deep: boolean, materialize: boolean, message?: string | null, base?: string | null): Promise<TracedJson>;
123
125
  commitConflicts(repo: string, commit: string): Promise<TracedJson>;
124
126
  createFilesystem(name: string): Promise<string>;
127
+ forkFilesystem(name: string, base: string, snapshot?: string | null): Promise<TracedJson>;
125
128
  listFilesystems(): Promise<TracedJson>;
126
129
  filesystemMeta(name: string): Promise<TracedJson>;
127
130
  deleteFilesystem(name: string): Promise<string>;
128
131
  filesystemRefStatus(name: string, refspec: string): Promise<TracedJson>;
129
- readFilesystemFile(name: string, path: string, version: string): Promise<TracedBytes>;
132
+ retainFilesystemSnapshot(name: string, message: string, requestId: string): Promise<TracedJson>;
133
+ listFilesystemSnapshots(name: string): Promise<TracedJson>;
134
+ deleteFilesystemSnapshot(name: string, snapshot: string): Promise<string>;
135
+ readFilesystemFile(name: string, path: string, version: string, offset?: number, length?: number): Promise<TracedBytes>;
130
136
  listFilesystemTree(name: string, dirPath: string, version: string): Promise<TracedJson>;
131
137
  pushFilesystemFiles(name: string, files: Array<{
132
138
  path: string;
133
139
  content: Buffer;
134
- }>, deletes: string[], message: string, branch: string, idempotencyKey?: string | null): Promise<TracedJson>;
140
+ }>, deletes: string[], moves: Array<{
141
+ from: string;
142
+ to: string;
143
+ }>, copies: Array<{
144
+ from: string;
145
+ to: string;
146
+ }>, message: string, branch: string, idempotencyKey?: string | null): Promise<TracedJson>;
147
+ pushFilesystemPaths(name: string, files: Array<{
148
+ path: string;
149
+ localPath: string;
150
+ }>, message: string, branch: string, idempotencyKey?: string | null): Promise<TracedJson>;
135
151
  }
136
152
 
137
153
  declare enum SandboxStatus {
@@ -1474,7 +1490,6 @@ declare function deleteFileSystem(fileSystemId: string): Promise<void>;
1474
1490
  interface FilesystemInfo {
1475
1491
  name: string;
1476
1492
  fullName: string;
1477
- defaultBranch: string;
1478
1493
  status: string;
1479
1494
  kind: string;
1480
1495
  }
@@ -1482,13 +1497,12 @@ interface FilesystemInfo {
1482
1497
  interface FilesystemStatus {
1483
1498
  name: string;
1484
1499
  status: string;
1485
- defaultBranch: string;
1486
1500
  /**
1487
- * Commit hash the default branch currently points at; null for an empty
1488
- * filesystem that has never been written to.
1501
+ * Current native version id; null for an empty filesystem that has never
1502
+ * been written to.
1489
1503
  */
1490
- headCommit: string | null;
1491
- /** Server-side movement counter for the default branch, when reported. */
1504
+ versionId: string | null;
1505
+ /** Server-side movement counter for the live version, when reported. */
1492
1506
  generation: number | null;
1493
1507
  }
1494
1508
  /** One directory entry from a filesystem listing. */
@@ -1496,26 +1510,55 @@ interface FileEntry {
1496
1510
  name: string;
1497
1511
  /** Path of the entry relative to the filesystem root. */
1498
1512
  path: string;
1499
- /** Git blob/tree object id. */
1500
- oid: string;
1501
- /** Raw git mode (0o100644 file, 0o100755 executable, 0o120000 symlink, 0o40000 dir). */
1502
- mode: number;
1513
+ /** Stable native content identity for the file or directory. */
1514
+ contentId: string;
1515
+ /** Native entry kind. */
1516
+ kind: "file" | "directory" | "symlink";
1517
+ /** Whether a regular file is executable. */
1518
+ executable: boolean;
1503
1519
  /** Blob size in bytes when cheaply known server-side. */
1504
1520
  size: number | null;
1505
1521
  isDir: boolean;
1506
1522
  isSymlink: boolean;
1507
1523
  }
1508
- /** A durable version of the filesystem (a commit). */
1509
- interface Snapshot {
1510
- /** Commit hash — pass as `version` to read the filesystem at this point. */
1511
- commit: string;
1512
- tree: string;
1513
- refName: string;
1514
- parent: string | null;
1524
+ /** Bytes plus immutable identity/size returned by one file request. */
1525
+ interface FilesystemFileRead {
1526
+ data: Uint8Array;
1527
+ /** Stable native identity for the complete file content. */
1528
+ contentId: string;
1529
+ /** Size of the complete file, even when `data` is a requested range. */
1530
+ size: number;
1531
+ }
1532
+ interface FilesystemReadOptions {
1533
+ /** Current `main` head when omitted; otherwise one retained snapshot id. */
1534
+ version?: string;
1535
+ /** Half-open byte selection expressed as offset + length. */
1536
+ range?: {
1537
+ offset: number;
1538
+ length: number;
1539
+ };
1540
+ }
1541
+ /** The durable live version produced by one atomic filesystem publication. */
1542
+ interface FilesystemVersion {
1543
+ /** Native version id — pass as `version` to read the filesystem at this point. */
1544
+ versionId: string;
1545
+ /** Version replaced by this publication, or null for the first publication. */
1546
+ previousVersionId: string | null;
1515
1547
  /** False when the write was a no-op (content identical to the parent). */
1516
1548
  created: boolean;
1517
1549
  message: string;
1518
1550
  }
1551
+ /** One newly retained native filesystem snapshot. */
1552
+ interface FilesystemSnapshot {
1553
+ id: string;
1554
+ message: string;
1555
+ }
1556
+ /** One explicitly retained native filesystem snapshot. */
1557
+ interface FilesystemSnapshotInfo {
1558
+ id: string;
1559
+ createdAt: Date;
1560
+ message: string;
1561
+ }
1519
1562
  /**
1520
1563
  * Status of a local mount as reported by `tl fs status --json`.
1521
1564
  *
@@ -1559,13 +1602,14 @@ declare class CliNotFoundError extends MountError {
1559
1602
  * Client for Tensorlake filesystems.
1560
1603
  *
1561
1604
  * A filesystem is a durable, versioned file tree that lives in Tensorlake
1562
- * Cloud. Every write produces a {@link Snapshot} (a durable version), files
1563
- * can be read at any version, and a filesystem can be mounted to a local
1564
- * path through the `tl` CLI's FUSE/FSKit daemon.
1605
+ * Cloud. Every write publishes a durable live version; {@link Filesystem.snapshot}
1606
+ * retains the current version permanently. Files can be read at any retained
1607
+ * version, and a filesystem can be mounted to a local path through the `tl`
1608
+ * CLI's FUSE/FSKit daemon.
1565
1609
  *
1566
- * Reads and writes are served by the shared Rust cloud-sdk core (the same
1567
- * engine behind the `tl` CLI), so uploads get content-defined chunking,
1568
- * dedup, transient retries, and idempotent commit reattachment for free.
1610
+ * Server-side SDK writes hash complete files locally, upload missing bytes
1611
+ * directly to checksum-bound object-store targets, and atomically publish
1612
+ * one durable snapshot. Payload bytes never transit the API service.
1569
1613
  *
1570
1614
  * @example
1571
1615
  * const client = new FilesystemClient(); // env-based auth
@@ -1618,6 +1662,11 @@ declare class FilesystemClient {
1618
1662
  constructor(options?: FilesystemClientOptions);
1619
1663
  /** Create a new filesystem and return a handle to it. */
1620
1664
  create(name: string): Promise<Filesystem>;
1665
+ /**
1666
+ * Fork a filesystem at its live head or an explicit retained snapshot.
1667
+ * The server shares immutable content and publishes only metadata.
1668
+ */
1669
+ fork(name: string, baseFilesystem: string, snapshot?: string): Promise<Filesystem>;
1621
1670
  /** Return a handle to an existing filesystem (verifies it exists). */
1622
1671
  get(name: string): Promise<Filesystem>;
1623
1672
  /** List all filesystems in the project. */
@@ -1652,28 +1701,59 @@ declare class Filesystem {
1652
1701
  */
1653
1702
  private branch;
1654
1703
  /** Write one file. Returns the snapshot (version) the write produced. */
1655
- writeFile(path: string, data: FileData, message?: string): Promise<Snapshot>;
1704
+ writeFile(path: string, data: FileData, message?: string): Promise<FilesystemVersion>;
1656
1705
  /** Write several files (and/or delete paths) in one atomic snapshot. */
1657
- writeFiles(files: Map<string, FileData> | Record<string, FileData>, message?: string, deletes?: string[]): Promise<Snapshot>;
1658
- /** Delete one file. Returns the snapshot the deletion produced. */
1659
- deleteFile(path: string, message?: string): Promise<Snapshot>;
1706
+ writeFiles(files: Map<string, FileData> | Record<string, FileData>, message?: string, deletes?: string[]): Promise<FilesystemVersion>;
1707
+ /**
1708
+ * Stream one local file directly to object storage in bounded parts.
1709
+ * This is the memory-bounded API for multi-GiB files.
1710
+ */
1711
+ writeFileFromPath(path: string, localPath: string, message?: string): Promise<FilesystemVersion>;
1712
+ /**
1713
+ * Atomically publish local files without loading their complete payloads
1714
+ * into JavaScript or Rust memory.
1715
+ */
1716
+ writeFilesFromPaths(files: Map<string, string> | Record<string, string>, message?: string): Promise<FilesystemVersion>;
1717
+ /**
1718
+ * Move a file or directory without downloading or re-uploading its bytes.
1719
+ * The source removal and destination creation publish as one atomic snapshot.
1720
+ */
1721
+ moveFile(from: string, to: string, message?: string): Promise<FilesystemVersion>;
1722
+ /**
1723
+ * Copy a file or directory by reusing immutable content references. No
1724
+ * payload bytes traverse the client, API server, or object store.
1725
+ */
1726
+ copyFile(from: string, to: string, message?: string): Promise<FilesystemVersion>;
1727
+ private publishChanges;
1728
+ /** Delete one file. Returns the durable version the deletion produced. */
1729
+ deleteFile(path: string, message?: string): Promise<FilesystemVersion>;
1660
1730
  /**
1661
1731
  * Return the filesystem's current version as a snapshot.
1662
1732
  *
1663
- * Writes already create snapshots implicitly; this pins the current head
1664
- * without changing any content.
1733
+ * Writes publish durable live versions. This retains the current head
1734
+ * permanently in one metadata-only server operation without changing or
1735
+ * copying any content.
1665
1736
  */
1666
- snapshot(message?: string): Promise<Snapshot>;
1737
+ snapshot(message?: string): Promise<FilesystemSnapshot>;
1738
+ /** List explicitly retained snapshots without reading filesystem contents. */
1739
+ listSnapshots(): Promise<FilesystemSnapshotInfo[]>;
1740
+ /** Delete one permanent retention point; shared/head-reachable bytes remain. */
1741
+ deleteSnapshot(snapshot: string): Promise<void>;
1667
1742
  /**
1668
- * Read a file's bytes at `version` (branch, ref, or snapshot commit;
1669
- * defaults to the filesystem's default branch).
1743
+ * Read a file's bytes at `version` (the current `main` head or a retained
1744
+ * snapshot id; defaults to the filesystem's current head).
1670
1745
  */
1671
1746
  readFile(path: string, version?: string): Promise<Uint8Array>;
1747
+ /**
1748
+ * Read bytes and immutable metadata in one request. A range is executed by
1749
+ * Artifact Storage, so callers never download the unrequested remainder.
1750
+ */
1751
+ readFileWithMetadata(path: string, options?: FilesystemReadOptions): Promise<FilesystemFileRead>;
1672
1752
  /** Read a file as UTF-8 text at `version`. Throws on non-UTF-8 content. */
1673
1753
  readText(path: string, version?: string): Promise<string>;
1674
1754
  /** List one directory (non-recursive) at `version`. */
1675
1755
  listFiles(dirPath?: string, version?: string): Promise<FileEntry[]>;
1676
- /** Remote status: identity plus the current head snapshot. */
1756
+ /** Remote status: identity plus the current native version. */
1677
1757
  status(): Promise<FilesystemStatus>;
1678
1758
  /** Mount this filesystem to a local path (requires the `tl` CLI). */
1679
1759
  mount(localPath: string, readonly?: boolean): Promise<FilesystemMount>;
@@ -1764,4 +1844,4 @@ declare class RequestExecutionError extends Error {
1764
1844
  constructor(message: string, functionName?: string);
1765
1845
  }
1766
1846
 
1767
- export { APIClient, ApiKeyIntrospection, ApplicationBuildContext, ApplicationBuildResponse, ApplicationManifest, ApplicationSummary, type ArchivedSandboxInfo, BinaryPayload, type Branch, BuildInfo, BuildLogEntry, type CheckpointOptions, type CheckpointType, CliNotFoundError, CloudClient, CloudClientOptions, 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 FilesystemInfo, FilesystemMount, FilesystemNotFoundError, type FilesystemStatus, type GPUResources, type GetSandboxLogsOptions, type GitCredential, type GitRef, type GitRepository, 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, 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, RemoteAPIError, RepositoryClient, type RepositoryClientOptions, type RepositoryHandle, type RepositoryInfo, RequestExecutionError, RequestFailedError, RequestInput, RequestMetadata, RequestNotFinishedError, RequestOutput, type RestartPolicy, type RestartPolicyConfig, type RunOptions, Sandbox, SandboxClient, type SandboxClientOptions, SandboxConnectionError, SandboxError, SandboxException, type SandboxInfo, type SandboxLogLevel, type SandboxLogSignal, type SandboxLogsResponse, SandboxNotFoundError, type SandboxOptions, type SandboxPoolInfo, type SandboxPortAccess, type SandboxProcessLogFilter, type SandboxProcessLogFiltersResponse, SandboxStatus, SandboxTemplate, Secret, SecretsList, type SendSignalResponse, type Snapshot, type SnapshotAndWaitOptions, type SnapshotInfo, type SnapshotOptions, SnapshotStatus, type SnapshotType, type SnapshotWaitCondition, StartImageBuildRequest, type StartProcessOptions, StdinMode, type SuspendResumeOptions, TcpTunnel, type TunnelAddress, type UpdatePoolOptions, UpsertSecretResponse, createFileSystem, deleteFileSystem, listFileSystems, sandboxUrlFromIngressEndpoint };
1847
+ export { APIClient, ApiKeyIntrospection, ApplicationBuildContext, ApplicationBuildResponse, ApplicationManifest, ApplicationSummary, type ArchivedSandboxInfo, BinaryPayload, type Branch, BuildInfo, BuildLogEntry, type CheckpointOptions, type CheckpointType, CliNotFoundError, CloudClient, CloudClientOptions, 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 GetSandboxLogsOptions, type GitCredential, type GitRef, type GitRepository, 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, 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, RemoteAPIError, RepositoryClient, type RepositoryClientOptions, type RepositoryHandle, type RepositoryInfo, RequestExecutionError, RequestFailedError, RequestInput, RequestMetadata, RequestNotFinishedError, RequestOutput, type RestartPolicy, type RestartPolicyConfig, type RunOptions, Sandbox, SandboxClient, type SandboxClientOptions, SandboxConnectionError, SandboxError, SandboxException, type SandboxInfo, type SandboxLogLevel, type SandboxLogSignal, type SandboxLogsResponse, SandboxNotFoundError, type SandboxOptions, type SandboxPoolInfo, type SandboxPortAccess, type SandboxProcessLogFilter, type SandboxProcessLogFiltersResponse, SandboxStatus, SandboxTemplate, Secret, SecretsList, type SendSignalResponse, type SnapshotAndWaitOptions, type SnapshotInfo, type SnapshotOptions, SnapshotStatus, type SnapshotType, type SnapshotWaitCondition, StartImageBuildRequest, type StartProcessOptions, StdinMode, type SuspendResumeOptions, TcpTunnel, type TunnelAddress, type UpdatePoolOptions, UpsertSecretResponse, createFileSystem, deleteFileSystem, listFileSystems, sandboxUrlFromIngressEndpoint };