/** * graph-runner — owns the live-view state machine for `opensip-tools graph`. * * Layer 5 Phase 3 lifted the graph live view out of `opensip-tools`. * The state machine (loading → running → done | error), `runGraph` * orchestration, `buildUnifiedReportLines` post-call, and the Ink/React * render tree live here, in the package that owns the graph command * surface. Adding a fourth tool with a live view requires zero CLI * edits — each tool ships its own renderer and registers it via * `cli.registerLiveView(key, renderer)`. * * Progress rendering is the shared `` from * `@opensip-tools/cli-ui` (ADR-0016), driven in `phases` mode: graph's * 7 fixed pipeline stages map onto the universal `ProgressEvent` stream. * The former graph-local StageChecklist/StageLine/RunningStageLine are * gone. The transport is the in-process one — graph stays host-agnostic * (no subprocess), and the heavy `resolve` stage yields to the event loop * cooperatively (ADR-0016, `resolveEdgesFromRecords`), so the live spinner * animates and stages reveal progressively instead of freezing for the run. * * Single exit-code write path: error outcomes route through the * supplied `setExitCode` callback (`ToolCliContext.setExitCode`) so the * CLI keeps its only `process.exitCode` mutator. */ import type { GraphConfig, ResolutionMode, Rule } from '../types.js'; import type { DataStore } from '@opensip-tools/datastore'; interface GraphRunnerArgs { readonly cwd: string; readonly noCache?: boolean; /** * `--resolution`: edge resolution tier. Forwarded to `runGraph` so the * interactive default path (`graph --resolution fast` with no other * flags) actually runs the chosen tier instead of silently using exact. */ readonly resolution?: ResolutionMode; /** * `--verbose`: when true, show the detailed catalog / findings-by-rule * / entry-points blocks in the done view. Default (false) shows the * summary line + footer hint only, matching fit's default surface. */ readonly verbose?: boolean; /** `--quiet`: suppress the banner / project header / run header chrome, leaving * only the live progress, summary, and (when not verbose) footer hints — * parity with fit/sim. */ readonly quiet?: boolean; /** * The project's `graph:` config block (rule knobs like * `minCrossPackageDuplicatePackages`, `minDuplicateBodyLines`, * `entryPointHashes`). Forwarded to `runGraph` so the interactive * default path honors the SAME config as the `executeGraph` dispatch * path. */ readonly config?: GraphConfig; /** * `--recipe`: the resolved rule subset for this run. Resolved on the * dispatch seam (`tool.ts`, inside the entered RunScope) and forwarded * to `runGraph` so the interactive path honors `--recipe` for parity * with `executeGraph`. Absent ⇒ `runGraph` falls back to `currentRules()`. */ readonly rules?: readonly Rule[]; } export interface RenderGraphLiveOptions { readonly setExitCode?: (code: number) => void; } /** * Render the live `graph` view. Returns once the underlying Ink app exits. * * The graph tool's `register(cli)` wires this through * `cli.registerLiveView('graph', (args) => renderGraphLive(args, { ... }))`. * `setExitCode` is the single mutator path on `process.exitCode`; the * runner calls it for error outcomes so the CLI's exit-code seam stays * the only writer. */ export declare function renderGraphLive(args: GraphRunnerArgs, datastore?: DataStore, options?: RenderGraphLiveOptions): Promise; export {}; //# sourceMappingURL=graph-runner.d.ts.map