/** * Lightweight OTel adapter. Doesn't pull in `@opentelemetry/api` directly — * the user passes their already-initialized OTel Tracer through, and this * wrapper translates our minimal Span surface onto theirs. * * Usage: * import { trace } from '@opentelemetry/api'; * const tracer = trace.getTracer('wrongstack', '1.0'); * const wrappedTracer = new OTelTracer(tracer); * // pass `wrappedTracer` as Agent.tracer / ToolExecutor.tracer. * * The shape of the upstream Tracer is intentionally typed loosely so we * don't need a build-time dependency. Anything OTel-compatible works, * including OpenInference, Tempo, etc. */ import type { Span as WStackSpan, Tracer as WStackTracer } from '../types/observability.js'; interface OTelLikeSpan { setAttribute(key: string, value: string | number | boolean): unknown; recordException(err: { message: string; stack?: string | undefined; name?: string | undefined; }): unknown; setStatus?(status: { code: number; message?: string | undefined; }): unknown; end(): unknown; } interface OTelLikeTracer { startSpan(name: string, options?: { attributes?: Record; }): OTelLikeSpan; } export declare class OTelTracer implements WStackTracer { private readonly upstream; constructor(upstream: OTelLikeTracer); startSpan(name: string, attrs?: Record): WStackSpan; } export {}; //# sourceMappingURL=otel-tracer.d.ts.map