feat: add AI auto-fix UI — types, API client, ValidationSummary button, review modal, and TreeEditorPage wiring
- New ai-fix.ts types for request/response - fixTree() method on treesApi - "Fix with AI" button in ValidationSummary (shows for fixable errors) - AIFixReviewModal with per-fix apply/skip and apply-all - TreeEditorPage orchestrates the fix flow Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
24
frontend/src/types/ai-fix.ts
Normal file
24
frontend/src/types/ai-fix.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
export interface AIFixValidationError {
|
||||
node_id: string
|
||||
message: string
|
||||
}
|
||||
|
||||
export interface AIFixProposal {
|
||||
target_node_id: string
|
||||
error_message: string
|
||||
description: string
|
||||
original_node: Record<string, unknown>
|
||||
fixed_node: Record<string, unknown>
|
||||
}
|
||||
|
||||
export interface AIFixTreeRequest {
|
||||
tree_structure: Record<string, unknown>
|
||||
tree_name: string
|
||||
tree_type: 'troubleshooting' | 'procedural' | 'maintenance'
|
||||
validation_errors: AIFixValidationError[]
|
||||
}
|
||||
|
||||
export interface AIFixTreeResponse {
|
||||
fixes: AIFixProposal[]
|
||||
tokens_used: { input: number; output: number }
|
||||
}
|
||||
@@ -45,3 +45,10 @@ export type {
|
||||
AIAssembleResponse,
|
||||
AIWizardPhase,
|
||||
} from './ai'
|
||||
|
||||
export type {
|
||||
AIFixTreeRequest,
|
||||
AIFixTreeResponse,
|
||||
AIFixProposal,
|
||||
AIFixValidationError,
|
||||
} from './ai-fix'
|
||||
|
||||
Reference in New Issue
Block a user