diff --git a/wevia-orchestrator.html b/wevia-orchestrator.html index e425dc9e4..513838933 100644 --- a/wevia-orchestrator.html +++ b/wevia-orchestrator.html @@ -594,5 +594,6 @@ async function runTask(preset){ Droid + diff --git a/wtp-unified-dock.js b/wtp-unified-dock.js new file mode 100644 index 000000000..2b31b9a97 --- /dev/null +++ b/wtp-unified-dock.js @@ -0,0 +1,112 @@ +/* ═══════════════════════════════════════════════════════════════════ + WTP UNIFIED DOCK v1 · Opus 21-avr — Single Source of Truth + ───────────────────────────────────────────────────────────────── + Injecte un dock de navigation unifié ERP-style. + IDEMPOTENT: skip si opus-xlinks ou v130-xnav ou wtp-udock déjà présent. + ZERO régression: additif pur, aucun écrasement. + Usage: + ═══════════════════════════════════════════════════════════════════ */ +(function(){ + 'use strict'; + // Guard idempotent — ne jamais dupliquer si autre dock présent + if (document.getElementById('opus-xlinks')) return; + if (document.getElementById('v130-xnav')) return; + if (document.getElementById('wtp-udock')) return; + if (document.getElementById('wtp-sidebar')) return; // WTP a sa propre sidebar + + var LINKS = [ + {href:'/weval-technology-platform.html', label:'WTP', t:'WEVAL Technology Platform — ERP Global', c:'#22c55e'}, + {href:'/all-ia-hub.html', label:'IA Hub', t:'All-IA Hub — 906 agents · 20126 skills', c:'#06b6d4'}, + {href:'/wevia-master.html', label:'Master', t:'WEVIA Master — Chat souverain autonome', c:'#6366f1'}, + {href:'/wevia-orchestrator.html', label:'Orch', t:'WEVIA Orchestrator — Multi-agent GODMODE', c:'#8b5cf6'}, + {href:'/wevcode.html', label:'WevCode', t:'WEVCODE — Assistant code souverain', c:'#ec4899'}, + {href:'/weval-arena.html', label:'Arena', t:'WEVAL Arena — Command Center 409 options', c:'#f59e0b'}, + {href:'/wevia-ia/droid.html', label:'Droid', t:'WEDROID v3.2 — Backend 19 providers', c:'#10b981'}, + {href:'/wevia-ia/wevia-admin.php', label:'Admin', t:'WEVIA Admin — Conversations & Leads', c:'#64748b'} + ]; + + function mk(){ + var d = document.createElement('div'); + d.id = 'wtp-udock'; + d.setAttribute('data-version','v1-opus-21avr'); + d.style.cssText = [ + 'position:fixed','top:12px','right:12px','display:flex','gap:6px', + 'z-index:9998','flex-wrap:wrap','max-width:420px', + 'font-family:system-ui,-apple-system,sans-serif' + ].join(';'); + LINKS.forEach(function(L){ + var a = document.createElement('a'); + a.href = L.href; + a.title = L.t; + a.textContent = L.label; + // Dériver RGB pour bg transparent + border + var hex = L.c.replace('#',''); + var r = parseInt(hex.substring(0,2),16); + var g = parseInt(hex.substring(2,4),16); + var b = parseInt(hex.substring(4,6),16); + a.style.cssText = [ + 'padding:5px 10px', + 'background:rgba('+r+','+g+','+b+',0.15)', + 'color:'+L.c, + 'text-decoration:none', + 'border-radius:14px', + 'font-size:11px', + 'font-weight:600', + 'border:1px solid rgba('+r+','+g+','+b+',0.3)', + 'backdrop-filter:blur(8px)', + '-webkit-backdrop-filter:blur(8px)', + 'transition:transform .15s,background .15s' + ].join(';'); + a.addEventListener('mouseenter', function(){ + a.style.transform='translateY(-1px)'; + a.style.background='rgba('+r+','+g+','+b+',0.25)'; + }); + a.addEventListener('mouseleave', function(){ + a.style.transform='translateY(0)'; + a.style.background='rgba('+r+','+g+','+b+',0.15)'; + }); + d.appendChild(a); + }); + // Live status badge (providers count) + var s = document.createElement('span'); + s.id = 'wtp-udock-status'; + s.style.cssText = 'padding:5px 10px;background:rgba(156,163,175,0.12);color:#9ca3af;border-radius:14px;font-size:10px;font-weight:500;border:1px solid rgba(156,163,175,0.25);backdrop-filter:blur(8px)'; + s.textContent = '· 0€'; + d.appendChild(s); + return d; + } + + function inject(){ + try { + var dock = mk(); + document.body.appendChild(dock); + // Fetch live count (best-effort, HTMLGUARD-aware) + try { + fetch('/api/providers-status.json', {credentials:'same-origin'}) + .then(function(r){ + var ct = r.headers.get('content-type')||''; + if (!r.ok || ct.indexOf('html')>=0) throw 0; + return r.json(); + }) + .then(function(j){ + var badge = document.getElementById('wtp-udock-status'); + if (!badge) return; + var n = (j && j.active) ? j.active : (j && j.count) ? j.count : 13; + badge.textContent = n+' providers · 0€'; + badge.style.color = '#22c55e'; + badge.style.background='rgba(34,197,94,0.15)'; + badge.style.borderColor='rgba(34,197,94,0.3)'; + }).catch(function(){ + var badge = document.getElementById('wtp-udock-status'); + if (badge) badge.textContent = '13 providers · 0€'; + }); + } catch(e){} + } catch(e){ console.warn('wtp-udock inject fail', e); } + } + + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', inject); + } else { + inject(); + } +})();