donobu
Version:
Create browser automations with an LLM agent and replay them as Playwright scripts.
47 lines • 2.48 kB
TypeScript
import type { EnvPick } from 'env-struct';
import type { env } from '../../envVars';
import { PersistencePluginRegistry } from '../PersistencePlugin';
import type { EnvPersistence } from './EnvPersistence';
import { EnvPersistenceVolatile } from './EnvPersistenceVolatile';
/**
* Provides access to the ordered stack of {@link EnvPersistence} layers that
* back the Donobu flow environment data system.
*
* Layers are ordered by `PERSISTENCE_PRIORITY` (e.g. `["LOCAL", "RAM"]`).
* Consumers - primarily {@link EnvDataManager} - iterate the stack to resolve
* reads (first hit wins) and fan out writes (all layers receive every write).
*/
export interface EnvPersistenceRegistry {
/** Returns a list of all valid persistence layers. Note that the returned list may be empty! */
getAll(): Promise<EnvPersistence[]>;
}
/**
* A factory class for creating EnvPersistence instances. Persistence layers are constructed
* eagerly at creation time and reused across all subsequent calls.
*
* Note that "Env" in this particular context is not talking about this
* process's NodeJS environment variables, but rather, the environment variables for Donobu flows.
*/
export declare class EnvPersistenceRegistryImpl implements EnvPersistenceRegistry {
private readonly layers;
/**
* Creates an instance with pre-built persistence layers.
*/
constructor(layers: EnvPersistence[]);
/**
* Creates an instance by reading environment variables and eagerly constructing
* all applicable persistence layers.
*
* When {@link envPersistenceVolatile} is non-null it is always included in
* the resulting layer list - even if `PERSISTENCE_PRIORITY` does not contain
* `"RAM"`. If `"RAM"` *is* present in the priority list the volatile layer
* occupies that position; otherwise it is appended as a trailing fallback.
* This guarantees that env vars sourced from the host process (e.g. a
* `process.env` snapshot) remain accessible to flows regardless of how the
* caller configured persistence priority.
*/
static fromEnvironment(envPersistenceVolatile: EnvPersistenceVolatile | null, environ: EnvPick<typeof env, 'PERSISTENCE_PRIORITY'>, persistencePlugins?: PersistencePluginRegistry): Promise<EnvPersistenceRegistryImpl>;
/** Returns all persistence layers. Note that the returned list may be empty! */
getAll(): Promise<EnvPersistence[]>;
}
//# sourceMappingURL=EnvPersistenceRegistry.d.ts.map