import { PlaywrightExecutionRequest, PlaywrightExecutionResponse, ScriptExecutionRequest, ScriptExecutionResponse, TestFileExecutionRequest, TestFileExecutionResponse } from './types'; import { AuthConfig } from './auth-config'; import { CreditUsageCallback } from './credit-usage-service'; import { LLMProvider } from './llm-provider'; import { ProgressReporter } from './progress-reporter'; /** * Service for orchestrating Playwright script execution */ export declare class ExecutionService { private playwrightService; private llmFacade; private llmProvider; private progressReporter?; private creditUsageService; private maxConcurrentExecutions; private activeExecutions; private logger?; private orchestratorAgent; private buildTagLogged; /** * Get SOM handler from orchestrator agent (for bug artifact analysis) */ getSomHandler(): import("./orchestrator").PageSoMHandler | undefined; constructor(authConfig?: AuthConfig, backendUrl?: string, maxConcurrentExecutions?: number, llmProvider?: LLMProvider, progressReporter?: ProgressReporter, creditUsageCallback?: CreditUsageCallback); /** * Set a logger callback for capturing execution logs */ setLogger(logger: (message: string, level?: 'log' | 'error' | 'warn') => void): void; /** * Set credit usage callback (server-side billing path) */ setCreditUsageCallback(callback: CreditUsageCallback): void; /** * Log a message using the configured logger */ private log; private logBuildTag; /** * Initialize the execution service */ initialize(): Promise; /** * Set authentication configuration for the service * Note: This recreates the LLM provider with new auth config */ setAuthConfig(authConfig: AuthConfig): void; /** * Execute a script with optional AI repair capabilities */ executeScript(request: ScriptExecutionRequest): Promise; /** * Execute a single Playwright command with proper execution context (page, ai, test, expect) * This reuses the same execution context mechanism used for test steps via PersistentExecutionContext * * @param code - The Playwright command code to execute (e.g., "await page.locator('#email').fill('test@example.com');") * @param page - Playwright Page object * @param browser - Playwright Browser object (optional, will be extracted from page if not provided) * @param browserContext - Playwright BrowserContext object (optional, will be extracted from page if not provided) * @param tempDir - Optional temp directory for module resolution * @returns Promise that resolves when command execution completes */ executeCommand(code: string, page: any, browser?: any, browserContext?: any, tempDir?: string): Promise; /** * Internal script execution method */ private executeScriptInternal; /** * Execute a complete Playwright test suite as a single job */ executeTestSuite(request: PlaywrightExecutionRequest): Promise; /** * Parse Playwright configuration from string */ private parsePlaywrightConfig; /** * Close the execution service */ close(): Promise; /** * Check if the service is ready */ isReady(): boolean; /** * Execute steps in persistent context with callbacks * Used by both runExactly and runWithRepair * Variables persist across steps without re-execution */ private executeStepsInPersistentContext; /** * Attempt to repair a failed step using orchestrator * Returns repair result with action type (MODIFY, DELETE, or FAILED) */ private attemptStepRepair; private runExactly; private runWithAIRepair; private parseScriptIntoSteps; private executeStepCode; private generateUpdatedScript; /** * Initialize browser with configuration (delegates to utility function) */ private initializeBrowser; /** * Execute a test file with hooks support * Parses the test file, extracts hooks and tests, executes them in correct order * Each test is reported separately with its own jobId */ runTestFile(request: TestFileExecutionRequest): Promise; /** * Execute a hook (beforeAll, afterAll, beforeEach, afterEach) * Uses the same execution context as tests * If jobId is provided, executes step-wise with callbacks for step reporting * @returns Number of non-variable steps executed (for step counter tracking) */ private executeHook; } //# sourceMappingURL=execution-service.d.ts.map