/**
 * CLI Contract helpers — enforce JSON-mode stdout purity and typed command results.
 *
 * Rules:
 * - --json → stdout is exactly one JSON document, no banners/ANSI/human text.
 * - Human diagnostics go to stderr only.
 * - Command functions must NOT call process.exit; they throw CliError or return CommandResult.
 * - Only src/cli.ts adapters set process.exitCode.
 */
export interface CommandResult<T = void> {
    ok: boolean;
    exitCode: number;
    data?: T;
    diagnostics?: string[];
}
export declare class CliError extends Error {
    readonly exitCode: number;
    readonly diagnostics?: string[] | undefined;
    constructor(message: string, exitCode?: number, diagnostics?: string[] | undefined);
}
export declare class UsageError extends CliError {
    constructor(message: string, diagnostics?: string[]);
}
export declare class NotFoundError extends CliError {
    constructor(message: string, diagnostics?: string[]);
}
export declare class VerificationError extends CliError {
    constructor(message: string, diagnostics?: string[]);
}
export declare class InterruptedError extends CliError {
    constructor(message?: string);
}
/** Emit a single JSON document to stdout. */
export declare function emitJson(data: unknown): void;
/** Emit error: JSON to stdout (in JSON mode), human text to stderr (always). */
export declare function emitError(message: string, json: boolean, jsonPayload?: Record<string, unknown>): void;
/** Build a successful CommandResult. */
export declare function successResult<T>(data?: T): CommandResult<T>;
/** Build a failed CommandResult. */
export declare function failureResult(exitCode: number, diagnostics?: string[]): CommandResult;
/** Adapter: convert a CommandResult to CLI exit code. Does NOT call process.exit. */
export declare function applyExitCode(result: CommandResult): void;
/** Returns true when stdout should be JSON-only (no ANSI, no human text). */
export declare function isJsonMode(options: {
    json?: boolean;
}): boolean;
