UNPKG

donobu

Version:

Create browser automations with an LLM agent and replay them as Playwright scripts.

43 lines 2.13 kB
import type { EnvPick } from 'env-struct'; import type { env } from '../../envVars'; import type { FlowsPersistenceRegistry } from '../flows/FlowsPersistenceRegistry'; import { PersistencePluginRegistry } from '../PersistencePlugin'; import type { TestsPersistence } from './TestsPersistence'; /** * A persistence layer paired with its `PERSISTENCE_PRIORITY` key. See * {@link FlowsPersistenceLayer} for why keys must align across registries. */ export interface TestsPersistenceLayer { key: string; persistence: TestsPersistence; } export interface TestsPersistenceRegistry { /** Returns the primary persistence layer. */ get(): Promise<TestsPersistence>; /** Returns all valid persistence layers. Guaranteed to be non-empty. */ getAll(): Promise<TestsPersistence[]>; /** Returns all valid layers paired with their `PERSISTENCE_PRIORITY` key. */ getEntries(): Promise<TestsPersistenceLayer[]>; /** * Returns the persistence layer registered under the given * `PERSISTENCE_PRIORITY` key, or undefined if no such layer exists. */ getByKey(key: string): Promise<TestsPersistence | undefined>; } export declare class TestsPersistenceRegistryImpl implements TestsPersistenceRegistry { private readonly layers; constructor(layers: TestsPersistenceLayer[]); static fromEnvironment(environ: EnvPick<typeof env, 'DONOBU_API_BASE_URL' | 'DONOBU_API_KEY' | 'DONOBU_PERSISTENCE_API_KEY' | 'PERSISTENCE_PRIORITY'>, /** * Flows registry — used by the volatile tests layer to compute * flow-derived sort keys (flow_count, latest_flow_created_at). * Optional: when omitted, the volatile layer falls back to * best-effort no-op sorting on those keys. */ flowsRegistry?: FlowsPersistenceRegistry, persistencePlugins?: PersistencePluginRegistry): Promise<TestsPersistenceRegistryImpl>; get(): Promise<TestsPersistence>; getAll(): Promise<TestsPersistence[]>; getEntries(): Promise<TestsPersistenceLayer[]>; getByKey(key: string): Promise<TestsPersistence | undefined>; } //# sourceMappingURL=TestsPersistenceRegistry.d.ts.map