/** * Privacy-safe community telemetry export (SP-082). * * Maps routing telemetry rows to anonymized community export shapes and * HyDRA calibration batches. Never exports prompt text, messages, request_id, * or raw session_id — session identifiers are one-way hashed only. */ import type { RoutingFeatureSidecar, RoutingTelemetry } from '../domain/types/index.js'; export declare const COMMUNITY_TELEMETRY_ENABLED_ENV = "SMART_ROUTER_COMMUNITY_TELEMETRY"; export declare const COMMUNITY_TELEMETRY_ENABLED_NOTIFY_MESSAGE = "Smart Router community telemetry export is enabled. Only anonymized routing metadata is exported \u2014 no prompt text, messages, or raw session identifiers."; export declare const TELEMETRY_EXPORT_FORBIDDEN_KEYS: readonly ["session_id", "request_id", "prompt_text", "messages", "prompt", "pepper", "install_pepper", "dataset_pepper", "dataset_key", "prompt_fingerprint"]; export declare const HYDRA_CALIBRATION_STAGE: "hydra_match"; export declare function isCommunityTelemetryExportEnabled(): boolean; /** One-way hash for session correlation without exporting raw session_id. */ export declare function hashSessionIdForTelemetryExport(sessionId: string): string; export interface CommunityTelemetryRecord { readonly timestamp: string; readonly session_id_hash: string; readonly turn_type: string; readonly stage: string; readonly reason_code: string; readonly selected_model_id: string; readonly estimated_cost_usd: number; readonly routing_latency_ms: number; readonly pin_reason: string | null; } /** HyDRA calibration row — routing signals only, no prompt content. */ export interface HydraCalibrationRecord { readonly timestamp: string; readonly session_id_hash: string; readonly turn_type: string; readonly reason_code: string; readonly selected_model_id: string; readonly routing_latency_ms: number; readonly requirement_reasoning: number | null; readonly requirement_code_gen: number | null; readonly requirement_tool_use: number | null; readonly top_candidate_model_id: string | null; readonly top_candidate_score: number | null; } export declare function isHydraMatchTelemetry(record: RoutingTelemetry): boolean; export declare function selectHydraMatchTelemetry(records: readonly RoutingTelemetry[]): readonly RoutingTelemetry[]; /** Map a telemetry row to a privacy-safe community export object. */ export declare function toCommunityTelemetryRecord(record: RoutingTelemetry): CommunityTelemetryRecord; /** Map a hydra_match telemetry row to a collaborative calibration export row. */ export declare function toHydraCalibrationRecord(record: RoutingTelemetry, features?: RoutingFeatureSidecar): HydraCalibrationRecord; export declare function formatCommunityTelemetryJsonl(records: readonly RoutingTelemetry[]): string; export declare function formatHydraCalibrationJsonl(records: readonly RoutingTelemetry[], featuresByRequestId?: ReadonlyMap): string; /** Defense-in-depth scrub for loose export objects. */ export declare function scrubTelemetryExportObject(value: Record): Record; //# sourceMappingURL=telemetry.d.ts.map