import fs from 'node:fs'; import type { Options, Capabilities } from '@wdio/types'; import type { BrowserstackConfig, BrowserstackOptions, TestManagementOptions, TestObservabilityOptions } from '../types.js'; export declare class CLIUtils { static automationFrameworkDetail: {}; static testFrameworkDetail: {}; static CLISupportedFrameworks: string[]; static isDevelopmentEnv(): boolean; static getCLIParamsForDevEnv(): Record; /** * Build config object for binary session request * @returns {string} * @throws {Error} */ static getBinConfig(config: Options.Testrunner, capabilities: Capabilities.RemoteCapabilities, options: BrowserstackConfig & BrowserstackOptions, buildTag?: string): string; /** * testManagementOptions forwarded to the binary as configured, with testPlanId trimmed and * dropped when blank; undefined when nothing is left to send. */ static getTestManagementOptions(testManagementOptions?: TestManagementOptions): TestManagementOptions | undefined; /** * Applies the server config the binary forwards to the service options: exactly the listed * keys, deep-merged, with the keys getBinConfig renames mapped back to their option names. * `platforms` has no option; the launcher maps it onto the capabilities. * @returns the keys applied */ static applyServerSdkConfig(options: Record, serverConfig: Record, keys: unknown[]): string[]; static assignSafeKeys(target: Record, source: Record): void; /** * Objects merge recursively, arrays element-wise (extra source elements are appended), any * other value, null included, replaces. */ static mergeServerConfigValue(target: unknown, source: unknown): unknown; /** * The service options getBinConfig derives testContextOptions from. sessionNameFormat is not * mapped: the option is a function, and a server value can only be a string. */ static getOptionsFromTestContextOptions(testContextOptions: unknown): Record; /** * Layers a server platforms[i] entry onto capability i, undoing getBinConfig's flattening: a * key the capability's bstack:options holds goes back there, and so does a new key when the * capability has bstack:options, unless it is vendor-prefixed. */ static applyServerPlatform(capability: Record, platform: unknown): void; static getSdkVersion(): any; static getSdkLanguage(): string; static setupCliPath(config: Options.Testrunner): Promise; static checkAndUpdateCli(existingCliPath: string, cliDir: string, config: Options.Testrunner): Promise; static getCliDir(): string; static getWritableDir(): string | null | undefined; static getExistingCliPath(cliDir: string): string; static requestToUpdateCLI: (queryParams: Record, config: Options.Testrunner) => Promise; static runShellCommand(cmdCommand: string, workingDir?: string): Promise; static downloadLatestBinary: (binDownloadUrl: string, cliDir: string) => Promise; static downloadFileStream(downloadedFileStream: fs.WriteStream, binaryName: string | null, zipFilePath: string, cliDir: string, resolve: (path: string) => void, reject: (reason?: Error) => void): void; static getTestFrameworkDetail(): any; static getAutomationFrameworkDetail(): any; static setFrameworkDetail(testFramework: string, automationFramework: string): void; /** * Get the current instance name using thread id and processId * @returns {string} */ static getCurrentInstanceName(): string; /** * Generate a unique client worker identifier combining thread ID and process ID. * This identifier is used to track worker-specific events and performance metrics * across distributed test execution. Format matches the Python SDK implementation * for consistency across SDKs. * * Format: "threadId-processId" * * @param context - Optional execution context with threadId and processId * @returns Worker ID string in format "threadId-processId" * @example * const workerId = CLIUtils.getClientWorkerId() // Returns "1-12345" * const workerId = CLIUtils.getClientWorkerId({ threadId: 123, processId: 456 }) // Returns "123-456" */ static getClientWorkerId(context?: { threadId?: string | number; processId?: string | number; }): string; /** * * @param {TestFrameworkState | AutomationFrameworkState} frameworkState * @param {HookState} hookState * @returns {string} */ static getHookRegistryKey(frameworkState: State, hookState: State): string; static matchHookRegex(hookState: string): boolean; static getObservabilityBuildTags(observabilityOptions: TestObservabilityOptions, bstackBuildTag?: string): string[]; static checkCLISupportedFrameworks(framework: string | undefined): boolean; } //# sourceMappingURL=cliUtils.d.ts.map