/** * pattern-detector — 可复用模式候选检测引擎 * * v8.2.0+: 从代码目录启发式检测可复用模式候选 * 供 done/execute/pattern 命令共用 */ export interface PatternCandidate { name: string; category: string; /** v8.3.0+: 所属端 — backend | frontend | shared | unknown */ platform: string; file: string; reason: string; } /** * 启发式检测代码中的可复用模式候选 * @param codeDirs 要扫描的代码目录列表 * @param sourceLabel 来源标签(用于日志) */ export declare function detectPatternCandidates(codeDirs: string[], sourceLabel?: string): Promise; /** * v8.3.23+: 从任务目录动态发现代码目录(适配端平铺结构) * 扫描 taskDir 下的端目录及子任务目录,寻找 src/ 或 code/ 子目录 */ export declare function resolveCodeDirsFromTask(taskDir: string): Promise; /** * v8.3.0+: 按端分组展示模式候选 * @returns 分组后的记录,键为端名,值为该端的候选列表 */ export declare function groupCandidatesByPlatform(candidates: PatternCandidate[]): Record; export type PatternAutoSaveMode = 'off' | 'smart' | 'aggressive'; /** * 读取 patterns.auto_save 配置(从 .speccore.yml) * 默认: 'smart' */ export declare function getPatternAutoSaveMode(): Promise; /** * 判断是否为高置信度候选(smart 档位自动保存) */ export declare function isHighConfidenceCandidate(candidate: PatternCandidate): boolean; export interface AutoSaveResult { saved: boolean; path?: string; confidence: 'EXTRACTED' | 'INFERRED'; } /** * 自动保存单个模式候选到 .speccore/PATTERNS/ */ export declare function autoSavePattern(candidate: PatternCandidate, sourceLabel: string, mode: PatternAutoSaveMode): Promise; //# sourceMappingURL=pattern-detector.d.ts.map