/** * Observability module for browser-use * * This module provides observability decorators that optionally integrate with lmnr (Laminar) for tracing. * If lmnr is not installed, it provides no-op wrappers that accept the same parameters. * * Features: * - Optional lmnr integration - works with or without lmnr installed * - Debug mode support - observe_debug only traces when in debug mode * - Full parameter compatibility with lmnr observe decorator * - No-op fallbacks when lmnr is unavailable */ type SpanType = 'DEFAULT' | 'LLM' | 'TOOL'; interface ObserveOptions { name?: string; ignoreInput?: boolean; ignoreOutput?: boolean; metadata?: Record; spanType?: SpanType; [key: string]: any; } type MethodDecorator = (target: any, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; /** * Observability decorator that traces function execution when lmnr is available. * * This decorator will use lmnr's observe decorator if lmnr is installed, * otherwise it will be a no-op that accepts the same parameters. * * @param options - Observability configuration options * @returns Decorated function that may be traced depending on lmnr availability * * @example * ```typescript * @observe({ name: "my_function", metadata: { version: "1.0" } }) * function myFunction(param1: string, param2: number): string { * return param1 + param2; * } * ``` */ export declare function observe(options?: ObserveOptions): MethodDecorator; /** * Debug-only observability decorator that only traces when in debug mode. * * This decorator will use lmnr's observe decorator if both lmnr is installed * AND we're in debug mode, otherwise it will be a no-op. * * Debug mode is determined by: * - LMNR_LOGGING_LEVEL environment variable set to 'debug' * * @param options - Observability configuration options * @returns Decorated function that may be traced only in debug mode * * @example * ```typescript * @observeDebug({ * name: "debug_function", * ignoreInput: true, * ignoreOutput: true, * metadata: { debug: true } * }) * function debugFunction(param1: string, param2: number): string { * return param1 + param2; * } * ``` */ export declare function observeDebug(options?: ObserveOptions): MethodDecorator; /** * Function-style observability wrapper for non-decorator usage * * @param fn - Function to wrap * @param options - Observability configuration options * @returns Wrapped function that may be traced depending on lmnr availability */ export declare function observeFunction any>(fn: T, options?: ObserveOptions): T; /** * Debug-only function-style observability wrapper * * @param fn - Function to wrap * @param options - Observability configuration options * @returns Wrapped function that may be traced only in debug mode */ export declare function observeDebugFunction any>(fn: T, options?: ObserveOptions): T; /** * Check if lmnr is available for tracing */ export declare function isLmnrAvailable(): boolean; /** * Check if we're currently in debug mode */ export declare function isDebugModeActive(): boolean; /** * Get the current status of observability features */ export declare function getObservabilityStatus(): { lmnrAvailable: boolean; debugMode: boolean; observeActive: boolean; observeDebugActive: boolean; }; export type { ObserveOptions, SpanType }; //# sourceMappingURL=index.d.ts.map