feat: chat unifié, GestureCatalog, Copilot, Léa UI, extraction données, vérification replay
Refonte majeure du système Agent Chat et ajout de nombreux modules : - Chat unifié : suppression du dual Workflows/Agent Libre, tout passe par /api/chat avec résolution en 3 niveaux (workflow → geste → "montre-moi") - GestureCatalog : 38 raccourcis clavier universels Windows avec matching sémantique, substitution automatique dans les replays, et endpoint /api/gestures - Mode Copilot : exécution pas-à-pas des workflows avec validation humaine via WebSocket (approve/skip/abort) avant chaque action - Léa UI (agent_v0/lea_ui/) : interface PyQt5 pour Windows avec overlay transparent pour feedback visuel pendant le replay - Data Extraction (core/extraction/) : moteur d'extraction visuelle de données (OCR + VLM → SQLite), avec schémas YAML et export CSV/Excel - ReplayVerifier (agent_v0/server_v1/) : vérification post-action par comparaison de screenshots, avec logique de retry (max 3) - IntentParser durci : meilleur fallback regex, type GREETING, patterns améliorés - Dashboard : nouvelles pages gestures, streaming, extractions - Tests : 63 tests GestureCatalog, 47 tests extraction, corrections tests existants - Dépréciation : /api/agent/plan et /api/agent/execute retournent HTTP 410, suppression du code hardcodé _plan_to_replay_actions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -618,6 +618,50 @@ def import_workflow():
|
||||
return error_response(500, f"Internal server error: {str(e)}")
|
||||
|
||||
|
||||
@workflows_bp.route('/import-core', methods=['POST'])
|
||||
def import_core_workflow():
|
||||
"""
|
||||
Import a core Workflow (from streaming/GraphBuilder) and convert to VWB format.
|
||||
|
||||
Accepts a core Workflow JSON (as produced by Workflow.to_dict() or save_to_file).
|
||||
Converts it to VisualWorkflow via GraphToVisualConverter, saves to DB,
|
||||
and returns the VWB-formatted workflow.
|
||||
|
||||
Body: core Workflow JSON dict
|
||||
"""
|
||||
try:
|
||||
data = request.get_json()
|
||||
if not data:
|
||||
return error_response(400, "Request body (core Workflow JSON) is required")
|
||||
|
||||
# Charger le core Workflow
|
||||
from core.models.workflow_graph import Workflow as CoreWorkflow
|
||||
core_wf = CoreWorkflow.from_dict(data)
|
||||
|
||||
# Convertir vers VisualWorkflow (modèle riche)
|
||||
from services.graph_to_visual_converter import GraphToVisualConverter
|
||||
converter = GraphToVisualConverter()
|
||||
visual_wf_rich = converter.convert(core_wf)
|
||||
|
||||
# Convertir vers le modèle simple (utilisé par le backend VWB)
|
||||
visual_dict = visual_wf_rich.to_dict()
|
||||
visual_wf = VisualWorkflow.from_dict(visual_dict)
|
||||
|
||||
# Sauvegarder
|
||||
db.save(visual_wf)
|
||||
workflows_store[visual_wf.id] = visual_wf
|
||||
|
||||
return jsonify({
|
||||
'message': 'Core workflow imported and converted to VWB format',
|
||||
'workflow': visual_wf.to_dict(),
|
||||
'warnings': converter.warnings,
|
||||
}), 201
|
||||
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
return error_response(500, f"Import error: {str(e)}")
|
||||
|
||||
|
||||
@workflows_bp.route('/<workflow_id>/feedback', methods=['POST'])
|
||||
def submit_workflow_feedback(workflow_id: str):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user