vibe-cli-tool
Version:
VibeCLI v1.9 - 模板商店生态,智能部署生成,多语言支持,交互式学习系统,企业级Web全栈应用CLI工具
189 lines • 5.2 kB
TypeScript
/**
* 智能降级处理器
*
* 当用户需求无法完美匹配现有模板时,提供智能的降级方案和实施指导
*/
import type { TemplateMatchResult, RequirementFeature } from './intelligent-template-matcher.js';
export interface FallbackResult {
strategy: FallbackStrategy;
guidance: DetailedGuidance;
alternatives: EnhancedAlternative[];
progressive: ProgressiveImplementation;
resources: DevelopmentResources;
}
export interface FallbackStrategy {
type: 'hybrid_approach' | 'progressive_build' | 'custom_guidance' | 'community_solution';
reasoning: string;
confidence: number;
estimatedSuccess: number;
}
export interface DetailedGuidance {
overview: string;
phases: GuidancePhase[];
keyDecisions: KeyDecision[];
riskMitigation: string[];
}
export interface GuidancePhase {
name: string;
description: string;
duration: string;
deliverables: string[];
tools: string[];
techniques: string[];
}
export interface KeyDecision {
decision: string;
options: DecisionOption[];
recommendation: string;
impact: 'low' | 'medium' | 'high';
}
export interface DecisionOption {
choice: string;
pros: string[];
cons: string[];
complexity: number;
}
export interface EnhancedAlternative {
title: string;
description: string;
approach: 'template_combination' | 'custom_development' | 'third_party_solution';
matchScore: number;
effort: EffortEstimate;
outcomes: ExpectedOutcome[];
tradeoffs: string[];
}
export interface EffortEstimate {
development: string;
learning: string;
maintenance: string;
totalComplexity: 'low' | 'medium' | 'high';
}
export interface ExpectedOutcome {
aspect: string;
quality: 'excellent' | 'good' | 'acceptable' | 'poor';
reasoning: string;
}
export interface ProgressiveImplementation {
milestones: Milestone[];
fallbackOptions: MilestoneFallback[];
validation: ValidationStep[];
}
export interface Milestone {
name: string;
description: string;
order: number;
dependencies: string[];
deliverables: string[];
successCriteria: string[];
timeEstimate: string;
}
export interface MilestoneFallback {
milestone: string;
issues: PotentialIssue[];
alternatives: string[];
}
export interface PotentialIssue {
description: string;
likelihood: 'low' | 'medium' | 'high';
impact: 'low' | 'medium' | 'high';
mitigation: string;
}
export interface ValidationStep {
phase: string;
checks: string[];
tools: string[];
criteria: string[];
}
export interface DevelopmentResources {
documentation: ResourceLink[];
tutorials: ResourceLink[];
libraries: RecommendedLibrary[];
examples: CodeExample[];
community: CommunityResource[];
}
export interface ResourceLink {
title: string;
url: string;
type: 'official' | 'tutorial' | 'example' | 'reference';
relevance: 'high' | 'medium' | 'low';
description: string;
}
export interface RecommendedLibrary {
name: string;
purpose: string;
installation: string;
documentation: string;
maturity: 'stable' | 'beta' | 'experimental';
popularity: 'high' | 'medium' | 'low';
}
export interface CodeExample {
title: string;
description: string;
code: string;
language: string;
complexity: 'beginner' | 'intermediate' | 'advanced';
}
export interface CommunityResource {
platform: string;
description: string;
url: string;
activity: 'high' | 'medium' | 'low';
}
export declare class IntelligentFallbackHandler {
/**
* 处理模板匹配失败或低置信度的情况
*/
handleFallback(templateMatch: TemplateMatchResult, userRequirements: RequirementFeature[], userContext: {
experience: 'beginner' | 'intermediate' | 'expert';
timeline: string;
preferences: string[];
}): Promise<FallbackResult>;
/**
* 选择最适合的降级策略
*/
private selectFallbackStrategy;
/**
* 生成详细的实施指导
*/
private generateDetailedGuidance;
/**
* 混合方案指导
*/
private generateHybridGuidance;
/**
* 渐进式构建指导
*/
private generateProgressiveGuidance;
/**
* 定制指导
*/
private generateCustomGuidance;
/**
* 社区方案指导
*/
private generateCommunityGuidance;
/**
* 创建增强的替代方案
*/
private createEnhancedAlternatives;
/**
* 设计渐进式实施计划
*/
private designProgressiveImplementation;
/**
* 收集开发资源
*/
private gatherDevelopmentResources;
private createProgressivePhases;
private generateDefaultGuidance;
private getRequirementWeight;
private groupRequirements;
private estimateMilestoneTime;
private createMilestoneFallbacks;
private createValidationSteps;
private getLibrariesForFeature;
private getDocumentationForFeature;
private getTutorialsForFeature;
}
export declare const intelligentFallbackHandler: IntelligentFallbackHandler;
//# sourceMappingURL=intelligent-fallback-handler.d.ts.map