/**
 * Browser-safe observability utilities.
 *
 * Functions that depend on AsyncLocalStorage (getCurrentSpan, executeWithContext,
 * executeWithContextSync) are in context-storage.ts and should only be imported
 * by server-side code.
 */
import { EntityType, SpanType } from './types/index.js';
import type { Span, GetOrCreateSpanOptions, AnySpan } from './types/index.js';
/**
 * Creates or gets a child span from existing tracing context or starts a new trace.
 * This helper consolidates the common pattern of creating spans that can either be:
 * 1. Children of an existing span (when tracingContext.currentSpan exists)
 * 2. New root spans (when no current span exists)
 *
 * @param options - Configuration object for span creation
 * @returns The created Span or undefined if tracing is disabled
 */
export declare function getOrCreateSpan<T extends SpanType>(options: GetOrCreateSpanOptions<T>): Span<T> | undefined;
/**
 * Returns the top-most non-internal span that would appear in exported tracing output.
 *
 * Public API results should use this span for trace/span correlation because internal Mastra
 * workflow spans are omitted from external exporters.
 */
export declare function getRootExportSpan(span?: AnySpan): AnySpan | undefined;
/**
 * Resolves the best available entity type for a span-like record.
 *
 * Prefers an explicit `entityType` when present and valid, then falls back to the
 * span type for common observability entities.
 */
export declare function getEntityTypeForSpan(span: {
    entityType?: string | null;
    spanType?: SpanType | string | null;
}): EntityType | undefined;
//# sourceMappingURL=utils.d.ts.map