/** * CLI context renderer (Phase 40 / PH40-03). * * Pure formatting helpers used by every CLI command's handler to produce * deterministic, terminal-safe output. No I/O — handlers decide whether * to write to stdout, stderr, or buffer the result. * * Four primitives: * - {@link renderError} — apply the `[Hivemind]` prefix policy * - {@link renderJson} — deterministic indented JSON * - {@link renderTable} — fixed-width column table for human-readable * output, with empty-data marker * - {@link renderHelp} — `help` listing for a registered command set * * Output is intentionally ASCII-only (no boxing characters) so it stays * readable in CI logs, redirected files, and terminals without * Unicode-aware fonts. */ import type { CliCommand } from "./router.js"; /** * Apply the `[Hivemind]` prefix policy to an error message. * * If the message already starts with `[Hivemind]` (case-sensitive, * matching how thrown errors are constructed throughout the codebase) it * is returned untouched — otherwise the prefix is prepended with a single * space separator. */ export declare function renderError(message: string): string; /** * Render a value as deterministic, indented JSON with a trailing newline * trimmed off. Object key order is determined by `JSON.stringify`'s * default (insertion order); callers wanting stable order across runs * should pre-sort. */ export declare function renderJson(value: unknown): string; /** * Render a fixed-width text table. Every row must have exactly the same * arity as the header; otherwise a `[Hivemind]`-prefixed error is thrown * (catches programming bugs early). * * Columns are right-padded to the max width of any value in that column, * separated by two spaces. Output is the header row followed directly * by data rows joined with `\n` (no separator line — kept minimal so * downstream `grep` / `awk` pipelines stay simple). When `rows` is * empty, a `(no rows)` marker is returned instead of an empty string * so callers don't print blank output. */ export declare function renderTable(header: readonly string[], rows: readonly (readonly string[])[]): string; /** * Render a human-readable command listing for the `help` command. Each * command line shows the command name (with alias hint when present) and * its summary, padded into two columns. Returns a placeholder when no * commands are registered so callers don't print blank output. */ export declare function renderHelp(commands: readonly CliCommand[]): string; export type { CliCommand }; //# sourceMappingURL=renderer.d.ts.map