import { SDKClient } from '../grpc/index.js'; import type { TestFrameworkEventRequest, TestSessionEventRequest, LogCreatedEventRequest, DriverInitRequest, FetchDriverExecuteParamsEventRequest, ConnectBinSessionResponse, StartBinSessionResponse, TestFrameworkEventResponse, TestSessionEventResponse, LogCreatedEventResponse, DriverInitResponse, FetchDriverExecuteParamsEventResponse } from '../grpc/index.js'; import { BStackLogger } from './cliLogger.js'; /** * GrpcClient - Singleton class for managing gRPC client connections * * This class uses the singleton pattern to ensure only one gRPC client instance exists * throughout the application lifecycle. */ export declare class GrpcClient { #private; binSessionId: string | undefined; listenAddress: string | undefined; channel: any | null; client: SDKClient | null; logger: typeof BStackLogger; constructor(); /** * Get the singleton instance of GrpcClient * @returns {GrpcClient} The singleton instance */ static getInstance(): GrpcClient; /** * Helper method to get client worker ID from execution context or current context. * This provides a consistent way to extract worker identification across all gRPC calls. * * @param executionContext - Optional execution context with threadId and processId * @returns Worker ID string in format "threadId-processId" */ private getClientWorkerIdFromContext; /** * Initialize the gRPC client connection * @param {string} host The gRPC server host * @param {number} port The gRPC server port */ init(params: Record): void; /** * Connect to the gRPC server * @returns {void} */ connect(): void; startBinSession(wdioConfig: string): Promise; /** * Connect to the bin session * @returns {Promise} The response from the gRPC call */ connectBinSession(): Promise; /** * Stop the bin session * @returns {Promise} * @private */ stopBinSession(): Promise; /** * Render end-of-build customer-visible summary entries. * * Per the binary proto contract (CustomerVisibleSummaryEntry in * sdk-messages.proto): iterate by `severity` + `body`, write `body` verbatim, * and pick the stream from `severity`. Never branches on `entryType`, so new * entry types need no SDK change. * @private */ private renderCustomerVisibleSummary; /** * Tint a summary block by severity — yellow for warn (an outdated SDK), red for * error (a deprecated one), untouched otherwise. * * Each line is wrapped and reset on its own rather than the block as a whole, so * a truncated or interleaved write cannot leave the customer's terminal stuck in * colour. The first non-blank, non-border line is emphasised. * @private */ private colouriseSummaryBody; testSessionEvent(data: Omit): Promise; /** * * Send TestFrameworkEvent */ testFrameworkEvent(data: Omit): Promise; /** * * Send driverInitEvent */ driverInitEvent(data: Omit): Promise; logCreatedEvent(data: Omit): Promise; fetchDriverExecuteParamsEvent(data: Omit): Promise; /** * Send TestOrchestration request to get ordered test files * @param {string[]} testFiles - Array of test file paths * @param {string} orchestrationStrategy - The orchestration strategy to use * @param {string} orchestrationMetadata - Additional metadata for orchestration * @returns {Promise} Array of ordered test files or null if failed */ testOrchestrationSession(testFiles: string[], orchestrationStrategy: string, orchestrationMetadata: string): Promise; /** * Get the gRPC channel * @returns {grpc.Channel} The gRPC channel */ getClient(): SDKClient | null; /** * Get the gRPC channel * @returns {grpc.Channel} The gRPC channel */ getChannel(): any; } //# sourceMappingURL=grpcClient.d.ts.map