import { z } from "zod"; import type { LeaksReport, NextCallSuggestion } from "../types.js"; /** * Cycle-scoped reachability + class counting. * * Answers questions like: * "How many `NSURLSessionConfiguration` instances are reachable from the * cycle rooted at `DetailViewModel`?" * * Where global `countAlive` would say "4495 NSURLSessionConfiguration", this * tool says "1100 reachable from each of the 4 cycles, so the cycle root is * the actual culprit pinning them in memory." * * API shape inspired by Meta's `memlab` predicate-based queries. */ export declare const reachableFromCycleSchema: z.ZodObject<{ path: z.ZodString; cycleIndex: z.ZodOptional; rootClassName: z.ZodOptional; className: z.ZodOptional; topN: z.ZodDefault; verbosity: z.ZodDefault>; }, "strip", z.ZodTypeAny, { path: string; verbosity: "compact" | "normal" | "full"; topN: number; className?: string | undefined; cycleIndex?: number | undefined; rootClassName?: string | undefined; }, { path: string; className?: string | undefined; cycleIndex?: number | undefined; verbosity?: "compact" | "normal" | "full" | undefined; topN?: number | undefined; rootClassName?: string | undefined; }>; export type ReachableFromCycleInput = z.infer; export interface ClassCount { className: string; count: number; } export interface ReachableFromCycleResult { ok: boolean; path: string; /** The cycle that was scoped to. */ cycle: { index: number; rootClass: string; rootAddress: string; /** Total reachable nodes from this cycle root (including descendants). */ totalReachable: number; }; /** When `className` filter is provided, only that class shows up. Otherwise top N. */ counts: ClassCount[]; /** Total unique classes in the cycle's reachable set. */ uniqueClasses: number; /** Pipeline hint — locate the cycle root in source code. */ suggestedNextCalls?: NextCallSuggestion[]; } /** Pure: compute the result from a parsed report. Exposed for testing. */ export declare function reachableFromReport(report: LeaksReport, path: string, input: ReachableFromCycleInput): ReachableFromCycleResult; export declare function reachableFromCycle(input: ReachableFromCycleInput): Promise;