import { z } from "zod"; import type { AnalyzeTraceOptions, DataStatus, SupportStatus } from "../types.js"; export declare const analyzeTimeProfileSchema: z.ZodObject<{ tracePath: z.ZodString; topN: z.ZodDefault; outputFormat: z.ZodOptional>; }, "strip", z.ZodTypeAny, { tracePath: string; topN: number; outputFormat?: "markdown" | "json" | "both" | "verify-fix-table" | undefined; }, { tracePath: string; outputFormat?: "markdown" | "json" | "both" | "verify-fix-table" | undefined; topN?: number | undefined; }>; export type AnalyzeTimeProfileInput = z.infer; export interface SampleEntry { weight?: number; weightFmt?: string; threadName?: string; symbol?: string; /** Binary name for the leaf frame (e.g. "CoreFoundation", "libsystem_kernel.dylib"). Useful when the symbol is an unsymbolicated hex address. */ binary?: string; } export interface AnalyzeTimeProfileResult { ok: boolean; tracePath: string; totalSamples: number; /** Per-symbol aggregation, sorted by sample count descending. */ topSymbols: Array<{ symbol: string; samples: number; }>; /** Top N rows after the aggregation step (raw view). */ topRows: SampleEntry[]; /** * Optional notice explaining a known limitation * (e.g. xctrace crashed exporting the time-profile schema). * * @deprecated v1.14 item I. The same information now flows through * `supportStatus[0].reason`. Kept for backwards compat. */ notice?: string; diagnosis: string; /** * Disambiguates empty arrays into "no data in the trace" vs "trace * could not be exported" vs "data was exported partially". Agents * should branch on this rather than `totalSamples === 0`. * * @deprecated v1.14 item I. Use `supportStatus[]` instead. */ status: DataStatus; /** v1.14+. Unified per-area status. See {@link SupportStatus}. */ supportStatus: SupportStatus[]; } /** * Pure analysis from a chunk of xctrace XML. Aggregates sample counts per * symbol when symbols are available; otherwise reports raw row count. */ export declare function analyzeTimeProfileFromXml(xml: string, tracePath: string, topN?: number): AnalyzeTimeProfileResult; export declare function analyzeTimeProfile(input: AnalyzeTimeProfileInput, options?: AnalyzeTraceOptions): Promise;