UNPKG

donobu

Version:

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

67 lines 3.3 kB
import type { CreateDonobuFlow } from '../models/CreateDonobuFlow'; import type { CreateTest } from '../models/CreateTest'; import type { PaginatedResult } from '../models/PaginatedResult'; import type { TestListItem, TestMetadata, TestsQuery } from '../models/TestMetadata'; import type { SuitesPersistenceRegistry } from '../persistence/suites/SuitesPersistenceRegistry'; import type { TestsPersistenceRegistry } from '../persistence/tests/TestsPersistenceRegistry'; import type { DonobuFlowsManager } from './DonobuFlowsManager'; export declare class TestsManager { private readonly testsPersistenceRegistry; private readonly suitesPersistenceRegistry; private readonly flowsManager; constructor(testsPersistenceRegistry: TestsPersistenceRegistry, suitesPersistenceRegistry: SuitesPersistenceRegistry, flowsManager: DonobuFlowsManager); createTest(params: CreateTest): Promise<TestMetadata>; getTestById(testId: string): Promise<TestMetadata>; /** * Picks the tests persistence layer to use when creating a new test. * * - If `suiteId` is null/undefined: use the primary tests layer. * - If `suiteId` is set: look up the suite's layer key and use the matching * tests layer. If no tests layer matches the suite's key (rare — would * require asymmetric registry config), fall back to the primary tests * layer; the FK won't hold but at least the test is persisted somewhere. * - If `suiteId` is set but the suite doesn't exist anywhere: fall back * to the primary tests layer (the SQLite FK will reject if applicable; * non-DB layers will accept the dangling reference). */ private resolveLayerForTestCreate; private findSuiteLayerKey; getTests(query: TestsQuery): Promise<PaginatedResult<TestListItem>>; /** * Update a test in the persistence layer where it exists. * Iterates layers, updates in the first one that has it, ignores * TestNotFoundExceptions from others. */ updateTest(testMetadata: TestMetadata): Promise<void>; /** * Delete a test from all persistence layers. * * After deleting, cascade-deletes any flows that belong to this test. * This mirrors the DB-level ON DELETE CASCADE for non-DB persistence * layers (Volatile, S3, GCS). */ deleteTest(testId: string): Promise<void>; /** * Gets the list of tool calls to invoke when starting a new flow for the * given test, based on the most recent successful flow for the test. * * @param test - The test to get the tool calls for * * @returns The tool calls to use when executing the test * * @throws {Error} if no previous successful flow is found */ private getTestToolCalls; /** * Creates a new flow (config) for the given test, which should be passed to * `flowsManager.createFlow` to execute the test. The returned config's * `testId` is set, which `createFlow` uses to route the flow to the same * persistence layer as the test. * * @param testId - The ID of the test to create a new flow for * * @returns A new flow configuration */ getNewFlowFromTest(testId: string): Promise<CreateDonobuFlow>; } //# sourceMappingURL=TestsManager.d.ts.map