/** * Canonical state-directory layout helpers and archive operations. * * The runtime uses these to build deterministic per-runtime state paths * and to archive state directories when runtimes are deleted. */ /** * Describes the explicit paths the runtime provides to each component. * Components must store their state only within the path they receive. */ export interface StateLayout { /** Runtime state root (e.g. `/-`). */ root: string; /** Root passed to scanner stores (same as `root` today; scanners add `strategies//...` internally). */ scannerRoot: string; /** Root passed to StateManager / DslPlugin (same as `root`; they add `/dsl-*` internally). */ dslRoot: string; /** Root for action-layer persisted state (`strategies//actions/...`). */ actionRoot: string; } /** * Build the per-runtime state directory path. * Convention: `/-`. */ export declare function buildRuntimeStateDir(baseStateDir: string, runtimeId: string, wallet: string): string; /** @deprecated Use buildRuntimeStateDir */ export declare const buildRecipeStateDir: typeof buildRuntimeStateDir; /** * Build a `StateLayout` from a runtime's state directory. * Currently all roots resolve to the same directory; kept explicit so * a future version can split them without changing call-sites. */ export declare function buildStateLayout(runtimeStateDir: string): StateLayout; export interface ArchiveEntry { path: string; runtimeId: string; wallet: string; timestamp: number; } /** * Archive a runtime's state directory by moving it into the archives folder. * Target: `/--/`. * Falls back to recursive copy + remove when `rename` fails (cross-device). * Returns the archive destination path. */ export declare function archiveStateDir(runtimeStateDir: string, archiveBaseDir: string, runtimeId: string, wallet: string): Promise; /** * List archived runtime state directories, sorted newest-first. * Parses directory names matching `--`. */ export declare function listArchives(archiveBaseDir: string): Promise; //# sourceMappingURL=state-layout.d.ts.map