import type { TraceEvent, TraceRecord } from '../core/tracing';
/**
 * OpenInference span kinds — the small subset the harness uses today.
 * Mapped from the upstream spec at
 * https://github.com/Arize-ai/openinference/blob/main/spec/semantic_conventions.md
 */
export type OpenInferenceSpanKind = 'LLM' | 'TOOL' | 'AGENT' | 'CHAIN' | 'RETRIEVER' | 'EMBEDDING' | 'GUARDRAIL' | 'EVALUATOR' | 'UNKNOWN';
export interface OtlpKeyValue {
    key: string;
    value: {
        stringValue?: string;
        intValue?: string;
        doubleValue?: number;
        boolValue?: boolean;
    };
}
export interface OtlpSpan {
    traceId: string;
    spanId: string;
    parentSpanId?: string;
    name: string;
    kind: number;
    startTimeUnixNano: string;
    endTimeUnixNano: string;
    attributes: OtlpKeyValue[];
    status: {
        code: number;
        message?: string;
    };
}
export interface OtlpResourceSpansPayload {
    resourceSpans: Array<{
        resource: {
            attributes: OtlpKeyValue[];
        };
        scopeSpans: Array<{
            scope: {
                name: string;
                version?: string;
            };
            spans: OtlpSpan[];
        }>;
    }>;
}
/**
 * Infer OpenInference span kind from the harness span name. The harness
 * names spans like `model.chat`, `tool.bash`, `context.compaction`, and
 * emits events such as `session.append`, `synthesis.fired`. Prefix +
 * keyword matching covers the live span vocabulary today.
 */
export declare function inferSpanKind(name: string): OpenInferenceSpanKind;
/**
 * Generate deterministic 32/16-char hex ids. We accept whatever id shape
 * the harness uses upstream and pad/truncate it for OTLP. Backends only
 * require uniqueness within a trace, not cryptographic strength.
 */
export declare function normalizeOtelId(id: string, length: 32 | 16): string;
/**
 * Convert a RuntimeTracer span record into an OpenInference-decorated
 * OTLP span. The harness never reuses a parent span id today, so spans
 * are emitted as roots; backends that want a tree view can group by
 * trace id (we use a single per-process trace id supplied by the caller).
 */
export declare function spanToOtlp(span: TraceRecord, traceIdHex: string): OtlpSpan;
/**
 * Convert a `recordEvent` entry into a zero-duration span. OTel does
 * support stand-alone log records, but emitting them as spans keeps the
 * exporter focused on a single signal type for now.
 */
export declare function eventToOtlp(event: TraceEvent, traceIdHex: string): OtlpSpan;
export interface BuildPayloadInput {
    spans: TraceRecord[];
    events?: TraceEvent[];
    traceIdHex: string;
    serviceName?: string;
    serviceVersion?: string;
    /** Extra resource attributes (deployment env, tenant, etc.). */
    resourceAttributes?: Record<string, unknown>;
}
/**
 * Build the full OTLP/HTTP JSON payload. The default export endpoint for
 * OTLP/HTTP is `/v1/traces`; the exporter prepends the configured base URL.
 */
export declare function buildOtlpPayload(input: BuildPayloadInput): OtlpResourceSpansPayload;
/**
 * Mint a 32-char hex trace id from a string seed (process id + start
 * time, typically). Stable for the life of the process.
 */
export declare function mintTraceId(seed: string): string;
//# sourceMappingURL=openinference.d.ts.map