UNPKG

donobu

Version:

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

95 lines 3.46 kB
import { BrowserStorageState } from '../models/BrowserStorageState'; import { FlowMetadata } from '../models/FlowMetadata'; import { FlowsQuery } from '../models/FlowsQuery'; import { ToolCall } from '../models/ToolCall'; import { VideoSegment } from '../models/VideoSegment'; /** * Result of a paginated flows query */ export interface PaginatedFlowsResult { /** Flows matching the query. */ items: FlowMetadata[]; /** Token for fetching the next page (if available). */ nextPageToken?: string; } /** * Interface for persisting data relating to DonobuFlow runs. */ export interface FlowsPersistence { /** * Save the given FlowMetadata for the associated flow. */ saveMetadata(flowMetadata: FlowMetadata): Promise<void>; /** * Load metadata for a specific flow. * @throws FlowNotFoundException if the flow is not found */ getMetadataByFlowId(flowId: string): Promise<FlowMetadata>; /** * Load metadata by a given flow name. * @throws FlowNotFoundException if the flow is not found */ getMetadataByFlowName(flowName: string): Promise<FlowMetadata>; /** * Save a PNG screenshot for a specific flow. * @returns The identifier for the saved screenshot */ savePngScreenShot(flowId: string, bytes: Buffer): Promise<string>; /** * Loads a PNG screenshot. */ getPngScreenShot(flowId: string, screenShotId: string): Promise<Buffer | null>; /** * Save a tool call for a specific flow. */ saveToolCall(flowId: string, toolCall: ToolCall): Promise<void>; /** * Load all tool calls for a specific flow. * @throws FlowNotFoundException if the flow is not found */ getToolCalls(flowId: string): Promise<ToolCall[]>; /** * Get flows matching a given query. */ getFlows(query: FlowsQuery): Promise<PaginatedFlowsResult>; /** * Set video data for a specific flow. */ setVideo(flowId: string, bytes: Buffer): Promise<void>; /** * Get a video segment for a specific flow. * @throws FlowNotFoundException if the flow is not found */ getVideoSegment(flowId: string, startOffset: number, length: number): Promise<VideoSegment | null>; /** * Get a file associated with a specific flow. * * @throws FlowNotFoundException if the flow is not found. */ getFlowFile(flowId: string, fileId: string): Promise<Buffer | null>; /** * Set a file for a specific flow. */ setFlowFile(flowId: string, fileId: string, fileBytes: Buffer): Promise<void>; /** * Sets the given browser state for a specific flow. * * WARNING: This will NOT override the runtime browser state for a flow that * is currently running. This is only for persisting the browser state for a * flow that has completed so that it can be used by other flows in the * future. */ setBrowserState(flowId: string, browserState: BrowserStorageState): Promise<void>; /** * Get the browser state for a specific flow. Note that not all flows will * have an associated persisted browser state. * * @throws FlowNotFoundException if the flow is not found. */ getBrowserState(flowId: string): Promise<BrowserStorageState | null>; /** * Delete a specific flow and all associated data. */ deleteFlow(flowId: string): Promise<void>; } //# sourceMappingURL=FlowsPersistence.d.ts.map