import type { SpanProcessor } from '@opentelemetry/sdk-trace-base';
import { type Meter, type Tracer } from '@opentelemetry/api';
import type { Resource } from '@opentelemetry/resources';
import type { Logger } from './logger';
import type { LogLevel } from '@agentuity/core';
/**
 * Configuration for Telemetry/OTel initialization
 */
export interface TelemetryConfig {
    /** Service name (default: AGENTUITY_APP_NAME env) */
    name?: string;
    /** Service version (default: AGENTUITY_APP_VERSION env) */
    version?: string;
    /** OTel collector URL (default: derived from AGENTUITY_REGION) */
    url?: string;
    /** Bearer token for auth (default: AGENTUITY_SDK_KEY) */
    bearerToken?: string;
    /** Organization ID (default: AGENTUITY_CLOUD_ORG_ID) */
    orgId?: string;
    /** Project ID (default: AGENTUITY_CLOUD_PROJECT_ID) */
    projectId?: string;
    /** Deployment ID (default: AGENTUITY_CLOUD_DEPLOYMENT_ID) */
    deploymentId?: string;
    /** Environment (default: AGENTUITY_ENVIRONMENT or NODE_ENV) */
    environment?: string;
    /** CLI version (default: AGENTUITY_CLI_VERSION) */
    cliVersion?: string;
    /** SDK version */
    sdkVersion?: string;
    /** Development mode (default: AGENTUITY_SDK_DEV_MODE) */
    devmode?: boolean;
    /** Custom span processors */
    spanProcessors?: Array<SpanProcessor>;
    /** Log level (default: 'warn') */
    logLevel?: LogLevel;
    /** JSONL export base path (default: AGENTUITY_CLOUD_EXPORT_DIR) */
    jsonlBasePath?: string;
}
/**
 * Response from Telemetry initialization
 */
export interface TelemetryResponse {
    tracer: Tracer;
    meter: Meter;
    logger: Logger;
    shutdown: () => Promise<void>;
}
export declare const createResource: (config: Required<TelemetryConfig>) => Resource;
/**
 * Registers and initializes Telemetry with the specified configuration.
 *
 * Idempotent: if called again (e.g. during bun --hot reload), the previous
 * instance is shut down before creating a new one.
 *
 * @param config - Optional configuration overrides (defaults from env vars)
 * @returns An object containing the tracer, logger, and shutdown function
 */
export declare function registerTelemetry(config?: TelemetryConfig): TelemetryResponse;
/**
 * Alias for registerTelemetry (shorter name)
 */
export declare const register: typeof registerTelemetry;
/**
 * Get the current telemetry instance (or undefined if not initialized)
 */
export declare function getTelemetry(): TelemetryResponse | undefined;
/**
 * Ensure telemetry is initialized (auto-init from env vars if needed)
 */
export declare function ensureInitialized(): TelemetryResponse;
//# sourceMappingURL=telemetry.d.ts.map