/** Minimal OTel span interface used for dynamic import compatibility. */
export interface OtelSpan {
    setAttribute(key: string, value: string | number | boolean): void;
    recordException(error: Error | {
        message: string;
    }): void;
    setStatus(status: {
        code: number;
        message?: string;
    }): void;
    addEvent(name: string, attributes?: Record<string, string | number | boolean>): void;
    end(): void;
}
/** Minimal OTel API interface used for dynamic import compatibility. */
export interface OtelApi {
    trace: {
        getTracer(name: string, version?: string): OtelApiTracer;
        getActiveSpan(): OtelSpan | undefined;
    };
    SpanStatusCode: {
        OK: number;
        ERROR: number;
        UNSET: number;
    };
}
/** Minimal OTel tracer interface used for dynamic import compatibility. */
export interface OtelApiTracer {
    startSpan(name: string, options?: {
        attributes?: Record<string, string | number | boolean>;
    }): OtelSpan;
    startActiveSpan<T>(name: string, fn: (span: OtelSpan) => T): T;
}
/** Configuration for the OpenTelemetry exporter and tracer. */
export interface OtelConfig {
    /** Whether OTel export is enabled. Defaults to false (no-op). */
    enabled: boolean;
    /** OTLP exporter endpoint. E.g. http://localhost:4318 (OTLP/HTTP) or grpc://localhost:4317 */
    endpoint?: string;
    /** Sampling rate between 0 (never) and 1 (always). Default: 1.0 */
    samplingRate: number;
    /** Additional resource attributes to attach to every span. */
    resourceAttributes?: Record<string, string>;
    /** Service name reported to the OTel backend. Default: planu-mcp-server */
    serviceName: string;
    /** Service version reported to the OTel backend. */
    serviceVersion?: string;
}
/** Attributes attached to a span. Values must be primitives. */
export type SpanAttributes = Record<string, string | number | boolean>;
/** Status of a finished span. */
export type SpanStatus = 'ok' | 'error' | 'unset';
/** A minimal, serializable representation of an OTel span used in tests and internal tracking. */
export interface SpanContext {
    traceId: string;
    spanId: string;
    name: string;
    startTime: number;
    endTime?: number;
    attributes: SpanAttributes;
    status: SpanStatus;
    errorMessage?: string;
}
/** Handle for a started span. Implementations must be safe to call after end(). */
export interface SpanHandle {
    /** Set an attribute on the span. No-op after end(). */
    setAttribute(key: string, value: string | number | boolean): void;
    /** Record an error on the span. No-op after end(). */
    recordError(error: Error | string): void;
    /** End the span with the given status. Idempotent. */
    end(status?: SpanStatus): void;
}
/** Core tracer interface — the only abstraction used in engine and tools. */
export interface Tracer {
    /** Start a new root span (no parent). Returns a SpanHandle. */
    startSpan(name: string, attributes?: SpanAttributes): SpanHandle;
    /** Start a child span nested under the given parent. Falls back to root span if parent is null. */
    startChildSpan(name: string, parent: SpanHandle | null, attributes?: SpanAttributes): SpanHandle;
    /** Record a counter metric increment. Fire-and-forget. */
    recordCounter(name: string, value?: number, attributes?: SpanAttributes): void;
    /** Record a histogram observation (e.g. duration). Fire-and-forget. */
    recordHistogram(name: string, value: number, attributes?: SpanAttributes): void;
}
/** Supported metric instrument types. */
export type MetricKind = 'counter' | 'histogram' | 'gauge';
/** Definition of a custom metric used by the observability module. */
export interface MetricDefinition {
    name: string;
    kind: MetricKind;
    description: string;
    unit?: string;
}
/** Input for the configure_observability tool. */
export interface ConfigureObservabilityInput {
    /** Whether to enable OTel exporting. Pass false to disable. */
    enabled?: boolean;
    /** OTLP exporter endpoint URL. */
    endpoint?: string;
    /** Sampling rate 0..1. 1 = trace every call. 0 = trace nothing. */
    samplingRate?: number;
    /** Extra resource attributes (key=value pairs). */
    resourceAttributes?: Record<string, string>;
    /** Service name for the OTel resource. */
    serviceName?: string;
}
//# sourceMappingURL=observability.d.ts.map