interface FindNearestConfigOpts { startDir?: string; stopDir?: string; filenames: string[]; } interface SubRepo { /** Relative path from repoRoot, e.g. "platform/kb-labs-core" */ path: string; /** Parent segment(s) — e.g. "platform"; empty string for flat layout */ category: string; /** Final directory name — e.g. "kb-labs-core" */ name: string; /** Absolute path on disk — convenience; equals path.join(repoRoot, path) */ absolutePath: string; } /** * @module @kb-labs/core-sys/output/types * Unified Output interface for KB Labs platform */ type VerbosityLevel = "quiet" | "normal" | "verbose" | "debug" | "inspect"; type OutputMode = "tty" | "pipe" | "ci"; type DebugFormat = "human" | "ai"; type OutputLogLevel = "trace" | "debug" | "info" | "warn" | "error" | "fatal"; interface OutputLogRecord { time: string; ts: string; level: OutputLogLevel; category?: string; msg: string; meta?: Record; } interface OutputLogSink { handle(record: OutputLogRecord): void | Promise; } interface OutputLogger { info(message: string, meta?: Record): void; warn(message: string, meta?: Record): void; error(message: string, error?: Error, meta?: Record): void; debug(message: string, meta?: Record): void; child(bindings: Record): OutputLogger; } /** * Spinner interface for progress indicators */ interface Spinner { start(): void; stop(): void; update(options: { text?: string; }): void; succeed(message?: string): void; fail(message?: string): void; } /** * Progress details for progress() method */ interface ProgressDetails { current?: number; total?: number; message?: string; [key: string]: unknown; } /** * Error options for error() method */ interface ErrorOptions { title?: string; code?: string; suggestions?: string[]; docs?: string; context?: Record; report?: boolean; } /** * UI utilities interface */ interface UIUtilities { box: (title: string, content?: string[], maxWidth?: number) => string; sideBox: (options: { title: string; sections: Array<{ header?: string; items: string[]; }>; footer?: string; status?: 'success' | 'error' | 'warning' | 'info'; timing?: number; }) => string; table: (rows: (string | number)[][], headers?: string[]) => string[]; keyValue: (pairs: Record, options?: { padKeys?: boolean; }) => string[]; spinner: (text: string, jsonMode?: boolean) => Spinner; colors: { info: (text: string) => string; warn: (text: string) => string; error: (text: string) => string; success: (text: string) => string; muted: (text: string) => string; bold: (text: string) => string; primary: (text: string) => string; accent: (text: string) => string; }; symbols: { success: string; error: string; warning: string; info: string; bullet: string; }; } /** * Unified Output interface for plugins and CLI */ interface Output { success(message: string, data?: Record): void; error(error: Error | string, options?: ErrorOptions): void; warn(message: string, hint?: string): void; progress(stage: string, details?: ProgressDetails): void; spinner(text: string): Spinner; info(message: string, meta?: Record): void; debug(message: string, meta?: Record): void; trace(message: string, meta?: Record): void; json(data: unknown): void; write(text: string): void; ui: UIUtilities; group(name: string): void; groupEnd(): void; readonly mode: OutputMode; readonly verbosity: VerbosityLevel; readonly isQuiet: boolean; readonly isVerbose: boolean; readonly isDebug: boolean; readonly isJSON: boolean; readonly isAIFormat: boolean; } /** * @module @kb-labs/core-sys/output/factory * Output factory with auto-detection */ interface OutputConfig { verbosity?: VerbosityLevel; mode?: OutputMode; format?: DebugFormat; json?: boolean; sinks?: OutputLogSink[]; category?: string; context?: { plugin?: string; command?: string; trace?: string; }; } declare function createOutput(config?: OutputConfig): Output; /** * @module @kb-labs/core/sys/fs * Safe path helpers with explicit bases. */ declare function toAbsolute(baseDir: string, maybeRelative?: string): string; /** * @module @kb-labs/core/sys/repo * Repository root discovery. Pure infrastructure, no domain keys. */ /** * Find repository root by searching for markers in priority order. * First searches entire tree for pnpm-workspace.yaml (monorepo root), * then .git, then package.json as fallback. */ declare function findRepoRoot(startDir?: string): Promise; /** * Discover all sub-repository absolute paths in a monorepo root. * * Reads paths from `.gitmodules` — no hardcoded category directories. * Falls back to scanning top-level dirs for `.git` (flat layout). * * @returns Absolute paths to each sub-repo that exists on disk. */ declare function discoverSubRepoPaths(repoRoot: string): string[]; /** * Like discoverSubRepoPaths but returns structured SubRepo objects * with path, category, name, and absolutePath fields. */ declare function discoverSubRepos(repoRoot: string): SubRepo[]; export { type DebugFormat, type ErrorOptions, type FindNearestConfigOpts, type Output, type OutputConfig, type OutputLogLevel, type OutputLogRecord, type OutputLogSink, type OutputLogger, type OutputMode, type ProgressDetails, type Spinner, type SubRepo, type UIUtilities, type VerbosityLevel, createOutput, discoverSubRepoPaths, discoverSubRepos, findRepoRoot, toAbsolute };