/** * Shared utilities for CLI commands * * Functions used across multiple commands (analyze, generate, verify, drift, run) * are collected here to avoid duplication. */ import type { LLMContext } from '../core/analyzer/artifact-generator.js'; /** * Check whether a file or directory exists at the given path. */ export declare function fileExists(path: string): Promise; /** * Format a duration in milliseconds into a human-readable string. * @example formatDuration(750) // "750ms" * @example formatDuration(3500) // "3.5s" * @example formatDuration(125000) // "2m 5s" */ export declare function formatDuration(ms: number): string; /** * Format an elapsed time (ms) as a human-readable age string. * @example formatAge(30000) // "just now" * @example formatAge(300000) // "5 minutes ago" * @example formatAge(7200000) // "2 hours ago" */ export declare function formatAge(ms: number): string; /** * Parse a comma-separated string into a trimmed, non-empty array of values. * @example parseList("auth, billing, api") // ["auth", "billing", "api"] */ export declare function parseList(value: string): string[]; export type ProviderName = 'anthropic' | 'openai' | 'openai-compat' | 'gemini' | 'claude-code' | 'mistral-vibe' | 'copilot' | 'gemini-cli' | 'cursor-agent'; /** * Resolve the LLM provider and base URL from environment variables. * Returns null when no key is found, allowing callers to handle the error their own way. * * Priority: ANTHROPIC_API_KEY > GEMINI_API_KEY > OPENAI_COMPAT_API_KEY > OPENAI_API_KEY */ export declare function resolveLLMProvider(openloreConfig?: { generation?: { provider?: string; openaiCompatBaseUrl?: string; }; }): { provider: ProviderName; openaiCompatBaseUrl?: string; } | null; /** * Read and JSON-parse a file, returning null when the file does not exist. * Throws a descriptive error when the file exists but contains invalid JSON. * * @param filePath Absolute path to the JSON file. * @param label Human-readable label used in the error message (e.g. "repo-structure.json"). */ export declare function readJsonFile(filePath: string, label: string): Promise; /** * Return the age in milliseconds of the analysis at the given path, * measured from the mtime of repo-structure.json. Returns null when not found. */ export declare function getAnalysisAge(analysisPath: string): Promise; /** * Estimate the LLM cost for a full generation run. * Uses per-stage token breakdown for accuracy. */ export declare function estimateCost(llmContext: LLMContext, provider: string, model: string): { tokens: number; cost: number; }; //# sourceMappingURL=command-helpers.d.ts.map