/** * openlore generate command * * Generates OpenSpec specification files from analysis results using LLM. * Outputs to openspec/specs/ directory in standard OpenSpec format. */ import { Command } from 'commander'; import type { GenerateOptions } from '../../types/index.js'; import type { RepoStructure, LLMContext } from '../../core/analyzer/artifact-generator.js'; import type { DependencyGraphResult } from '../../core/analyzer/dependency-graph.js'; import type { RefactorReport } from '../../core/analyzer/refactor-analyzer.js'; import { type GenerationManifest } from '../../core/runtime/analysis-generation.js'; interface ExtendedGenerateOptions extends GenerateOptions { merge?: boolean; noOverwrite?: boolean; /** Commander's storage key for `--no-overwrite` (default true; false when passed). */ overwrite?: boolean; yes?: boolean; outputDir?: string; force?: boolean; /** Cheap plan-only alias: list the stages and domains, then stop. */ plan?: boolean; /** Paid preview: run the real pipeline with every write redirected. */ preview?: boolean; } interface AnalysisData { repoStructure: RepoStructure; llmContext: LLMContext; depGraph?: DependencyGraphResult; refactorReport?: RefactorReport; age: number; timestamp: string; generationCompatibility: GenerationManifest['compatibility']; } export type GenerateAnalysisLoadResult = { state: 'ok'; data: AnalysisData; } | { state: 'analysis-unavailable'; } | { state: 'analysis-changed'; message: string; }; type JsonArtifactReader = (path: string, label: string) => Promise; export declare function normalizeGenerateOptions(options: Partial): ExtendedGenerateOptions; /** Resolve an operator-supplied output path without rebasing an absolute path. */ export declare function resolveGenerateOutputPath(rootPath: string, outputDir: string): string; /** * Copy only ordinary files and directories from an untrusted repository tree. * Symlinks and special files are ignored; regular files are opened with NOFOLLOW * so a rename race cannot turn the validation into an external read. */ export declare function copyRegularTree(sourceRoot: string, destinationRoot: string): Promise; /** * Compare candidate specs generated into an isolated workspace with the specs * currently in the project. * * A normalized, line-count-level diff rather than a full text diff: the point is * to let a human see WHAT would change and by how much before paying to commit * it, not to reproduce `git diff` inside the CLI. */ export declare function renderSpecPreviewDiff(projectRoot: string, previewRoot: string): Promise; /** * Load analysis data from disk */ export declare function loadAnalysis(analysisPath: string, readArtifact?: JsonArtifactReader): Promise; export declare const generateCommand: Command; export {}; //# sourceMappingURL=generate.d.ts.map