/** * profile-heap — RFC 0002 Phase 1 entry point. * * A thin wrapper around `analyze` that flips on the heap-profile * instrumentation already living in `runFullAnalysis`, then prints a * per-phase RSS / heapUsed summary table after the run finishes. * * Why a dedicated subcommand instead of just documenting the env var? * - Discoverability: `codragraph --help` lists it next to `analyze`. * - One-shot UX: users (and the maintainer) get a useful summary table * without having to spelunk through Chrome DevTools to compare * snapshots. The `.heapsnapshot` files are still written for deep * dives; the summary just makes the cheap signal (RSS curve, heapUsed * curve) visible at a glance. * - Phase 1 of RFC 0002 is profile-first by design — we ship the tool * before any mitigation. Don't add compression, eviction, or streaming * refactors here; that's Phase 2+ once we know which phase is the * actual bottleneck. * * Side effects: writes `.codragraph/heap-profiles/-.heapsnapshot` * (one per phase boundary, ~100-500MB each) plus a small * `profile-summary.jsonl` timeline. Disk usage adds up fast on large * repos — clean up between runs if you don't need the raw snapshots. */ import { type AnalyzeOptions } from './analyze.js'; export interface ProfileHeapOptions extends AnalyzeOptions { /** * Commander injects this from the `--no-summary` flag — see CLI * registration. `--no-summary` ⇒ `summary === false`. The dual-name * convention (positive flag name, negated value) is a commander * footgun: a `noSummary?: boolean` field would silently never fire. */ summary?: boolean; } export declare const profileHeapCommand: (inputPath?: string, options?: ProfileHeapOptions) => Promise;