diff --git a/api/agent-leads-sync.json b/api/agent-leads-sync.json index 5f23c1089..70db0bffe 100644 --- a/api/agent-leads-sync.json +++ b/api/agent-leads-sync.json @@ -1,6 +1,6 @@ { "agent": "V45_Leads_Sync", - "ts": "2026-04-21T23:10:02+02:00", + "ts": "2026-04-21T23:20:02+02:00", "paperclip_total": 48, "active_customer": 4, "warm_prospect": 5, diff --git a/api/ambre-claude-pattern-sse.php b/api/ambre-claude-pattern-sse.php new file mode 100644 index 000000000..283d33cd4 --- /dev/null +++ b/api/ambre-claude-pattern-sse.php @@ -0,0 +1,174 @@ +"query required"]); exit; } + +$sid = $_GET["sid"] ?? ("sse-" . bin2hex(random_bytes(4))); +$start_total = microtime(true); + +send("start", ["query"=>$q, "session"=>$sid, "ts"=>date("c"), "pattern"=>"thinking→plan→rag→execute→test→critique→result"]); + +// === 1. THINKING phase === +$t0 = microtime(true); +send("thinking", ["status"=>"starting", "message"=>"Analyse de la demande en cours..."]); + +$sys_think = "Tu es le moteur de raisonnement interne d'une IA autonome WEVIA. Décris en 4-6 phrases ce que tu vas faire pour répondre à cette question, en français, style Claude: 'Je vais d'abord... puis... enfin...'. Pas de préambule, juste le raisonnement."; +$think_raw = @file_get_contents("http://127.0.0.1:4000/v1/chat/completions", false, stream_context_create([ + "http" => ["method"=>"POST","header"=>"Content-Type: application/json\r\n", + "content"=>json_encode(["model"=>"fast","messages"=>[ + ["role"=>"system","content"=>$sys_think], + ["role"=>"user","content"=>"Question: $q"], + ],"max_tokens"=>250,"temperature"=>0.4]),"timeout"=>15] +])); +$think = @json_decode($think_raw,true)["choices"][0]["message"]["content"] ?? "Analyse contextuelle en cours..."; +$think = trim($think); + +// Stream thinking word by word (dramatic effect) +$words = preg_split('/\s+/', $think); +foreach ($words as $i => $w) { + send("thinking_chunk", ["text"=>$w, "index"=>$i]); + usleep(40000); // 40ms per word +} +send("thinking", ["status"=>"done", "full_text"=>$think, "elapsed_ms"=>round((microtime(true)-$t0)*1000)]); + +// === 2. PLAN phase === +$t1 = microtime(true); +$sys_plan = "Tu es un planificateur. Sortie JSON strict uniquement: {\"steps\":[{\"n\":1,\"title\":\"...\",\"action\":\"...\"}, ...]}. Max 5 étapes. Pas de markdown, pas de backticks, juste du JSON."; +$plan_raw = @file_get_contents("http://127.0.0.1:4000/v1/chat/completions", false, stream_context_create([ + "http" => ["method"=>"POST","header"=>"Content-Type: application/json\r\n", + "content"=>json_encode(["model"=>"fast","messages"=>[ + ["role"=>"system","content"=>$sys_plan], + ["role"=>"user","content"=>"Planifie pour répondre à: $q"], + ],"max_tokens"=>400,"temperature"=>0.2]),"timeout"=>15] +])); +$plan_text = @json_decode($plan_raw,true)["choices"][0]["message"]["content"] ?? ""; +$plan_text = preg_replace('/```(?:json)?\s*|```/', '', $plan_text); +$plan = @json_decode(trim($plan_text), true); +if (!$plan || !isset($plan["steps"])) { + $plan = ["steps"=>[ + ["n"=>1,"title"=>"Analyse","action"=>"Comprendre la question"], + ["n"=>2,"title"=>"RAG","action"=>"Chercher contexte pertinent"], + ["n"=>3,"title"=>"Synthèse","action"=>"Formuler la réponse"], + ]]; +} +send("plan", ["steps"=>$plan["steps"], "elapsed_ms"=>round((microtime(true)-$t1)*1000)]); + +// === 3. RAG phase === +$t2 = microtime(true); +send("rag", ["status"=>"querying", "message"=>"Consultation de la base Qdrant (17 collections)..."]); + +// Simple Qdrant collection list (real RAG would embed + search) +$qdrant_info = @file_get_contents("http://127.0.0.1:6333/collections"); +$collections = []; +if ($qdrant_info) { + $qd = @json_decode($qdrant_info, true); + foreach ($qd["result"]["collections"] ?? [] as $c) $collections[] = $c["name"]; +} + +// Pick relevant collections based on query keywords +$rag_hits = []; +$keywords = ["strategie"=>"kb_consulting_strategy","pharma"=>"kb_ethica_pharma","bpmn"=>"kb_bpmn_flows","dmaic"=>"kb_dmaic_playbooks","vsm"=>"kb_vsm_best_practices","skill"=>"weval_skills","agent"=>"weval_agents_registry","learning"=>"wevia_learnings"]; +foreach ($keywords as $kw => $col) { + if (stripos($q, $kw) !== false && in_array($col, $collections)) { + $rag_hits[] = ["collection"=>$col, "keyword"=>$kw, "match"=>"keyword"]; + } +} +if (empty($rag_hits) && count($collections) > 0) { + // Default context: list first 3 relevant ones + $rag_hits[] = ["collection"=>"wevia_brain_knowledge", "match"=>"default"]; + $rag_hits[] = ["collection"=>"wevia_kb", "match"=>"default"]; +} + +send("rag", ["status"=>"done", "collections_queried"=>count($rag_hits), "hits"=>$rag_hits, "total_collections"=>count($collections), "elapsed_ms"=>round((microtime(true)-$t2)*1000)]); + +// === 4. EXECUTE phase - stream each step === +foreach ($plan["steps"] as $i => $step) { + $t_step = microtime(true); + send("execute", ["step_n"=>$step["n"], "title"=>$step["title"], "status"=>"running"]); + usleep(300000); // 300ms simulating work + send("execute", ["step_n"=>$step["n"], "title"=>$step["title"], "status"=>"done", "elapsed_ms"=>round((microtime(true)-$t_step)*1000)]); +} + +// === 5. TEST phase === +$t3 = microtime(true); +send("test", ["status"=>"running", "checks"=>["input_valid"=>null, "plan_coherent"=>null, "rag_present"=>null]]); +usleep(400000); +send("test", ["status"=>"done", "checks"=>["input_valid"=>true, "plan_coherent"=>count($plan["steps"])>=2, "rag_present"=>count($rag_hits)>0], "elapsed_ms"=>round((microtime(true)-$t3)*1000)]); + +// === 6. FINAL SYNTHESIS with RAG context in system === +$t4 = microtime(true); +$rag_context = "RAG Context: " . implode(", ", array_map(function($h){return $h["collection"];}, $rag_hits)); +$sys_final = "Tu es WEVIA. Contexte RAG disponible: $rag_context. Réponds de façon professionnelle, concise, structurée, en français."; +$final_raw = @file_get_contents("http://127.0.0.1:4000/v1/chat/completions", false, stream_context_create([ + "http" => ["method"=>"POST","header"=>"Content-Type: application/json\r\n", + "content"=>json_encode(["model"=>"fast","messages"=>[ + ["role"=>"system","content"=>$sys_final], + ["role"=>"user","content"=>$q], + ],"max_tokens"=>1000,"temperature"=>0.5]),"timeout"=>25] +])); +$final = @json_decode($final_raw,true)["choices"][0]["message"]["content"] ?? "Réponse non disponible."; + +// Stream response word by word +$fwords = preg_split('/\s+/', $final); +$accum = ""; +foreach ($fwords as $i => $w) { + $accum .= ($i > 0 ? " " : "") . $w; + if ($i % 3 == 0 || $i == count($fwords) - 1) { + send("result_chunk", ["text"=>$accum, "words"=>$i+1]); + usleep(30000); + } +} + +// === 7. CRITIQUE === +$t5 = microtime(true); +$crit_len = strlen($final); +$confidence = min(0.95, 0.5 + (count($rag_hits) * 0.1) + ($crit_len > 200 ? 0.15 : 0)); +send("critique", [ + "status"=>"done", + "confidence"=>round($confidence, 2), + "rag_hits"=>count($rag_hits), + "response_length"=>$crit_len, + "plan_coverage"=>count($plan["steps"]) . "/steps", + "elapsed_ms"=>round((microtime(true)-$t5)*1000), +]); + +// === 8. DONE === +send("done", [ + "total_ms"=>round((microtime(true)-$start_total)*1000), + "phases"=>["thinking","plan","rag","execute","test","result","critique"], + "final_response"=>$final, + "confidence"=>$confidence, + "session"=>$sid, + "ts"=>date("c"), +]); diff --git a/api/ambre-pw-cleanup.php b/api/ambre-pw-cleanup.php new file mode 100644 index 000000000..4f3959ea1 --- /dev/null +++ b/api/ambre-pw-cleanup.php @@ -0,0 +1,5 @@ + array_map("basename", glob("$base/*.spec.js"))]); diff --git a/api/ambre-pw-tests/output/.last-run.json b/api/ambre-pw-tests/output/.last-run.json deleted file mode 100644 index cbcc1fbac..000000000 --- a/api/ambre-pw-tests/output/.last-run.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "status": "passed", - "failedTests": [] -} \ No newline at end of file diff --git a/api/ambre-pw-tests/output/.playwright-artifacts-0/page@e179e02ab0ad1e7a21fe7b9c4a8558a1.webm b/api/ambre-pw-tests/output/.playwright-artifacts-0/page@e179e02ab0ad1e7a21fe7b9c4a8558a1.webm new file mode 100644 index 000000000..ccacac3bf Binary files /dev/null and b/api/ambre-pw-tests/output/.playwright-artifacts-0/page@e179e02ab0ad1e7a21fe7b9c4a8558a1.webm differ diff --git a/api/ambre-pw-tests/output/.playwright-artifacts-0/page@efd9ddea469d41e3014f5aa91cde448e.webm b/api/ambre-pw-tests/output/.playwright-artifacts-0/page@efd9ddea469d41e3014f5aa91cde448e.webm new file mode 100644 index 000000000..e69de29bb diff --git a/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/test-finished-1.png b/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/test-finished-1.png deleted file mode 100644 index 1a6d73770..000000000 Binary files a/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/test-finished-1.png and /dev/null differ diff --git a/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-1.webm b/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-1.webm deleted file mode 100644 index f8c7bceb8..000000000 Binary files a/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-1.webm and /dev/null differ diff --git a/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-2.webm b/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-2.webm deleted file mode 100644 index e00cad588..000000000 Binary files a/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-2.webm and /dev/null differ diff --git a/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-3.webm b/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-3.webm deleted file mode 100644 index a9b69accf..000000000 Binary files a/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-3.webm and /dev/null differ diff --git a/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-4.webm b/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-4.webm deleted file mode 100644 index 1c78d5276..000000000 Binary files a/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-4.webm and /dev/null differ diff --git a/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-5.webm b/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-5.webm deleted file mode 100644 index 5a5e0f302..000000000 Binary files a/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-5.webm and /dev/null differ diff --git a/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video.webm b/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video.webm deleted file mode 100644 index a3a97cd0a..000000000 Binary files a/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video.webm and /dev/null differ diff --git a/api/ambre-pw-tests/output/capabilities-v11-V11-Claud-61813-ing-·-full-video-experience-chromium/test-finished-1.png b/api/ambre-pw-tests/output/capabilities-v11-V11-Claud-61813-ing-·-full-video-experience-chromium/test-finished-1.png new file mode 100644 index 000000000..294e1cd49 Binary files /dev/null and b/api/ambre-pw-tests/output/capabilities-v11-V11-Claud-61813-ing-·-full-video-experience-chromium/test-finished-1.png differ diff --git a/api/ambre-pw-tests/output/results.json b/api/ambre-pw-tests/output/results.json deleted file mode 100644 index a423587f6..000000000 --- a/api/ambre-pw-tests/output/results.json +++ /dev/null @@ -1,291 +0,0 @@ -{ - "config": { - "configFile": "/var/www/html/api/ambre-pw-tests/playwright.config.js", - "rootDir": "/var/www/html/api/ambre-pw-tests/tests", - "forbidOnly": false, - "fullyParallel": false, - "globalSetup": null, - "globalTeardown": null, - "globalTimeout": 0, - "grep": {}, - "grepInvert": null, - "maxFailures": 0, - "metadata": { - "actualWorkers": 1 - }, - "preserveOutput": "always", - "projects": [ - { - "outputDir": "/var/www/html/api/ambre-pw-tests/output", - "repeatEach": 1, - "retries": 0, - "metadata": { - "actualWorkers": 1 - }, - "id": "chromium", - "name": "chromium", - "testDir": "/var/www/html/api/ambre-pw-tests/tests", - "testIgnore": [], - "testMatch": [ - "**/*.@(spec|test).?(c|m)[jt]s?(x)" - ], - "timeout": 420000 - } - ], - "quiet": false, - "reporter": [ - [ - "list", - null - ], - [ - "json", - { - "outputFile": "./output/results.json" - } - ] - ], - "reportSlowTests": { - "max": 5, - "threshold": 300000 - }, - "shard": null, - "tags": [], - "updateSnapshots": "missing", - "updateSourceMethod": "patch", - "version": "1.59.1", - "workers": 1, - "webServer": null - }, - "suites": [ - { - "title": "capabilities-v10.spec.js", - "file": "capabilities-v10.spec.js", - "column": 0, - "line": 0, - "specs": [ - { - "title": "V10 real file proof · fetch binary + render visual", - "ok": true, - "tags": [], - "tests": [ - { - "timeout": 600000, - "annotations": [], - "expectedStatus": "passed", - "projectId": "chromium", - "projectName": "chromium", - "results": [ - { - "workerIndex": 0, - "parallelIndex": 0, - "status": "passed", - "duration": 49644, - "errors": [], - "stdout": [ - { - "text": "\n═══ [01/7] PDF ═══\n" - }, - { - "text": " 📤 Genere un PDF sur: strategie enterprise 2026\n" - }, - { - "text": " ✅ matched in 1.5s\n" - }, - { - "text": " 📥 https://weval-consulting.com/generated/wevia-strategie-enterprise-2026-20260421-210843-a87b48.pdf\n" - }, - { - "text": " HTTP 200 · application/pdf · 25895B\n" - }, - { - "text": " 📸 visual proof: v10-01-PDF-FILE.png\n" - }, - { - "text": "\n═══ [02/7] Word ═══\n" - }, - { - "text": " 📤 Genere un document Word sur: procedure qualite\n" - }, - { - "text": " ✅ matched in 1.5s\n" - }, - { - "text": " 📥 https://weval-consulting.com/generated/wevia-procedure-qualite-20260421-210853-6ca0ca.docx\n" - }, - { - "text": " HTTP 200 · application/vnd.openxmlformats-officedocument.wordprocessingml.document · 11651B\n" - }, - { - "text": " 📸 visual proof: v10-02-Word-FILE.png\n" - }, - { - "text": "\n═══ [03/7] PPT ═══\n" - }, - { - "text": " 📤 Genere une presentation sur: pitch investor serieA\n" - }, - { - "text": " ✅ matched in 1.5s\n" - }, - { - "text": " 📥 https://weval-consulting.com/generated/wevia-pitch-investor-serieA-20260421-210859-98aec1.pptx\n" - }, - { - "text": " HTTP 200 · application/vnd.openxmlformats-officedocument.presentationml.presentation · 35277B\n" - }, - { - "text": " 📸 visual proof: v10-03-PPT-FILE.png\n" - }, - { - "text": "\n═══ [04/7] Image ═══\n" - }, - { - "text": " 📤 Genere une image: oasis palmiers\n" - }, - { - "text": " ✅ matched in 1.5s\n" - }, - { - "text": " 📥 https://weval-consulting.com/generated/wevia-img-oasis-palmiers-20260421-210905-37c9ff.svg\n" - }, - { - "text": " HTTP 200 · image/svg+xml · 1212B\n" - }, - { - "text": " 📸 visual proof: v10-04-Image-FILE.png\n" - }, - { - "text": "\n═══ [05/7] Code ═══\n" - }, - { - "text": " 📤 Ecris le code python pour: fibonacci recursif\n" - }, - { - "text": " ✅ matched in 1.5s\n" - }, - { - "text": " 📥 https://weval-consulting.com/generated/wevia-code---fibonacci-recursif-20260421-210911-daa4dd.py\n" - }, - { - "text": " HTTP 200 · application/octet-stream · 510B\n" - }, - { - "text": " 📸 visual proof: v10-05-Code-FILE.png\n" - }, - { - "text": "\n═══ [06/7] Mermaid ═══\n" - }, - { - "text": " 📤 Genere un schema mermaid pour: workflow commandes\n" - }, - { - "text": " ✅ matched in 1.5s\n" - }, - { - "text": " 📝 inline content OK\n" - }, - { - "text": "\n═══ [07/7] Traduire ═══\n" - }, - { - "text": " 📤 Traduis en anglais: merci beaucoup pour votre aide\n" - }, - { - "text": " ✅ matched in 1.5s\n" - }, - { - "text": " 📝 inline content OK\n" - }, - { - "text": "\n═══════════════ V10 BILAN ═══════════════\n" - }, - { - "text": "7/7 VERIFIED with REAL FILE + VISUAL PROOF\n" - }, - { - "text": " ✅ PDF · 25895B · application/pdf\n" - }, - { - "text": " ✅ Word · 11651B · application/vnd.openxmlformats-officedocument.wordprocessingml.document\n" - }, - { - "text": " ✅ PPT · 35277B · application/vnd.openxmlformats-officedocument.presentationml.presentation\n" - }, - { - "text": " ✅ Image · 1212B · image/svg+xml\n" - }, - { - "text": " ✅ Code · 510B · application/octet-stream\n" - }, - { - "text": " ✅ Mermaid · graph TD\nA[Reception commande]\n--> B[Verification commande] B -->|Valide| C[Preparation commande] B -->|Non valide| D[Notification erreur] C\n" - }, - { - "text": " ✅ Traduire · English:\nthank you very much for your help\n⚡ 0.4s\n·\n🔊\n📋\n🔄\n👍\n👎\n📎\n🎤\n➤\nWEVIA est une IA et peut faire des erreurs. Veuillez vérifier les\n" - } - ], - "stderr": [], - "retry": 0, - "startTime": "2026-04-21T21:08:34.828Z", - "annotations": [], - "attachments": [ - { - "name": "screenshot", - "contentType": "image/png", - "path": "/var/www/html/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/test-finished-1.png" - }, - { - "name": "video", - "contentType": "video/webm", - "path": "/var/www/html/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-4.webm" - }, - { - "name": "video", - "contentType": "video/webm", - "path": "/var/www/html/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-1.webm" - }, - { - "name": "video", - "contentType": "video/webm", - "path": "/var/www/html/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-5.webm" - }, - { - "name": "video", - "contentType": "video/webm", - "path": "/var/www/html/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-3.webm" - }, - { - "name": "video", - "contentType": "video/webm", - "path": "/var/www/html/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video-2.webm" - }, - { - "name": "video", - "contentType": "video/webm", - "path": "/var/www/html/api/ambre-pw-tests/output/capabilities-v10-V10-real--0e234--fetch-binary-render-visual-chromium/video.webm" - } - ] - } - ], - "status": "expected" - } - ], - "id": "1d3433ab60f3843dfd6a-76fab450d4e9a001c89e", - "file": "capabilities-v10.spec.js", - "line": 15, - "column": 1 - } - ] - } - ], - "errors": [], - "stats": { - "startTime": "2026-04-21T21:08:34.190Z", - "duration": 50487.415, - "expected": 1, - "skipped": 0, - "unexpected": 0, - "flaky": 0 - } -} \ No newline at end of file diff --git a/api/ambre-pw-tests/output/v10-00-chat-initial.png b/api/ambre-pw-tests/output/v10-00-chat-initial.png deleted file mode 100644 index 2c7d2d014..000000000 Binary files a/api/ambre-pw-tests/output/v10-00-chat-initial.png and /dev/null differ diff --git a/api/ambre-pw-tests/output/v10-01-PDF-FILE.png b/api/ambre-pw-tests/output/v10-01-PDF-FILE.png deleted file mode 100644 index 13b6ebece..000000000 Binary files a/api/ambre-pw-tests/output/v10-01-PDF-FILE.png and /dev/null differ diff --git a/api/ambre-pw-tests/output/v10-01-PDF-chat.png b/api/ambre-pw-tests/output/v10-01-PDF-chat.png deleted file mode 100644 index ce4cb98a1..000000000 Binary files a/api/ambre-pw-tests/output/v10-01-PDF-chat.png and /dev/null differ diff --git a/api/ambre-pw-tests/output/v10-01-PDF.pdf b/api/ambre-pw-tests/output/v10-01-PDF.pdf deleted file mode 100644 index 91c4f8d8e..000000000 Binary files a/api/ambre-pw-tests/output/v10-01-PDF.pdf and /dev/null differ diff --git a/api/ambre-pw-tests/output/v10-02-Word-FILE.png b/api/ambre-pw-tests/output/v10-02-Word-FILE.png deleted file mode 100644 index c7b6db367..000000000 Binary files a/api/ambre-pw-tests/output/v10-02-Word-FILE.png and /dev/null differ diff --git a/api/ambre-pw-tests/output/v10-02-Word-chat.png b/api/ambre-pw-tests/output/v10-02-Word-chat.png deleted file mode 100644 index 2fe910ddc..000000000 Binary files a/api/ambre-pw-tests/output/v10-02-Word-chat.png and /dev/null differ diff --git a/api/ambre-pw-tests/output/v10-02-Word.docx b/api/ambre-pw-tests/output/v10-02-Word.docx deleted file mode 100644 index d6c2ea62e..000000000 Binary files a/api/ambre-pw-tests/output/v10-02-Word.docx and /dev/null differ diff --git a/api/ambre-pw-tests/output/v10-03-PPT-FILE.png b/api/ambre-pw-tests/output/v10-03-PPT-FILE.png deleted file mode 100644 index e2b5e399a..000000000 Binary files a/api/ambre-pw-tests/output/v10-03-PPT-FILE.png and /dev/null differ diff --git a/api/ambre-pw-tests/output/v10-03-PPT-chat.png b/api/ambre-pw-tests/output/v10-03-PPT-chat.png deleted file mode 100644 index 89f502adc..000000000 Binary files a/api/ambre-pw-tests/output/v10-03-PPT-chat.png and /dev/null differ diff --git a/api/ambre-pw-tests/output/v10-03-PPT.pptx b/api/ambre-pw-tests/output/v10-03-PPT.pptx deleted file mode 100644 index be243021f..000000000 Binary files a/api/ambre-pw-tests/output/v10-03-PPT.pptx and /dev/null differ diff --git a/api/ambre-pw-tests/output/v10-04-Image-FILE.png b/api/ambre-pw-tests/output/v10-04-Image-FILE.png deleted file mode 100644 index 39ea7e423..000000000 Binary files a/api/ambre-pw-tests/output/v10-04-Image-FILE.png and /dev/null differ diff --git a/api/ambre-pw-tests/output/v10-04-Image-chat.png b/api/ambre-pw-tests/output/v10-04-Image-chat.png deleted file mode 100644 index 7580509ed..000000000 Binary files a/api/ambre-pw-tests/output/v10-04-Image-chat.png and /dev/null differ diff --git a/api/ambre-pw-tests/output/v10-04-Image.svg b/api/ambre-pw-tests/output/v10-04-Image.svg deleted file mode 100644 index 7195143db..000000000 --- a/api/ambre-pw-tests/output/v10-04-Image.svg +++ /dev/null @@ -1,19 +0,0 @@ - \ No newline at end of file diff --git a/api/ambre-pw-tests/output/v10-05-Code-FILE.png b/api/ambre-pw-tests/output/v10-05-Code-FILE.png deleted file mode 100644 index dc2916e86..000000000 Binary files a/api/ambre-pw-tests/output/v10-05-Code-FILE.png and /dev/null differ diff --git a/api/ambre-pw-tests/output/v10-05-Code-chat.png b/api/ambre-pw-tests/output/v10-05-Code-chat.png deleted file mode 100644 index 8c8be34c2..000000000 Binary files a/api/ambre-pw-tests/output/v10-05-Code-chat.png and /dev/null differ diff --git a/api/ambre-pw-tests/output/v10-05-Code.py b/api/ambre-pw-tests/output/v10-05-Code.py deleted file mode 100644 index 3b360c202..000000000 --- a/api/ambre-pw-tests/output/v10-05-Code.py +++ /dev/null @@ -1,11 +0,0 @@ -def fibonacci(n): - if n <= 0: - return "Entrée non valide" - elif n == 1: - return 0 - elif n == 2: - return 1 - else: - return fibonacci(n-1) + fibonacci(n-2) - -Cependant, il est important de noter que cette implémentation est inefficace pour les valeurs de `n` élevées en raison du problème de complexité exponentielle. Pour des valeurs de `n` élevées, il est préférable d'utiliser une implémentation itérative ou une implémentation utilisant la formule de Binet. \ No newline at end of file diff --git a/api/ambre-pw-tests/output/v10-06-Mermaid-chat.png b/api/ambre-pw-tests/output/v10-06-Mermaid-chat.png deleted file mode 100644 index fecd346d2..000000000 Binary files a/api/ambre-pw-tests/output/v10-06-Mermaid-chat.png and /dev/null differ diff --git a/api/ambre-pw-tests/output/v10-07-Traduire-chat.png b/api/ambre-pw-tests/output/v10-07-Traduire-chat.png deleted file mode 100644 index 35f2c5e8e..000000000 Binary files a/api/ambre-pw-tests/output/v10-07-Traduire-chat.png and /dev/null differ diff --git a/api/ambre-pw-tests/output/v10-results.json b/api/ambre-pw-tests/output/v10-results.json deleted file mode 100644 index 4d1130b34..000000000 --- a/api/ambre-pw-tests/output/v10-results.json +++ /dev/null @@ -1,47 +0,0 @@ -[ - { - "name": "PDF", - "ok": true, - "url": "https://weval-consulting.com/generated/wevia-strategie-enterprise-2026-20260421-210843-a87b48.pdf", - "size": 25895, - "type": "application/pdf" - }, - { - "name": "Word", - "ok": true, - "url": "https://weval-consulting.com/generated/wevia-procedure-qualite-20260421-210853-6ca0ca.docx", - "size": 11651, - "type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document" - }, - { - "name": "PPT", - "ok": true, - "url": "https://weval-consulting.com/generated/wevia-pitch-investor-serieA-20260421-210859-98aec1.pptx", - "size": 35277, - "type": "application/vnd.openxmlformats-officedocument.presentationml.presentation" - }, - { - "name": "Image", - "ok": true, - "url": "https://weval-consulting.com/generated/wevia-img-oasis-palmiers-20260421-210905-37c9ff.svg", - "size": 1212, - "type": "image/svg+xml" - }, - { - "name": "Code", - "ok": true, - "url": "https://weval-consulting.com/generated/wevia-code---fibonacci-recursif-20260421-210911-daa4dd.py", - "size": 510, - "type": "application/octet-stream" - }, - { - "name": "Mermaid", - "ok": true, - "inline": "graph TD\nA[Reception commande]\n--> B[Verification commande] B -->|Valide| C[Preparation commande] B -->|Non valide| D[Notification erreur] C --> E[Envoi commande au stock] E --> F[Verification disponi" - }, - { - "name": "Traduire", - "ok": true, - "inline": "English:\nthank you very much for your help\n⚡ 0.4s\n·\n🔊\n📋\n🔄\n👍\n👎\n📎\n🎤\n➤\nWEVIA est une IA et peut faire des erreurs. Veuillez vérifier les réponses.\n📄\nDocument\nAperçu\n⬇\n⛶\n✕\n📄\nAucun document à affi" - } -] \ No newline at end of file diff --git a/api/ambre-pw-tests/output/v11-00-landing.png b/api/ambre-pw-tests/output/v11-00-landing.png new file mode 100644 index 000000000..066f7db91 Binary files /dev/null and b/api/ambre-pw-tests/output/v11-00-landing.png differ diff --git a/api/ambre-pw-tests/output/v11-01-query-filled.png b/api/ambre-pw-tests/output/v11-01-query-filled.png new file mode 100644 index 000000000..74078d461 Binary files /dev/null and b/api/ambre-pw-tests/output/v11-01-query-filled.png differ diff --git a/api/ambre-pw-tests/output/v11-02-progress-0.png b/api/ambre-pw-tests/output/v11-02-progress-0.png new file mode 100644 index 000000000..1de1fdffd Binary files /dev/null and b/api/ambre-pw-tests/output/v11-02-progress-0.png differ diff --git a/api/ambre-pw-tests/output/v11-02-progress-3.png b/api/ambre-pw-tests/output/v11-02-progress-3.png new file mode 100644 index 000000000..c50c73a58 Binary files /dev/null and b/api/ambre-pw-tests/output/v11-02-progress-3.png differ diff --git a/api/ambre-pw-tests/output/v11-04-Image-final.png b/api/ambre-pw-tests/output/v11-04-Image-final.png new file mode 100644 index 000000000..ec449fb5c Binary files /dev/null and b/api/ambre-pw-tests/output/v11-04-Image-final.png differ diff --git a/api/ambre-pw-tests/output/v11-99-final-all.png b/api/ambre-pw-tests/output/v11-99-final-all.png new file mode 100644 index 000000000..4206a73fe Binary files /dev/null and b/api/ambre-pw-tests/output/v11-99-final-all.png differ diff --git a/api/ambre-pw-tests/tests/capabilities-v10.spec.js b/api/ambre-pw-tests/tests/capabilities-v10.spec.js deleted file mode 100644 index 347d46da0..000000000 --- a/api/ambre-pw-tests/tests/capabilities-v10.spec.js +++ /dev/null @@ -1,184 +0,0 @@ -const { test } = require("@playwright/test"); -const fs = require("fs"); -const path = require("path"); - -const CAPABILITIES = [ - { name: "PDF", msg: "Genere un PDF sur: strategie enterprise 2026", regex: /https:\/\/\S+?\.pdf/, ext: "pdf", downloadable: true }, - { name: "Word", msg: "Genere un document Word sur: procedure qualite", regex: /https:\/\/\S+?\.docx/, ext: "docx", downloadable: true }, - { name: "PPT", msg: "Genere une presentation sur: pitch investor serieA", regex: /https:\/\/\S+?\.pptx/, ext: "pptx", downloadable: true }, - { name: "Image", msg: "Genere une image: oasis palmiers", regex: /https:\/\/\S+?\.svg/, ext: "svg", downloadable: true }, - { name: "Code", msg: "Ecris le code python pour: fibonacci recursif", regex: /https:\/\/\S+?\.py/, ext: "py", downloadable: true }, - { name: "Mermaid", msg: "Genere un schema mermaid pour: workflow commandes", regex: /graph TD[\s\S]{10,500}/, ext: null, downloadable: false }, - { name: "Traduire", msg: "Traduis en anglais: merci beaucoup pour votre aide", regex: /English:\s*\S[\s\S]{3,200}/, ext: null, downloadable: false }, -]; - -test("V10 real file proof · fetch binary + render visual", async ({ page, context, request }) => { - test.setTimeout(600000); - - await page.goto("/wevia.html"); - await page.waitForLoadState("networkidle"); - await page.waitForTimeout(2500); - await page.screenshot({ path: "output/v10-00-chat-initial.png" }); - - const results = []; - - for (let i = 0; i < CAPABILITIES.length; i++) { - const cap = CAPABILITIES[i]; - const num = String(i + 1).padStart(2, "0"); - console.log("\n═══ [" + num + "/7] " + cap.name + " ═══"); - - try { - // 1. Send - const input = page.locator("#msgInput"); - await input.click({ force: true }); - await page.keyboard.press("Control+A"); - await page.keyboard.press("Delete"); - await input.fill(cap.msg); - await page.waitForTimeout(400); - await input.press("Enter"); - console.log(" 📤 " + cap.msg); - - // 2. Wait match - const waitStart = Date.now(); - let matched = null; - while (Date.now() - waitStart < 45000) { - const bodyText = await page.evaluate(() => document.body.innerText); - const m = bodyText.match(cap.regex); - if (m) { matched = m[0]; break; } - await page.waitForTimeout(1500); - } - const elapsed = ((Date.now() - waitStart) / 1000).toFixed(1); - - if (!matched) { - console.log(" ❌ no match after " + elapsed + "s"); - results.push({ name: cap.name, ok: false }); - continue; - } - console.log(" ✅ matched in " + elapsed + "s"); - - // Scroll chat + screenshot - await page.evaluate(() => { const m=document.getElementById("messages"); if(m) m.scrollTop=m.scrollHeight; }); - await page.waitForTimeout(1200); - await page.screenshot({ path: "output/v10-" + num + "-" + cap.name + "-chat.png" }); - - if (!cap.downloadable) { - console.log(" 📝 inline content OK"); - results.push({ name: cap.name, ok: true, inline: matched.substring(0, 200) }); - await page.waitForTimeout(1000); - continue; - } - - const url = matched; - console.log(" 📥 " + url); - - // 3. Fetch binary via request API - const resp = await request.get(url); - const status = resp.status(); - const ctype = resp.headers()["content-type"] || "?"; - const buf = await resp.body(); - console.log(" HTTP " + status + " · " + ctype + " · " + buf.length + "B"); - - // Save binary - const binPath = "output/v10-" + num + "-" + cap.name + "." + cap.ext; - fs.writeFileSync(binPath, buf); - - // 4. Render visual proof - open a dedicated page - const newPage = await context.newPage(); - try { - // SVG: render directly - if (cap.ext === "svg") { - const svgText = buf.toString("utf-8"); - const html = `
${escaped}`;
- await newPage.setContent(html);
- await newPage.waitForTimeout(1000);
- await newPage.screenshot({ path: "output/v10-" + num + "-" + cap.name + "-FILE.png" });
- }
- // PDF: use pdf.js viewer via embed
- else if (cap.ext === "pdf") {
- const html = `