feat(小宝预警): 增加 AI 风险解读接口
This commit is contained in:
@@ -114,6 +114,74 @@ export interface AgentDecomposeError {
|
||||
code: 'PROTOTYPE_FETCH_FAILED' | 'EMPTY_REQUIREMENTS' | 'API_ERROR' | 'PARSE_ERROR' | 'NO_PROVIDER' | 'UNKNOWN';
|
||||
}
|
||||
|
||||
export interface AgentRiskReason {
|
||||
key: string;
|
||||
label: string;
|
||||
severity: 'low' | 'medium' | 'high' | 'critical';
|
||||
detail: string;
|
||||
}
|
||||
|
||||
export interface AgentRiskInterpretRequest {
|
||||
versionId: string;
|
||||
versionName: string;
|
||||
productName?: string;
|
||||
projectName?: string;
|
||||
riskScore: number;
|
||||
riskLevel: 'on_track' | 'attention' | 'at_risk' | 'likely_delayed' | 'blocked';
|
||||
expectedReleaseDate?: string | null;
|
||||
forecastReleaseDate?: string;
|
||||
delayDays: number;
|
||||
confidence: number;
|
||||
signals: {
|
||||
unfinishedCount: number;
|
||||
openBugCount: number;
|
||||
criticalBugCount: number;
|
||||
failedTestCount: number;
|
||||
blockedCount: number;
|
||||
silentRiskCount: number;
|
||||
daysToExpectedRelease?: number;
|
||||
};
|
||||
trendSummary: string;
|
||||
reasons: AgentRiskReason[];
|
||||
silentRisks: Array<{ key: string; days?: number; detail: string }>;
|
||||
dailyEvidence: {
|
||||
todayDeliveries: string[];
|
||||
todayProgress: string[];
|
||||
todayRisks: string[];
|
||||
progressNotes: string[];
|
||||
needsProgressItems: string[];
|
||||
recentActivityCount: number;
|
||||
lastActivityAt?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface AgentRiskInsight {
|
||||
summary: string;
|
||||
why: string[];
|
||||
forecast: string;
|
||||
recommendedReleaseWindow?: string;
|
||||
suggestedActions: string[];
|
||||
ownerHints: string[];
|
||||
generatedAt: string;
|
||||
}
|
||||
|
||||
export interface AgentRiskInterpretResponse {
|
||||
ok: true;
|
||||
result: AgentRiskInsight;
|
||||
meta: {
|
||||
model: string;
|
||||
inputTokens: number;
|
||||
outputTokens: number;
|
||||
durationMs: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface AgentRiskInterpretError {
|
||||
ok: false;
|
||||
error: string;
|
||||
code: 'API_ERROR' | 'PARSE_ERROR' | 'NO_PROVIDER' | 'UNKNOWN';
|
||||
}
|
||||
|
||||
/* ───────────────────────── AI Provider 配置 ─────────────────────────── */
|
||||
|
||||
export type AiProviderFormat = 'anthropic' | 'openai';
|
||||
|
||||
Reference in New Issue
Block a user