/** * Configuration management service * * Handles reading/writing .openlore/config.json and openspec/config.yaml */ import type { ProjectType, OpenLoreConfig } from '../../types/index.js'; /** * OpenSpec config.yaml structure */ export interface OpenSpecConfig { schema?: string; context?: string; 'openlore'?: { generatedAt?: string; domains?: string[]; confidence?: number; sourceProject?: string; }; [key: string]: unknown; } /** * Get default openlore configuration */ export declare function getDefaultConfig(projectType: ProjectType, openspecPath: string): OpenLoreConfig; /** * Read openlore configuration from .openlore/config.json */ export declare function readOpenLoreConfig(rootPath: string): Promise; /** * Write openlore configuration to .openlore/config.json */ export declare function writeOpenLoreConfig(rootPath: string, config: OpenLoreConfig): Promise; /** * Check if openlore config already exists */ export declare function openloreConfigExists(rootPath: string): Promise; /** * Read OpenSpec config.yaml if it exists */ export declare function readOpenSpecConfig(openspecPath: string): Promise; /** * Write OpenSpec config.yaml */ export declare function writeOpenSpecConfig(openspecPath: string, config: OpenSpecConfig): Promise; /** * Check if openspec directory exists */ export declare function openspecDirExists(openspecPath: string): Promise; /** * Check if openspec/config.yaml exists */ export declare function openspecConfigExists(openspecPath: string): Promise; /** * Create minimal OpenSpec directory structure */ export declare function createOpenSpecStructure(openspecPath: string): Promise; /** A spec directory discovered on disk before `init` decides where to point. */ export interface DetectedSpecDir { /** openspec-root, relative to the project root (config `openspecPath`). */ root: string; /** The `/specs` directory, relative to the project root. */ specsRel: string; /** Count of `*.md` files found beneath the specs dir. */ count: number; } /** * Detect an existing specs directory so `init` does not create an empty * `openspec/` blind to specs that already live in `docs/specs/` or `specs/` * (Spec 26 B5). Candidate openspec-roots are scanned in priority order; the * first whose `/specs` contains at least one `*.md` wins. Returns null * when nothing is found. */ export declare function detectExistingSpecDir(rootPath: string): Promise; /** * Merge existing OpenSpec config with openlore metadata */ export declare function mergeOpenSpecConfig(existing: OpenSpecConfig | null, openloreMeta: OpenSpecConfig['openlore']): OpenSpecConfig; //# sourceMappingURL=config-manager.d.ts.map