/** * Pure wave formatter — presentation-agnostic wave plan rendering. * * Exports {@link formatWaves} which renders an enriched wave array into one * of four output modes (rich, json, markdown, quiet) without importing any * CLI or platform-specific module. ANSI colors are injected by the caller * via the optional `colorize` callback so that this module remains * dependency-free of terminal utilities. * * @module */ import type { ColorStyle, FormatMode, FormatOpts } from './tree.js'; export type { ColorStyle, FormatMode, FormatOpts }; /** * A single task entry within an {@link EnrichedWave}. * * The `id` field is the only required property; all others are optional to * maintain backward compatibility with non-enriched wave responses that may * only carry string IDs. */ export interface WaveTask { /** Task identifier, e.g. `"T001"`. */ id: string; /** Human-readable task title. */ title?: string; /** Task status string, e.g. `"pending"`, `"active"`, `"done"`. */ status?: string; /** Task priority string, e.g. `"critical"`, `"high"`, `"medium"`, `"low"`. */ priority?: string; /** Open dependency IDs blocking this task. Present after T1199 enrichment. */ blockedBy?: string[]; /** * Whether the task is immediately actionable (no open deps, not yet done). * Present after T1199 enrichment. */ ready?: boolean; } /** * A single wave returned by `orchestrate.waves` / `deps waves`. * * Tasks may be either {@link WaveTask} objects (enriched) or plain strings * (non-enriched legacy format). */ export interface EnrichedWave { /** 1-based wave sequence number. */ waveNumber?: number; /** Aggregate status of the wave: `"pending"`, `"in_progress"`, or `"completed"`. */ status?: string; /** Tasks in this wave (enriched objects or plain IDs). */ tasks?: Array; /** * Plain task ID list — convenience alias for `tasks.map(t => t.id)`. * * Populated when the wave was produced by `getEnrichedWaves`. Orchestrators * that only need IDs can read this field without mapping over `tasks`. */ taskIds?: string[]; /** ISO timestamp when all tasks in the wave completed (enriched format). */ completedAt?: string; } /** * Format enriched wave data as a string in the requested mode. * * The function is pure — it has no side-effects and does not read from * `process.env` or the filesystem. All terminal concerns are delegated to * the caller through {@link FormatOpts.colorize}. * * @param data - Normalized response payload containing a `waves` array. * The key must be literally `"waves"`. * @param opts - Rendering options. All fields are optional. * @returns A formatted string in the requested mode, or a fallback * message / empty string when `data.waves` is absent. * * @example * // Rich mode — plain text (no colorize) * const plain = formatWaves({ waves }, { mode: 'rich' }); * * @example * // Rich mode — with ANSI color injection * const colored = formatWaves({ waves }, { * mode: 'rich', * colorize: (text, style) => applyAnsi(text, style), * }); * * @example * // JSON mode — machine-readable passthrough * const json = formatWaves({ waves }, { mode: 'json' }); * const parsed = JSON.parse(json); // { waves: [...] } * * @example * // Markdown mode — for GitHub issue comments * const md = formatWaves({ waves }, { mode: 'markdown' }); * * @example * // Quiet mode — \t per line, safe for awk / cut * const quiet = formatWaves({ waves }, { mode: 'quiet' }); */ export declare function formatWaves(data: { waves?: EnrichedWave[]; }, opts?: FormatOpts): string; //# sourceMappingURL=waves.d.ts.map