Skip to content

FileStorage

Defined in: src/session/file-storage.ts:16

File-based implementation of SnapshotStorage for persisting session snapshots

new FileStorage(baseDir): FileStorage;

Defined in: src/session/file-storage.ts:24

Creates new FileStorage instance

ParameterTypeDescription
baseDirstringBase directory path for storing snapshots

FileStorage

saveSnapshot(params): Promise<void>;

Defined in: src/session/file-storage.ts:41

Saves snapshot to file, optionally marking as latest

ParameterType
params{ location: SnapshotLocation; snapshotId: string; isLatest: boolean; snapshot: Snapshot; }
params.locationSnapshotLocation
params.snapshotIdstring
params.isLatestboolean
params.snapshotSnapshot

Promise<void>

SnapshotStorage.saveSnapshot


loadSnapshot(params): Promise<Snapshot>;

Defined in: src/session/file-storage.ts:57

Loads snapshot by ID or latest if null

ParameterType
params{ location: SnapshotLocation; snapshotId?: string; }
params.locationSnapshotLocation
params.snapshotId?string

Promise<Snapshot>

SnapshotStorage.loadSnapshot


listSnapshotIds(params): Promise<string[]>;

Defined in: src/session/file-storage.ts:86

Lists all snapshot IDs for a session scope.

TODO: Add pagination support for long-running agents with many snapshots. Future signature could be:

listSnapshots(params: {
sessionId: string
scope: Scope
limit?: number // Max results to return (e.g., 100)
startAfter?: string // Snapshot ID to start after (for cursor-based pagination)
}): Promise<{ snapshotIds: string[]; nextToken?: string }>
ParameterType
params{ location: SnapshotLocation; }
params.locationSnapshotLocation

Promise<string[]>

SnapshotStorage.listSnapshotIds


loadManifest(params): Promise<SnapshotManifest>;

Defined in: src/session/file-storage.ts:106

Loads manifest or returns default if not found

ParameterType
params{ location: SnapshotLocation; }
params.locationSnapshotLocation

Promise<SnapshotManifest>

SnapshotStorage.loadManifest


saveManifest(params): Promise<void>;

Defined in: src/session/file-storage.ts:121

Saves manifest to file

ParameterType
params{ location: SnapshotLocation; manifest: SnapshotManifest; }
params.locationSnapshotLocation
params.manifestSnapshotManifest

Promise<void>

SnapshotStorage.saveManifest