import type { ScannerId } from "../types.js"; /** Persisted mutable state for one scanner instance under one strategy. */ export interface ScannerRuntimeState { address: string; scannerId: ScannerId; config: Cfg; state: St; configVersion: number; updatedAt: number; } /** Seed payload used when first creating runtime state via ensure(). */ export interface RuntimeSeed { config: Cfg; state?: St; } /** * Persists scanner runtime lifecycle state (config + state + version). * Keyed by (address, scannerId), with one scanner instance per strategy. */ export declare class RuntimeStore { private readonly stateDir; private readonly now; /** * @param stateDir Root runtime state directory. * @param now Injectable clock for deterministic tests. */ constructor(stateDir: string, now?: () => number); /** Reads persisted runtime state for a scanner instance. */ read(address: string, scannerId: ScannerId): Promise | null>; /** Writes full runtime state snapshot atomically. */ write(data: ScannerRuntimeState): Promise; /** * Ensures runtime exists and returns it. * Creates a new runtime with version=1 when missing. */ ensure(address: string, scannerId: ScannerId, seed: RuntimeSeed): Promise>; /** * Updates runtime config and increments configVersion. * Throws when runtime does not exist to keep lifecycle explicit. */ setConfig(address: string, scannerId: ScannerId, config: Cfg): Promise>; /** * Updates runtime scanner-local state while preserving current config/version. * Throws when runtime does not exist to avoid implicit bootstrap. */ setState(address: string, scannerId: ScannerId, state: St): Promise>; /** Resolves runtime state file path for a scanner instance. */ private runtimePath; } //# sourceMappingURL=runtime-store.d.ts.map