import { Fallback, TableOptions } from "../schema/activity.mjs"; //#region src/core/output/contracts.d.ts /** Ordered output verbosity levels owned by the output policy layer. */ declare const OUTPUT_VERBOSITY_LEVELS: readonly ["normal", "quiet"]; /** Stable output text streams. */ declare const OUTPUT_STREAMS: readonly ["stdout", "stderr"]; /** Stable activity rendering modes. */ declare const ACTIVITY_RENDER_MODES: readonly ["noop", "static", "tty", "capture"]; /** Stable activity cleanup actions. */ declare const ACTIVITY_CLEANUP_KINDS: readonly ["none", "stop", "done"]; /** Stable text verbosity labels. */ type Verbosity = (typeof OUTPUT_VERBOSITY_LEVELS)[number]; /** Stable output stream labels. */ type OutputStream = (typeof OUTPUT_STREAMS)[number]; /** Stable activity-render labels. */ type ActivityRenderMode = (typeof ACTIVITY_RENDER_MODES)[number]; /** Stable cleanup labels for tracked activity handles. */ type ActivityCleanupKind = (typeof ACTIVITY_CLEANUP_KINDS)[number]; /** Semantic output facts chosen before concrete rendering begins. */ interface OutputPolicy { /** Whether `--json` was requested, routing structured data to stdout. */ readonly jsonMode: boolean; /** Whether the output stream is connected to an interactive terminal. */ readonly isTTY: boolean; /** Active verbosity level controlling which message categories emit. */ readonly verbosity: Verbosity; } /** Inputs for building an {@linkcode OutputPolicy} snapshot. */ interface ResolveOutputPolicyOptions { /** Whether `--json` was requested on the command line. */ readonly jsonMode: boolean; /** Whether the output stream is connected to an interactive terminal. */ readonly isTTY: boolean; /** Verbosity level to apply for this channel instance. */ readonly verbosity: Verbosity; } /** Concrete activity policy chosen for spinner/progress creation. */ interface ActivityPolicy { /** Render strategy for the activity indicator (never `'capture'` here). */ readonly mode: Exclude; /** Activity output always targets stderr to avoid polluting structured stdout. */ readonly stream: 'stderr'; /** Cleanup action the output layer must run when the handle is discarded. */ readonly cleanup: ActivityCleanupKind; } /** Stable output-policy facts the re-foundation workstream is freezing. */ interface OutputContract { /** In JSON mode, stdout carries only machine-readable structured output. */ readonly jsonReservesStdoutForStructuredData: true; /** Quiet verbosity suppresses `info()` messages entirely. */ readonly quietSuppressesInfo: true; /** Spinner/progress writes go to stderr so stdout stays parseable. */ readonly activityUsesStderrOutsideCapture: true; /** Animated TTY spinners require both a real terminal and non-JSON mode. */ readonly ttyActivityRequiresTTYAndNonJson: true; /** Spinner handles clean up via `stop()` to clear the animation line. */ readonly spinnerCleanupUsesStop: true; /** Progress handles clean up via `done()` to render the final state. */ readonly progressCleanupUsesDone: true; } /** Runtime-accessible copy of the frozen output-policy invariants. */ declare const outputContract: { jsonReservesStdoutForStructuredData: true; quietSuppressesInfo: true; activityUsesStderrOutsideCapture: true; ttyActivityRequiresTTYAndNonJson: true; spinnerCleanupUsesStop: true; progressCleanupUsesDone: true; }; /** Build the stable output-policy snapshot for one channel instance. */ declare function resolveOutputPolicy(options: ResolveOutputPolicyOptions): OutputPolicy; /** Resolve the default text stream for non-JSON structured output. */ declare function resolveTextStream(policy: OutputPolicy): OutputStream; /** Whether `info()`/`status()` messages should be emitted under the current policy. */ declare function shouldEmitInfo(policy: OutputPolicy): boolean; /** Resolve the concrete table format under the current policy. */ declare function resolveTableFormat(policy: OutputPolicy, options?: TableOptions): 'text' | 'json'; /** Resolve the text-table stream after table-format selection. */ declare function resolveTableTextStream(policy: OutputPolicy, options?: TableOptions): OutputStream; /** Resolve the non-capture activity mode shared by spinner and progress. */ declare function resolveActivityRenderMode(policy: OutputPolicy, fallback: Fallback): ActivityPolicy['mode']; /** Resolve spinner activity policy including cleanup ownership. */ declare function resolveSpinnerPolicy(policy: OutputPolicy, fallback: Fallback): ActivityPolicy; /** Resolve progress activity policy including cleanup ownership. */ declare function resolveProgressPolicy(policy: OutputPolicy, fallback: Fallback): ActivityPolicy; //#endregion export { ACTIVITY_CLEANUP_KINDS, ACTIVITY_RENDER_MODES, type ActivityCleanupKind, type ActivityPolicy, type ActivityRenderMode, OUTPUT_STREAMS, OUTPUT_VERBOSITY_LEVELS, type OutputContract, type OutputPolicy, type OutputStream, type ResolveOutputPolicyOptions, type Verbosity, outputContract, resolveActivityRenderMode, resolveOutputPolicy, resolveProgressPolicy, resolveSpinnerPolicy, resolveTableFormat, resolveTableTextStream, resolveTextStream, shouldEmitInfo };