import type { CoreDependencies } from '../commands/core.js'; type UpOptions = { dashboard?: boolean; port?: string; spawn?: boolean; background?: boolean; foreground?: boolean; verbose?: boolean; dashboardPath?: string; reuseExistingBroker?: boolean; workspaceKey?: string; stateDir?: string; brokerName?: string; }; type DownOptions = { force?: boolean; all?: boolean; timeout?: string; stateDir?: string; }; export interface BrokerConnection { url: string; port: number; api_key: string; pid: number; } /** * Read the broker's connection.json file from the data directory. * Returns null if the file doesn't exist or is invalid. */ export declare function readBrokerConnection(dataDir: string): BrokerConnection | null; /** * Extract a human-meaningful detail string from an error, walking `err.cause`. * * Node's native `fetch()` throws `TypeError: fetch failed` for any network * problem and stuffs the real reason (ECONNREFUSED, ENOTFOUND, AbortError, * UND_ERR_CONNECT_TIMEOUT, …) into `err.cause`. Without unwrapping, every * outbound HTTP failure looks identical to the user. * * Exported for testing. */ export declare function describeError(err: unknown): string; /** * Pick the best `error_class` for telemetry. Prefer a network-style code from * `err.cause` (ECONNREFUSED etc.) over the generic constructor name (TypeError) * — a code is more actionable in PostHog and matches the schema's example * values for `BrokerStartFailedEvent.error_class`. * * Exported for testing. */ export declare function classifyBrokerStartError(err: unknown): string; /** Exported for testing. */ export declare function classifyBrokerStartStage(err: unknown, message: string, wantsDashboard: boolean): string; export declare function runUpCommand(options: UpOptions, deps: CoreDependencies): Promise; export declare function runDownCommand(options: DownOptions, deps: CoreDependencies): Promise; export declare function runStatusCommand(deps: CoreDependencies, options?: { stateDir?: string; waitFor?: string; }): Promise; export {}; //# sourceMappingURL=broker-lifecycle.d.ts.map