No JSDoc comment in source yet.
API
@Component()
export class SnapshotService implements Snapshots {
@Use() private readonly paths!: SnapshotPaths;
@Use() private readonly log!: SnapshotLog;
@Use() private readonly clock!: SnapshotClock;
async currentVersion(projectId: string, agentId: string): Promise<number>;
async importArchive(projectId: string, agentId: string, pkg: AgentPackage, opts: { preSnapshot: boolean }): Promise<{ version: number; backup?: string }>;
}Dependencies & Wiring
Extracted from class decoratorsMethods (2)
currentVersion
async currentVersion(projectId: string, agentId: string): Promise<number>Current Agent State version number (missing field treated as 1); throws 404 if the Agent doesn't exist.
@paramprojectId
string@paramagentId
string@returns
Promise<number>importArchive
async importArchive(projectId: string, agentId: string, pkg: AgentPackage, opts: { preSnapshot: boolean }): Promise<{ version: number; backup?: string }>Import: validates the package structure and version, packs a fresh backup of the current
State, then replaces agent_state/ while keeping the current vault, and hands the package's
traces/ to pkg.landTraces.
preSnapshot: false skips the pre-import backup — for seeding a freshly created Agent,
whose template state is not worth preserving.
@paramprojectId
string@paramagentId
string@parampkg
AgentPackage@paramopts
{ preSnapshot: boolean }@returns
Promise<{ version: number; backup?: string }>