/** * WorkTreeUI — Terminal renderer for WorkTree hierarchies * * Renders a WorkTree as an ASCII/Unicode tree with: * - Box-drawing connectors (├─, └─, │) * - Status icons and color-coding * - Progress bars per branch node * - Token counts * - Agent assignments * - Live auto-refresh mode via WorkTree events * * Zero external dependencies — uses the {@link ansi} helpers from ConsoleUI. * * @module WorkTreeUI * @version 1.0.0 */ import { EventEmitter } from 'events'; import type { WorkTree, WorkTreeStats } from './work-tree'; /** Render options for WorkTreeUI */ export interface WorkTreeUIOptions { /** Output stream (default: process.stdout) */ output?: NodeJS.WritableStream; /** Show token counts (default: true) */ showTokens?: boolean; /** Show agent assignments (default: true) */ showAgents?: boolean; /** Show progress bars (default: true) */ showProgress?: boolean; /** Show stats footer (default: true) */ showStats?: boolean; /** Progress bar width in characters (default: 10) */ progressBarWidth?: number; /** Use color output (default: true) */ useColor?: boolean; /** Indent size per depth level (default: 2) */ indentSize?: number; /** Title override (default: root label) */ title?: string; /** Compact mode — hide nodes at depth > maxDepth (default: Infinity) */ maxDepth?: number; /** Auto-refresh on WorkTree events (default: false) */ live?: boolean; } /** Column-aligned render result for programmatic use */ export interface RenderResult { /** The rendered tree as a single string */ text: string; /** Number of lines rendered */ lineCount: number; /** Stats snapshot at render time */ stats: WorkTreeStats; } /** * Terminal renderer for {@link WorkTree} hierarchies. * * ```typescript * const tree = new WorkTree('root', 'My Project'); * // ... add children, set statuses ... * * const ui = new WorkTreeUI(tree); * ui.render(); // print to stdout * * const result = ui.toString(); // get as string * * ui.startLive(); // auto-refresh on changes * ui.stopLive(); * ``` */ export declare class WorkTreeUI extends EventEmitter { private readonly tree; private readonly opts; private liveCleanup; private lastLineCount; constructor(tree: WorkTree, options?: WorkTreeUIOptions); /** * Render the tree to the output stream. * In live mode this clears previous output first. */ render(): RenderResult; /** * Return the rendered tree as a string (no side effects). */ toString(): string; /** * Start live mode — auto-refresh whenever the tree changes. */ startLive(): void; /** * Stop live mode. */ stopLive(): void; /** * Clean up resources. */ destroy(): void; private buildRender; private renderNode; private renderProgressBar; private renderStatsLine; private renderTokenLine; private renderOverallProgress; private isLastSibling; private style; private formatTokens; private write; } //# sourceMappingURL=work-tree-ui.d.ts.map