/** * Graph performance profile writer. * * The CLI already emits structured stage progress for the live view and spans * for telemetry. This module turns the same progress stream into a portable * JSON artifact users can attach to performance reports without enabling an * OpenTelemetry SDK. */ import type { GraphProgressEvent } from './orchestrate/types.js'; import type { RunGraphResult } from './orchestrate.js'; import type { ResolutionMode } from '../types.js'; export interface GraphProfileStage { readonly name: string; readonly status: 'done' | 'cached'; readonly durationMs?: number; readonly detail?: string; } export interface GraphProfileRunSummary { readonly cacheHit?: boolean; readonly files?: number; readonly functions?: number; readonly signals?: number; readonly totalCallSites?: number; readonly resolvedHigh?: number; readonly resolvedMedium?: number; readonly resolvedLow?: number; readonly unresolved?: number; readonly boundaryCallSites?: number; readonly shardCount?: number; readonly shardsBuilt?: number; readonly shardsCached?: number; readonly shardSizes?: readonly number[]; } export interface GraphProfileRun { readonly label: string; readonly cwd: string; readonly mode: string; readonly startedAt: string; completedAt?: string; durationMs?: number; readonly stages: GraphProfileStage[]; summary?: GraphProfileRunSummary; } export interface GraphProfileDocument { readonly version: '1.0'; readonly tool: 'graph'; readonly cwd: string; readonly mode: string; readonly resolutionMode?: ResolutionMode; readonly startedAt: string; completedAt?: string; durationMs?: number; readonly runs: GraphProfileRun[]; } export declare class GraphProfileRunRecorder { private readonly run; private readonly activeStages; private readonly startedMs; constructor(run: GraphProfileRun); readonly onProgress: (event: GraphProgressEvent) => void; recordStage(name: string, durationMs?: number, detail?: string): void; finish(result: RunGraphResult): void; finishSummary(summary: GraphProfileRunSummary): void; } export declare class GraphProfileBuilder { private readonly startedMs; private readonly document; constructor(input: { readonly cwd: string; readonly mode: string; readonly resolutionMode?: ResolutionMode; readonly startedAt?: string; }); startRun(input: { readonly label: string; readonly cwd: string; readonly mode: string; }): GraphProfileRunRecorder; complete(): GraphProfileDocument; } export declare function writeGraphProfile(outputPath: string, cwd: string, profile: GraphProfileDocument): string; //# sourceMappingURL=profile.d.ts.map