import "./node-require-shim.js"; import { configureTheme } from "toolcraft-design"; import type { Command, Group, HandlerFs, LogLevel, RenderPrimitives, RuntimeLoggerInput } from "./index.js"; import { type ErrorReportsOption } from "./error-report.js"; import type { HumanInLoopRuntime } from "./human-in-loop/types.js"; export { renderErrorReport } from "./error-report.js"; export type { ErrorReportRenderContext, ErrorReportRenderResult } from "./error-report.js"; export { configureTheme }; type Casing = "kebab" | "snake"; export type CLIHelpDepth = "concise" | "extended"; export interface CLIControls { debug?: boolean; /** * Group `--help` depth. `extended` (default) lists every nested action under the * help target; `concise` lists only direct children. */ help?: CLIHelpDepth; logLevel?: boolean; output?: boolean | CLIOutputControl; verbose?: boolean; yes?: boolean; } export interface CLIOutputFormatContext { command: Command; commandPath: string; primitives: RenderPrimitives; result: unknown; } export type CLIOutputFormatRenderer = (context: CLIOutputFormatContext) => string | undefined; export type CLIOutputFormats = Readonly>; export interface CLIOutputControl { formats?: CLIOutputFormats; } export interface RunCLIOptions> { apiVersion?: string; approvals?: boolean; argv?: readonly string[]; casing?: Casing; controls?: CLIControls; env?: Record; fetch?: typeof globalThis.fetch; fs?: HandlerFs; humanInLoop?: HumanInLoopRuntime; logLevel?: LogLevel; logger?: RuntimeLoggerInput; outputEmitter?: (entry: string) => void; promptInput?: NodeJS.ReadableStream; promptOutput?: NodeJS.WritableStream; projectRoot?: string; rootDisplayName?: string; rootUsageName?: string; services?: TServices; version?: string; presets?: boolean; errorReports?: ErrorReportsOption; } export interface CLICommandTreeSnapshotOption { name: string; flags: string[]; type: string; required: boolean; hidden: boolean; description?: string; default?: unknown; positional?: boolean; global?: boolean; dynamic?: boolean; choices?: string[]; } export interface CLICommandTreeSnapshotCommand { kind: "command"; name: string; path: string[]; aliases: string[]; hidden: boolean; default: boolean; description?: string; options: CLICommandTreeSnapshotOption[]; } export interface CLICommandTreeSnapshotGroup { kind: "group"; name: string; path: string[]; aliases: string[]; hidden: false; default: boolean; description?: string; children: CLICommandTreeSnapshotNode[]; } export type CLICommandTreeSnapshotNode = CLICommandTreeSnapshotCommand | CLICommandTreeSnapshotGroup; export interface CLICommandTreeSnapshot { schemaVersion: 1; globalOptions: CLICommandTreeSnapshotOption[]; root: CLICommandTreeSnapshotGroup; } export interface CLICommandTreeSnapshotOptions { approvals?: boolean; argv?: readonly string[]; casing?: Casing; controls?: CLIControls; humanInLoop?: HumanInLoopRuntime; presets?: boolean; version?: string; } /** * Returns the resolved CLI command surface as deterministic plain data. * * Schema version 1 is independent of human-facing help layout. Nodes and options retain * declaration order, paths exclude the root name, non-CLI nodes are omitted, hidden commands * remain present, and Toolcraft-controlled global options are reported separately. A future * incompatible shape change will increment `schemaVersion`. */ export declare function createCLICommandTreeSnapshot(roots: Group | Group[], options?: CLICommandTreeSnapshotOptions): Promise; export declare function runCLI>(roots: Group | Group[], options?: RunCLIOptions): Promise;