import type { TelemetryEvent } from './types.mts'; /** * Centralized telemetry service for Socket CLI. * Telemetry is always scoped to an organization. * Singleton pattern ensures only one instance exists per process. * * NOTE: Only one telemetry instance exists per process. * If getTelemetryClient() is called with a different organization slug, * it returns the existing instance for the original organization. * Switching organizations mid-execution is not supported - the first * organization to initialize telemetry will be used for the entire process. * * This is intended, since we can't switch an org during command execution. */ export declare class TelemetryService { private readonly orgSlug; private config; private eventQueue; private isDestroyed; /** * Private constructor. * Requires organization slug. * * @param orgSlug - Organization identifier. */ private constructor(); /** * Get the current telemetry instance if one exists. * Does not create a new instance. * * @returns Current telemetry instance or null if none exists. */ static getCurrentInstance(): TelemetryService | null; /** * Get telemetry client for an organization. * Creates and initializes client if it doesn't exist. * Returns existing instance if already initialized. * * @param orgSlug - Organization identifier (required). * @returns Initialized telemetry service instance. */ static getTelemetryClient(orgSlug: string): Promise; /** * Track a telemetry event. * Adds event to queue for batching and eventual submission. * Auto-flushes when batch size is reached. * * @param event - Telemetry event to track (session_id is optional and will be auto-set). */ track(event: Omit): void; /** * Flush all queued events to the API. * Returns immediately if no events queued or telemetry disabled. * Times out after configured flush_timeout to prevent blocking CLI exit. */ flush(): Promise; private sendEvents; /** * Destroy the telemetry service for this organization. * Flushes remaining events and clears all state. * Idempotent - safe to call multiple times. */ destroy(): Promise; } //# sourceMappingURL=service.d.mts.map