/** * Operation tracing system. * * Provides step-by-step tracing for all operations across CLI, MCP, and SDK. * - **CLI mode**: Logs to stderr with chalk colors (no spinners in trace) * - **MCP mode**: Collects steps silently, returns in response * - **SDK mode**: Fires callback if provided, otherwise collects * * @module */ /** * A single trace step. */ export interface ITraceStep { /** Timestamp */ ts: string; /** Step label */ step: string; /** Duration in ms (filled after completion) */ durationMs?: number; /** Optional detail */ detail?: string; } /** * Complete operation trace. */ export interface IOperationTrace { /** Operation name */ operation: string; /** All steps */ steps: ITraceStep[]; /** Total duration */ totalMs: number; /** Whether operation succeeded */ success: boolean; /** Error message if failed */ error?: string; } /** * Callback for real-time trace updates. */ export type TraceCallback = (step: string, detail?: string) => void; /** Detect if running as MCP server (stdout is the transport). */ export declare function isMcpMode(): boolean; /** * Operation tracer that collects steps. */ export declare class OperationTracer { readonly operation: string; private steps; private startTime; private stepStart; private onStep?; constructor(operation: string, onStep?: TraceCallback); /** * Records a trace step. * * @param step - Step description * @param detail - Optional detail */ step(step: string, detail?: string): void; /** * Finalizes the trace. * * @param success - Whether operation succeeded * @param error - Error message if failed * @returns Complete operation trace */ finish(success: boolean, error?: string): IOperationTrace; } //# sourceMappingURL=trace.d.ts.map