import { ExecutionResult, ParsedBubbleWithInfo, CredentialType, type ExecutionMeta } from '@bubblelab/shared-schemas'; import { BubbleFactory, WebhookEvent, BubbleLogger, LogLevel } from '@bubblelab/bubble-core'; import type { StreamCallback } from '@bubblelab/shared-schemas'; import type { ExecutionPlan } from './types'; import { BubbleScript } from '../parse/BubbleScript'; import { BubbleInjector } from '../injection/BubbleInjector'; export interface VariableState { value: unknown; error?: string; } export interface BubbleRunnerOptions { enableLogging?: boolean; logLevel?: LogLevel; enableLineByLineLogging?: boolean; enableBubbleLogging?: boolean; streamCallback?: StreamCallback; useWebhookLogger?: boolean; pricingTable: Record; userCredentialMapping?: Map>; executionMeta?: ExecutionMeta; } export declare class BubbleRunner { private bubbleFactory; bubbleScript: BubbleScript; private currentStep; private savedStates; private plan; private logger; injector: BubbleInjector; private options; private hasInjectedLogging; constructor(bubbleScript: string | BubbleScript, bubbleFactory: BubbleFactory, options: BubbleRunnerOptions); /** * Creates a list of steps where length = number of parsed bubbles * Contains the bubble and parameters to run * Each step represents a continuous line range (e.g., line 1-20, 21-xxx) */ private buildExecutionPlan; /** * Find the line where .action() is called for a bubble * Uses AST to locate the method call */ private findActionCallLine; /** * Recursively search AST for .action() calls on a specific variable */ private findActionCallInAST; getParsedBubbles(): Record; /** * Get the ORIGINAL parsed bubbles (locations from the initial script before any rewrites) */ getOriginalParsedBubbles(): Record; getVariables(): string[]; /** * Finds step ID, calls memorizes results on previous bubbles, and runs the script from 1 to line end */ runStep(stepId: number): void; /** * Run from step 1 to end */ runAll(payload?: Partial): Promise; /** * Find the BubbleFlow class in module exports */ private findBubbleFlowClass; /** * Check if a function is a BubbleFlow class */ private isBubbleFlowClass; /** * Instantiate the flow class with appropriate constructor parameters */ private instantiateFlowClass; /** * Resume execution from a specific step */ resumeFromStep(stepId: number): void; getPlan(): ExecutionPlan; /** * Get the logger instance */ getLogger(): BubbleLogger | undefined; /** * Get execution summary with detailed analytics */ getExecutionSummary(): ReturnType | null; /** * Export execution logs in various formats */ exportLogs(format?: 'json' | 'csv' | 'table'): string | null; /** * Find the project root directory by looking for package.json */ private findProjectRoot; /** * Dispose of resources (logger, etc.) */ dispose(): void; } //# sourceMappingURL=BubbleRunner.d.ts.map