import type { PlatformErrorSource } from '../../types/errors.js';
import type { NormalizedError } from '../../utils/error-display.js';
import type { AnyRuntimeEvent, RuntimeEventDomain, RuntimeEventEnvelope } from '../events/index.js';
import type { RuntimeStore } from '../store/index.js';
import type { AttributeValue, ReadableSpan } from './types.js';
import type { TelemetryAggregates, TelemetryListResponse, TelemetryPageInfo, TelemetryRecord, TelemetrySeverity, TelemetryViewMode } from './api.js';
export declare const SERVICE_NAME = "goodvibes-sdk";
export declare const DEFAULT_EVENT_LIMIT = 500;
/**
 * Allowlist of metric label keys permitted in telemetry attributes.
 * Keys outside this set are stripped before storage to prevent high-cardinality
 * label explosion in metrics backends (Prometheus, OTLP, etc.).
 */
export declare const METRIC_LABEL_ALLOWLIST: Set<string>;
export declare const DEFAULT_ERROR_LIMIT = 250;
export declare const DEFAULT_SPAN_LIMIT = 250;
export declare const ALL_DOMAINS: readonly RuntimeEventDomain[];
export declare function normalizeTraceId(traceId: string | undefined): string;
export declare function buildSpanId(seed: string): string;
export declare function appendBounded<T>(target: T[], value: T, limit: number): void;
export declare function toAttributeValue(value: unknown): AttributeValue | undefined;
export declare function toOtlpAttributes(attributes: Record<string, unknown>): Array<{
    key: string;
    value: Record<string, unknown>;
}>;
export declare function inferSeverity(type: string, error?: NormalizedError): TelemetrySeverity;
export declare function inferErrorSource(domain: RuntimeEventDomain): PlatformErrorSource;
export declare function summarizePayload(type: string, payload: unknown): string;
export declare function normalizePayload(payload: unknown): Record<string, unknown>;
export declare function extractProvider(payload: Record<string, unknown>): string | undefined;
export declare function extractErrorCandidate(payload: Record<string, unknown>): string | undefined;
export declare function isErrorEventType(type: string): boolean;
/**
 * Filter metric labels against the allowlist to prevent high-cardinality
 * label injection into metrics backends. Non-allowlisted keys are dropped.
 *
 * Note: full event attribute payloads (for telemetry records) are NOT filtered —
 * this is only applied when building metric instrument labels.
 */
export declare function filterMetricLabels(labels: Record<string, unknown>): Record<string, unknown>;
export declare function buildAttributes(domain: RuntimeEventDomain, envelope: RuntimeEventEnvelope<AnyRuntimeEvent['type'], AnyRuntimeEvent>, payload: Record<string, unknown>): Record<string, unknown>;
export declare function buildRecordId(domain: RuntimeEventDomain, envelope: RuntimeEventEnvelope<AnyRuntimeEvent['type'], AnyRuntimeEvent>, seq: number): string;
export declare function extractRecordSequence(record: TelemetryRecord): number;
export declare function buildSpanCursor(span: ReadableSpan): string;
export declare function clampLimit(limit: number | undefined, fallback: number): number;
export declare function sanitizeRecord(record: TelemetryRecord, view: TelemetryViewMode): TelemetryRecord;
export declare function sanitizeSpan(span: ReadableSpan, view: TelemetryViewMode): ReadableSpan;
export declare function buildListResponse<T>(items: readonly T[], view: TelemetryViewMode, rawAccessible: boolean, pageInfo: TelemetryPageInfo): TelemetryListResponse<T>;
export declare function toObjectMap(map: Map<string, number>): Record<string, number>;
export declare function buildOtlpTraceDocumentFromSpans(spans: readonly ReadableSpan[]): Record<string, unknown>;
export declare function buildOtlpLogDocumentFromRecords(records: readonly TelemetryRecord[]): Record<string, unknown>;
export declare function buildOtlpMetricDocumentFromState(state: ReturnType<RuntimeStore['getState']>, aggregates: TelemetryAggregates): Record<string, unknown>;
//# sourceMappingURL=api-helpers.d.ts.map