import type { ServerStateStore } from '../types/server.js'; /** Where run records live in the state store, for anything that reads them besides the run manager. */ export declare const RUNS_NAMESPACE: readonly string[]; /** Threads, runs, and cron jobs in process memory. The default, and enough for one replica. */ export declare class MemoryServerStore implements ServerStateStore { private readonly items; private sequence; /** Reads a record. */ get(namespace: readonly string[], key: string): V | undefined; /** Writes a record. */ put(namespace: readonly string[], key: string, value: V): void; /** Writes a record only when the stored one's `version` is `expected`, or none is stored and `expected` is null. */ putIfVersion(namespace: readonly string[], key: string, value: V, expected: number | null): boolean; /** Removes a record. */ delete(namespace: readonly string[], key: string): void; /** Records under a namespace, newest written first. Defaults to 50. */ list(namespace: readonly string[], options?: { limit?: number; }): V[]; } /** The part of a long-term `Store` the server state adapter uses. */ export interface StoreLike { /** Stores an item. */ put(namespace: readonly string[], key: string, value: unknown): Promise | void; /** Reads an item. */ get(namespace: readonly string[], key: string): Promise<{ value: unknown; } | undefined> | { value: unknown; } | undefined; /** Stores an item only when the stored one's `version` is `expected`. Optional. */ putIfVersion?(namespace: readonly string[], key: string, value: { version: number; }, expected: number | null): Promise | boolean; /** Deletes an item. */ delete(namespace: readonly string[], key: string): Promise | void; /** Items under a namespace prefix, newest first. */ search(namespacePrefix: readonly string[], options?: { limit?: number; }): Promise> | Array<{ value: unknown; }>; } /** * Server state on top of a long-term store, so threads and runs live wherever memory already does. * * `MemoryStore`, `RedisStore`, `PostgresStore`, and `SqliteStore` all satisfy `StoreLike`, which is * what lets a second replica see the first replica's threads without the server growing its own * adapters. A store with `putIfVersion()` passes it on, so deployment changes are atomic across * replicas. */ export declare function fromStore(store: StoreLike): ServerStateStore;