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:
chihlasm
2026-02-26 17:29:53 -05:00
parent b3925150d7
commit 29dc95e920
6 changed files with 313 additions and 11 deletions

View 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 }
}

View File

@@ -45,3 +45,10 @@ export type {
AIAssembleResponse,
AIWizardPhase,
} from './ai'
export type {
AIFixTreeRequest,
AIFixTreeResponse,
AIFixProposal,
AIFixValidationError,
} from './ai-fix'