/** * Human reporter: Capistrano-style lifecycle lines and live command streaming. * * @param {{showCommands?: boolean}} [opts] * @returns {Reporter} */ export function humanReporter({ showCommands }?: { showCommands?: boolean; }): Reporter; /** * JSON/automation reporter: no lifecycle lines and no streamed command output, * so the only thing a caller writes is the final JSON payload. * * @returns {Reporter} */ export function jsonReporter(): Reporter; /** * @file Explicit deploy output-mode reporter. * * A reporter is threaded through the deploy path so that command lifecycle * progress is printed in human mode while command output is routed either to a * deploy log or, when logging is disabled, to live stderr. Both stay suppressed * in `--json` automation mode. It is passed explicitly instead of relying on a * global output flag, so callers control their stdout/stderr contract. */ /** * @name Reporter * @description Output-mode object controlling lifecycle and streamed output. */ export class Reporter { /** * @param {{lifecycle?: boolean, streamCommands?: boolean, conciseCommandErrors?: boolean, showCommands?: boolean, out?: import('node:stream').Writable, err?: import('node:stream').Writable, logStream?: import('node:stream').Writable|null}} [opts] */ constructor({ lifecycle, streamCommands, conciseCommandErrors, showCommands, out, err, logStream }?: { lifecycle?: boolean; streamCommands?: boolean; conciseCommandErrors?: boolean; showCommands?: boolean; out?: import("node:stream").Writable; err?: import("node:stream").Writable; logStream?: import("node:stream").Writable | null; }); /** @type {boolean} */ lifecycleEnabled: boolean; /** @type {boolean} */ streamCommands: boolean; /** @type {boolean} */ conciseCommandErrors: boolean; /** @type {boolean} */ showCommands: boolean; /** @type {import('node:stream').Writable} */ out: import("node:stream").Writable; /** @type {import('node:stream').Writable} */ err: import("node:stream").Writable; /** * Optional persistent per-deploy log. When attached, every lifecycle line * and streamed command chunk is written here so a full deploy transcript * survives without flooding the human console. * * @type {import('node:stream').Writable|null} */ logStream: import("node:stream").Writable | null; /** * Whether live command stdout/stderr should be streamed as it arrives. * * @returns {boolean} */ get streamsCommands(): boolean; /** * Whether the transport should feed redacted command output to the reporter at * all — either to live-stream it or to persist it to the deploy log. This is * decoupled from {@link streamsCommands} so a `--json` deploy still records a * full command transcript in its log even though nothing is streamed live. * * @returns {boolean} */ get capturesCommands(): boolean; /** * Attaches a persistent per-deploy log stream after construction. The deploy * command builds the reporter before the config (and therefore the log path) * is known, so the log is tee'd in once resolved. * * @param {import('node:stream').Writable|null} stream * @returns {void} */ attachLogStream(stream: import("node:stream").Writable | null): void; /** * Selects the deploy-log output contract: child output is retained in the log * and transport failures keep diagnostics as structured error fields instead * of repeating them in the human-facing message. * * @param {import('node:stream').Writable} stream * @returns {void} */ useDeployLog(stream: import("node:stream").Writable): void; /** * Prints a Capistrano-style lifecycle line in human mode; no-op otherwise. * The line is always tee'd to the persistent log (when attached) so the log * stays readable even for a `--json` automation deploy. * * @param {string} message * @returns {void} */ line(message: string): void; /** * Writes detail only to the persistent deploy log. * * @param {string} message * @returns {void} */ log(message: string): void; /** * Records a full already-redacted shell command in the deploy log when one * exists, or in lifecycle output for a human command without a log. * * @param {string} command * @returns {void} */ command(command: string): void; /** * Reports one timed lifecycle step and annotates failures with the first, * most-specific step label. * * @template T * @param {string} label * @param {() => Promise} operation * @returns {Promise} */ step(label: string, operation: () => Promise): Promise; /** * Records already-redacted command output. It is always tee'd to the deploy * log when one is attached, so the log is a full transcript regardless of * output mode. It is streamed live to the error stream only when * {@link streamsCommands} is set (human mode) — the error stream keeps human * stdout reserved for lifecycle progress and JSON stdout clean. * * @param {string} text * @returns {boolean} Backpressure signal: `false` asks the caller to pause. Only the live stream can request a pause; log-only writes never do. */ writeCommandOutput(text: string): boolean; } //# sourceMappingURL=reporter.d.ts.map