diff --git a/api/blade-actions-surfaced.json b/api/blade-actions-surfaced.json index de3af3328..42ef47da8 100644 --- a/api/blade-actions-surfaced.json +++ b/api/blade-actions-surfaced.json @@ -1,15 +1,15 @@ { - "generated_at": "2026-04-19T19:15:02.096988", + "generated_at": "2026-04-19T19:20:02.290699", "stats": { - "total": 467, - "pending": 895, + "total": 468, + "pending": 897, "kaouther_surfaced": 29, "chrome_surfaced": 10, "notif_only_done": 0, "autofix_archived": 0, "cerebras_archived": 0, "older_3d_archived": 0, - "unknown": 428, + "unknown": 429, "errors": 0 }, "actions": [ diff --git a/api/blade-tasks/task_20260419172002_acb6c5.json b/api/blade-tasks/task_20260419172002_acb6c5.json new file mode 100644 index 000000000..3b9af161a --- /dev/null +++ b/api/blade-tasks/task_20260419172002_acb6c5.json @@ -0,0 +1,11 @@ +{ + "id": "task_20260419172002_acb6c5", + "name": "Blade self-heal 19:20", + "type": "powershell", + "command": "\n# Blade self-heal\nWrite-Host \"Self-heal triggered $(Get-Date)\"\n$agentProc = Get-Process powershell | Where-Object { $_.CommandLine -match 'sentinel-agent' }\nif (!$agentProc) {\n Write-Host \"Agent not running, starting...\"\n Start-Process powershell -ArgumentList \"-ExecutionPolicy\",\"Bypass\",\"-File\",\"C:\\ProgramData\\WEVAL\\sentinel-agent.ps1\" -WindowStyle Hidden\n}\n# Clear stale tasks > 3 days locally\n$cutoff = (Get-Date).AddDays(-3)\nGet-ChildItem \"C:\\ProgramData\\WEVAL\\tasks\\*.json\" -ErrorAction SilentlyContinue | Where-Object { $_.LastWriteTime -lt $cutoff } | Move-Item -Destination \"C:\\ProgramData\\WEVAL\\tasks\\archived\\\" -Force -ErrorAction SilentlyContinue\nWrite-Host \"Self-heal complete\"\n", + "cmd": "\n# Blade self-heal\nWrite-Host \"Self-heal triggered $(Get-Date)\"\n$agentProc = Get-Process powershell | Where-Object { $_.CommandLine -match 'sentinel-agent' }\nif (!$agentProc) {\n Write-Host \"Agent not running, starting...\"\n Start-Process powershell -ArgumentList \"-ExecutionPolicy\",\"Bypass\",\"-File\",\"C:\\ProgramData\\WEVAL\\sentinel-agent.ps1\" -WindowStyle Hidden\n}\n# Clear stale tasks > 3 days locally\n$cutoff = (Get-Date).AddDays(-3)\nGet-ChildItem \"C:\\ProgramData\\WEVAL\\tasks\\*.json\" -ErrorAction SilentlyContinue | Where-Object { $_.LastWriteTime -lt $cutoff } | Move-Item -Destination \"C:\\ProgramData\\WEVAL\\tasks\\archived\\\" -Force -ErrorAction SilentlyContinue\nWrite-Host \"Self-heal complete\"\n", + "priority": "high", + "status": "pending", + "created": "2026-04-19T17:20:02+00:00", + "created_by": "blade-control-ui" +} \ No newline at end of file diff --git a/api/create-vertical-landing.sh b/api/create-vertical-landing.sh new file mode 100755 index 000000000..3113a871c --- /dev/null +++ b/api/create-vertical-landing.sh @@ -0,0 +1,229 @@ +#!/usr/bin/env bash +# WEVAL — Create Vertical Landing + Chatbot +# Usage: create-vertical-landing.sh +# Doctrine #5 ZERO écrasement, #14 pages intouchables SAUF AMÉLIORATION, #60 UX premium +set -euo pipefail + +V="${1:-}" +if [ -z "$V" ]; then echo "ERROR: vertical required (ocp|banque|retail|industrie)"; exit 1; fi + +# Titles & content per vertical +declare -A TITLE PITCH KPI1 KPI2 KPI3 COLOR EMOJI +TITLE[ocp]="OCP Group — IA Souveraine pour Phosphates" +PITCH[ocp]="Opérations minières augmentées : 669 agents IA, 17 départements, ERP Gap-Fill, souveraineté MA." +KPI1[ocp]="14 000"; KPI2[ocp]="-18%"; KPI3[ocp]="3 mois" +COLOR[ocp]="#00d4aa"; EMOJI[ocp]="⛏️" + +TITLE[banque]="Banque Maroc — IA Conformité & Scoring" +PITCH[banque]="Scoring crédit temps réel, KYC automatisé, conformité BAM + ACPR, AML IA 669 agents." +KPI1[banque]="92%"; KPI2[banque]="-45%"; KPI3[banque]="6 sem" +COLOR[banque]="#2563eb"; EMOJI[banque]="🏦" + +TITLE[retail]="Retail Maroc — IA Supply & Customer 360" +PITCH[retail]="Prévisions demande, customer 360, ruptures stock anticipées, 669 agents, 17 depts." +KPI1[retail]="+23%"; KPI2[retail]="-31%"; KPI3[retail]="4 sem" +COLOR[retail]="#f59e0b"; EMOJI[retail]="🛒" + +TITLE[industrie]="Industrie Maroc — IA Production & Qualité" +PITCH[industrie]="OEE live, maintenance prédictive, contrôle qualité IA, 669 agents, ERP Gap-Fill SAP/Oracle." +KPI1[industrie]="+17%"; KPI2[industrie]="-28%"; KPI3[industrie]="3 mois" +COLOR[industrie]="#a855f7"; EMOJI[industrie]="🏭" + +if [ -z "${TITLE[$V]:-}" ]; then echo "ERROR: unknown vertical '$V'"; exit 2; fi + +OUT="/var/www/html/landing-$V.html" + +# DOCTRINE #5 ZERO écrasement +if [ -f "$OUT" ]; then + echo "SKIP: $OUT already exists (doctrine #5 zero écrasement)" + exit 0 +fi + +# GOLD backup preempt (even though file doesn't exist, record intent) +mkdir -p /opt/wevads/vault/golds +echo "{\"vertical\":\"$V\",\"file\":\"$OUT\",\"created_at\":\"$(date -Iseconds)\",\"session\":\"v96-rootcause-fix-6sigma-finalpush\"}" > "/opt/wevads/vault/golds/landing-$V.meta" + +cat > "$OUT" < + + + + +${TITLE[$V]} — WEVAL + + + + +
+
WEVAL ${EMOJI[$V]}
+ +
+ +
+
+ Vertical ${V^^} LIVE +

${TITLE[$V]//[^-]- */}
${TITLE[$V]##*— }

+

${PITCH[$V]}

+ Demander une démo +
+
${KPI1[$V]}Clients cibles
+
${KPI2[$V]}Réduction coûts
+
${KPI3[$V]}Time to value
+
+
+
+ +
+
+

Use cases IA ${V^^}

+

Les 669 agents IA autonomes WEVIA couvrent 17 départements avec zero vendor lock-in, cascade souveraine 13 providers 0€, ERP Gap-Fill SAP/Oracle/NetSuite/Dynamics.

+
+

${EMOJI[$V]} Agents dédiés

Sous-ensemble spécialisé du workforce 669 agents + skills domaine.

+

🧠 Brain Monitoring

Auto-intent detection, self-audit, learning pulse 60s, NO_EXEC remediation.

+

⚡ Cascade souveraine

13 providers 0€ (Cerebras/Groq/SambaNova/Mistral) + Ollama on-prem fallback.

+

🔒 Conformité

RGPD, souveraineté données MA, audit trail complet, GOLD backups mandatory.

+
+
+
+ +
+
+

Demande de démo ${V^^}

+

Réponse garantie sous 24h ouvrées — équipe dédiée vertical ${V^^}.

+
+ + + + + + + + + + +
+
+
+
+ + + + + + + +HTML + +chown www-data:www-data "$OUT" +chmod 644 "$OUT" +echo "CREATED: $OUT (size=$(stat -c %s "$OUT") bytes)" diff --git a/api/wave-wiring-queue.json b/api/wave-wiring-queue.json index c463e220c..7818a5045 100644 --- a/api/wave-wiring-queue.json +++ b/api/wave-wiring-queue.json @@ -4095,5 +4095,65 @@ "status": "PENDING_APPROVAL", "created_at": "2026-04-19T17:17:13+00:00", "source": "opus4-autowire-early-v2" + }, + "311": { + "name": "wire_vertical_ocp", + "triggers": [ + "wire vertical ocp", + "create landing ocp", + "chatbot ocp" + ], + "cmd": "bash \/var\/www\/html\/api\/create-vertical-landing.sh ocp", + "status": "PENDING_APPROVAL", + "created_at": "2026-04-19T17:19:02+00:00", + "source": "opus4-autowire-early-v2" + }, + "312": { + "name": "wire_vertical_banque", + "triggers": [ + "wire vertical banque", + "create landing banque", + "chatbot banque" + ], + "cmd": "bash \/var\/www\/html\/api\/create-vertical-landing.sh banque", + "status": "PENDING_APPROVAL", + "created_at": "2026-04-19T17:19:02+00:00", + "source": "opus4-autowire-early-v2" + }, + "313": { + "name": "wire_vertical_retail", + "triggers": [ + "wire vertical retail", + "create landing retail", + "chatbot retail" + ], + "cmd": "bash \/var\/www\/html\/api\/create-vertical-landing.sh retail", + "status": "PENDING_APPROVAL", + "created_at": "2026-04-19T17:19:03+00:00", + "source": "opus4-autowire-early-v2" + }, + "314": { + "name": "wire_vertical_industrie", + "triggers": [ + "wire vertical industrie", + "create landing industrie", + "chatbot industrie" + ], + "cmd": "bash \/var\/www\/html\/api\/create-vertical-landing.sh industrie", + "status": "PENDING_APPROVAL", + "created_at": "2026-04-19T17:19:03+00:00", + "source": "opus4-autowire-early-v2" + }, + "315": { + "name": "wire_conversion_tracker", + "triggers": [ + "wire conversion tracker", + "create tracking table", + "setup conversion tracking" + ], + "cmd": "bash \/var\/www\/html\/api\/wire-conversion-tracking.sh", + "status": "PENDING_APPROVAL", + "created_at": "2026-04-19T17:19:04+00:00", + "source": "opus4-autowire-early-v2" } } \ No newline at end of file diff --git a/api/wire-conversion-tracking.sh b/api/wire-conversion-tracking.sh new file mode 100755 index 000000000..425d2c06f --- /dev/null +++ b/api/wire-conversion-tracking.sh @@ -0,0 +1,101 @@ +#!/usr/bin/env bash +# WEVAL — Wire Chatbot→Sales Conversion Tracking +# Crée table chatbot_conversions + API endpoint /api/chatbot-conversion-track.php +# Doctrine #5 zero écrasement — skip si déjà existant +set -euo pipefail + +PG_PASS="admin123" +PG_HOST="10.1.0.3" +PG_USER="admin" +PG_DB="adx_system" + +# 1. Créer table chatbot_conversions (idempotent) +psql_cmd() { + PGPASSWORD="$PG_PASS" timeout 10 psql -h "$PG_HOST" -U "$PG_USER" -d "$PG_DB" -c "$1" 2>&1 +} + +TABLE_EXISTS=$(PGPASSWORD="$PG_PASS" timeout 10 psql -h "$PG_HOST" -U "$PG_USER" -d "$PG_DB" -tAc "SELECT 1 FROM pg_tables WHERE tablename='chatbot_conversions'" 2>&1 || echo "") + +if [ "$TABLE_EXISTS" != "1" ]; then + psql_cmd "CREATE TABLE IF NOT EXISTS chatbot_conversions ( + id BIGSERIAL PRIMARY KEY, + session_id TEXT NOT NULL, + event TEXT NOT NULL, + vertical TEXT, + source TEXT, + data JSONB, + url TEXT, + referrer TEXT, + ip INET, + user_agent TEXT, + ts TIMESTAMPTZ DEFAULT NOW() + );" + psql_cmd "CREATE INDEX IF NOT EXISTS idx_chatbot_conv_session ON chatbot_conversions(session_id);" + psql_cmd "CREATE INDEX IF NOT EXISTS idx_chatbot_conv_vertical ON chatbot_conversions(vertical);" + psql_cmd "CREATE INDEX IF NOT EXISTS idx_chatbot_conv_event ON chatbot_conversions(event);" + psql_cmd "CREATE INDEX IF NOT EXISTS idx_chatbot_conv_ts ON chatbot_conversions(ts DESC);" + echo "TABLE_CREATED: chatbot_conversions with 4 indexes" +else + echo "TABLE_EXISTS: chatbot_conversions (skip creation — doctrine #5)" +fi + +# 2. Créer API endpoint /api/chatbot-conversion-track.php +ENDPOINT="/var/www/html/api/chatbot-conversion-track.php" +if [ -f "$ENDPOINT" ]; then + echo "ENDPOINT_EXISTS: $ENDPOINT (skip — doctrine #5)" +else + cat > "$ENDPOINT" <<'PHP' + false, 'error' => 'event required']); + exit; +} + +$ip = $_SERVER['HTTP_CF_CONNECTING_IP'] ?? ($_SERVER['HTTP_X_FORWARDED_FOR'] ?? ($_SERVER['REMOTE_ADDR'] ?? null)); +if ($ip && strpos($ip, ',') !== false) $ip = trim(explode(',', $ip)[0]); +$ua = substr($_SERVER['HTTP_USER_AGENT'] ?? '', 0, 500); + +try { + $pdo = new PDO('pgsql:host=10.1.0.3;port=5432;dbname=adx_system', 'admin', 'admin123', [ + PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, + PDO::ATTR_TIMEOUT => 3 + ]); + $stmt = $pdo->prepare('INSERT INTO chatbot_conversions (session_id, event, vertical, source, data, url, referrer, ip, user_agent) VALUES (?, ?, ?, ?, ?::jsonb, ?, ?, ?, ?)'); + $stmt->execute([ + $session_id, $event, $vertical, $source, + $data ? json_encode($data) : null, + $url, $referrer, $ip, $ua + ]); + echo json_encode(['ok' => true, 'session_id' => $session_id, 'event' => $event]); +} catch (Exception $e) { + error_log('[chatbot-conv-track] ' . $e->getMessage()); + echo json_encode(['ok' => false, 'error' => 'store_failed']); +} +PHP + chown www-data:www-data "$ENDPOINT" + chmod 644 "$ENDPOINT" + echo "ENDPOINT_CREATED: $ENDPOINT" +fi + +# 3. Sanity check +COUNT=$(PGPASSWORD="$PG_PASS" timeout 10 psql -h "$PG_HOST" -U "$PG_USER" -d "$PG_DB" -tAc "SELECT COUNT(*) FROM chatbot_conversions" 2>&1 || echo "N/A") +echo "CONVERSIONS_STORED_COUNT: $COUNT" +echo "WIRE_OK" diff --git a/api/wired-pending/intent-opus4-wire_conversion_tracker.php b/api/wired-pending/intent-opus4-wire_conversion_tracker.php new file mode 100644 index 000000000..dd84cb846 --- /dev/null +++ b/api/wired-pending/intent-opus4-wire_conversion_tracker.php @@ -0,0 +1,14 @@ + 'wire_conversion_tracker', + 'triggers' => + array ( + 0 => 'wire conversion tracker', + 1 => 'create tracking table', + 2 => 'setup conversion tracking', + ), + 'cmd' => 'bash /var/www/html/api/wire-conversion-tracking.sh', + 'status' => 'PENDING_APPROVAL', + 'created_at' => '2026-04-19T17:19:04+00:00', + 'source' => 'opus4-autowire-early-v2', +); diff --git a/api/wired-pending/intent-opus4-wire_vertical_banque.php b/api/wired-pending/intent-opus4-wire_vertical_banque.php new file mode 100644 index 000000000..8fd318a01 --- /dev/null +++ b/api/wired-pending/intent-opus4-wire_vertical_banque.php @@ -0,0 +1,14 @@ + 'wire_vertical_banque', + 'triggers' => + array ( + 0 => 'wire vertical banque', + 1 => 'create landing banque', + 2 => 'chatbot banque', + ), + 'cmd' => 'bash /var/www/html/api/create-vertical-landing.sh banque', + 'status' => 'PENDING_APPROVAL', + 'created_at' => '2026-04-19T17:19:02+00:00', + 'source' => 'opus4-autowire-early-v2', +); diff --git a/api/wired-pending/intent-opus4-wire_vertical_industrie.php b/api/wired-pending/intent-opus4-wire_vertical_industrie.php new file mode 100644 index 000000000..c19b04f68 --- /dev/null +++ b/api/wired-pending/intent-opus4-wire_vertical_industrie.php @@ -0,0 +1,14 @@ + 'wire_vertical_industrie', + 'triggers' => + array ( + 0 => 'wire vertical industrie', + 1 => 'create landing industrie', + 2 => 'chatbot industrie', + ), + 'cmd' => 'bash /var/www/html/api/create-vertical-landing.sh industrie', + 'status' => 'PENDING_APPROVAL', + 'created_at' => '2026-04-19T17:19:03+00:00', + 'source' => 'opus4-autowire-early-v2', +); diff --git a/api/wired-pending/intent-opus4-wire_vertical_ocp.php b/api/wired-pending/intent-opus4-wire_vertical_ocp.php new file mode 100644 index 000000000..ea7a59bed --- /dev/null +++ b/api/wired-pending/intent-opus4-wire_vertical_ocp.php @@ -0,0 +1,14 @@ + 'wire_vertical_ocp', + 'triggers' => + array ( + 0 => 'wire vertical ocp', + 1 => 'create landing ocp', + 2 => 'chatbot ocp', + ), + 'cmd' => 'bash /var/www/html/api/create-vertical-landing.sh ocp', + 'status' => 'PENDING_APPROVAL', + 'created_at' => '2026-04-19T17:19:02+00:00', + 'source' => 'opus4-autowire-early-v2', +); diff --git a/api/wired-pending/intent-opus4-wire_vertical_retail.php b/api/wired-pending/intent-opus4-wire_vertical_retail.php new file mode 100644 index 000000000..8d81c78df --- /dev/null +++ b/api/wired-pending/intent-opus4-wire_vertical_retail.php @@ -0,0 +1,14 @@ + 'wire_vertical_retail', + 'triggers' => + array ( + 0 => 'wire vertical retail', + 1 => 'create landing retail', + 2 => 'chatbot retail', + ), + 'cmd' => 'bash /var/www/html/api/create-vertical-landing.sh retail', + 'status' => 'PENDING_APPROVAL', + 'created_at' => '2026-04-19T17:19:03+00:00', + 'source' => 'opus4-autowire-early-v2', +);