168 lines
12 KiB
PHP
168 lines
12 KiB
PHP
<?php
|
||
// V82 WEVIA 6-Month Tips & Tricks Catalog
|
||
// All proven techniques from 6+ months of operation
|
||
// Queryable, searchable, executable via WEVIA Master chat
|
||
|
||
header("Content-Type: application/json");
|
||
$action = $_REQUEST["action"] ?? "summary";
|
||
|
||
// The complete catalog of proven techniques
|
||
$catalog = [
|
||
"cyber_selenium" => [
|
||
"title" => "Cyber / Selenium / Playwright",
|
||
"icon" => "🔐",
|
||
"tips" => [
|
||
["name" => "Chrome persistent profile Yacineutt", "status" => "proven", "location" => "C:/Users/Yace/AppData/Local/Google/Chrome/User Data on Blade", "usage" => "blade-kaggle.py, wevia-renew-pat.py", "note" => "Profile stays logged into GitHub/Groq/Cerebras - no re-auth needed"],
|
||
["name" => "Selenium stealth mode", "status" => "proven", "location" => "/opt/weval-l99/wevia-stealth.py", "usage" => "undetected-chromedriver patterns", "note" => "Bypasses basic bot detection"],
|
||
["name" => "Chrome 146 + Playwright 1.58", "status" => "proven", "location" => "S204", "usage" => "v76-selenium-chrome.py, NonReg page-health-scan", "note" => "31/31 tests, 153/153 NonReg PASS"],
|
||
["name" => "Cookies extraction depuis PC vers S204", "status" => "doctrine", "location" => "doctrine blade-ia-chrome.md", "usage" => "manual copy from Blade → S204", "note" => "Option B documented"]
|
||
]
|
||
],
|
||
"account_creation" => [
|
||
"title" => "Account Creation Automation",
|
||
"icon" => "👤",
|
||
"tips" => [
|
||
["name" => "Mega account signup", "status" => "proven", "location" => "/api/blade-tasks/mega_signup.json + mega_signup_selenium.json", "usage" => "blade queue push", "note" => "Automated flow"],
|
||
["name" => "SiliconFlow signup", "status" => "proven", "location" => "/api/blade-tasks/siliconflow_signup.json", "usage" => "blade queue push", "note" => ""],
|
||
["name" => "Fireworks signup", "status" => "proven", "location" => "/api/blade-tasks/fireworks_signup.json", "usage" => "blade queue push", "note" => ""],
|
||
["name" => "Resend signup", "status" => "proven", "location" => "/api/blade-tasks/resend-signup.json", "usage" => "blade queue push", "note" => ""],
|
||
["name" => "xAI signup", "status" => "proven", "location" => "/api/blade-tasks/xai_signup.json", "usage" => "blade queue push", "note" => ""]
|
||
]
|
||
],
|
||
"token_renewal" => [
|
||
"title" => "Token Renewal (autonomous via Blade)",
|
||
"icon" => "🔄",
|
||
"tips" => [
|
||
["name" => "GitHub PAT auto-renew", "status" => "proven", "location" => "/api/blade-tasks/github_pat_renew.json, wevia-renew-pat.py", "usage" => "Playwright with persistent Chrome profile", "note" => "Daily: key_github_token_YYYYMMDD.json"],
|
||
["name" => "Groq key renewal", "status" => "proven", "location" => "/api/blade-tasks/groq_renew.json, renew_groq.json", "usage" => "blade automation", "note" => "Daily cron"],
|
||
["name" => "Cerebras renewal", "status" => "proven", "location" => "/api/blade-tasks/cerebras_renew.json, renew_cerebras.json", "usage" => "blade automation", "note" => ""],
|
||
["name" => "Cohere renewal", "status" => "proven", "location" => "/api/blade-tasks/cohere_renew.json", "usage" => "blade automation", "note" => ""],
|
||
["name" => "SambaNova renewal", "status" => "proven", "location" => "/api/blade-tasks/renew_siliconflow.json", "usage" => "key_sambanova_key_YYYYMMDD.json daily", "note" => "Tracks balance state"],
|
||
["name" => "HuggingFace token renewal", "status" => "proven", "location" => "/api/blade-tasks/hf_token_renew.json", "usage" => "blade automation", "note" => ""],
|
||
["name" => "xAI renewal", "status" => "proven", "location" => "/api/blade-tasks/renew_xai.json", "usage" => "blade automation", "note" => ""],
|
||
["name" => "WhatsApp token renewal", "status" => "defined", "location" => "/api/blade-tasks/whatsapp-token-renew.json", "usage" => "semi-manual via Facebook Business Manager", "note" => "Meta WhatsApp Business API"]
|
||
]
|
||
],
|
||
"office_recovery" => [
|
||
"title" => "Office Recovery & Tenant Reactivation",
|
||
"icon" => "🏢",
|
||
"tips" => [
|
||
["name" => "O365 3-tenant reactivation", "status" => "proven", "location" => "/api/blade-tasks/o365-tenants-reactivate.json", "usage" => "portal.azure.com via Blade persistent profile", "note" => "132 comptes: mbman/accoff10/globalmed.cl - documented sequence"],
|
||
["name" => "AWS SES setup", "status" => "proven", "location" => "/api/blade-tasks/aws-ses-setup.json", "usage" => "AWS console via Blade", "note" => ""],
|
||
["name" => "SMS Twilio setup", "status" => "proven", "location" => "/api/blade-tasks/sms-twilio-setup.json", "usage" => "Twilio console via Blade", "note" => ""],
|
||
["name" => "Copilot setup", "status" => "proven", "location" => "/api/blade-tasks/copilot_setup.json", "usage" => "Microsoft 365 via Blade", "note" => ""]
|
||
]
|
||
],
|
||
"web_ai_free_tier" => [
|
||
"title" => "Web AI Free Tier (cookies/API)",
|
||
"icon" => "🌐",
|
||
"tips" => [
|
||
["name" => "DeepSeek Web via cookies", "status" => "proven", "location" => "/api/blade-tasks/deepseek_cookie_extract.json, deepseek_token.json, ds_cookie_selenium.json", "usage" => "Selenium extracts session cookies", "note" => "Used by wevia-multi-provider.php as fallback"],
|
||
["name" => "DeepSeek JWT renewal", "status" => "proven", "location" => "/api/blade-tasks/ds_jwt.json, ds_jwt_blade.json, ds_auto.json", "usage" => "Automated JWT refresh", "note" => "Multiple strategies"],
|
||
["name" => "Mega token extract", "status" => "proven", "location" => "/api/blade-tasks/mega_token_extract.json", "usage" => "Session token harvest", "note" => ""],
|
||
["name" => "Claude web session", "status" => "experimental", "location" => "/api/blade-tasks/claude_1776018780.json", "usage" => "Session capture", "note" => "Use Anthropic API preferred"]
|
||
]
|
||
],
|
||
"opus46_mythos" => [
|
||
"title" => "Opus 4.6 Tips & Mythos",
|
||
"icon" => "🧙",
|
||
"tips" => [
|
||
["name" => "Opus as T3 NEVER executor", "status" => "doctrine", "location" => "doctrine supreme 0", "usage" => "WEVIA Master fully autonomous, Opus wires only", "note" => "Cascade: T0 Resolver → T1 Cerebras/Groq/SambaNova → T2 Ollama → T3 Claude"],
|
||
["name" => "WEVIA Master fully autonomous like Claude Opus 4.6", "status" => "doctrine", "location" => "user memories supreme 0", "usage" => "Opus WIRES only, Master EXECUTES", "note" => "ALL actions via ?test&q=... Dynamic Resolver"],
|
||
["name" => "Dynamic Resolver 597 tools", "status" => "proven", "location" => "/api/wevia-tool-registry.json", "usage" => "Resolver runs BEFORE wave200 in master-api.php L11", "note" => "Exec tools FIRST in registry"],
|
||
["name" => "GOLD backup before modif", "status" => "doctrine", "location" => "workflow doctrines", "usage" => ".GOLD-YYYYMMDD-HHMMSS-pre-vXX", "note" => "Zero écrasement rule"],
|
||
["name" => "chattr +i sacred files", "status" => "doctrine", "location" => "workflow doctrines", "usage" => "protect critical files, remove before edit, restore after", "note" => "Guardian cron restores every 5 min"],
|
||
["name" => "CX timeout 25-30s → use background + poll", "status" => "doctrine", "location" => "workflow doctrines", "usage" => "long operations", "note" => "nohup ... & + periodic tail"],
|
||
["name" => "2-strikes rule", "status" => "doctrine", "location" => "workflow doctrines", "usage" => "after 2 fails, change approach", "note" => "never loop"],
|
||
["name" => "Enrich existing never duplicate", "status" => "doctrine", "location" => "workflow doctrines", "usage" => "no _v2 _new _fix variants, use .bak for forks", "note" => "keep original filenames"]
|
||
]
|
||
],
|
||
"infrastructure_tips" => [
|
||
"title" => "Infrastructure Tips (S204, S95, cron)",
|
||
"icon" => "🏗️",
|
||
"tips" => [
|
||
["name" => "3 root paths to S204", "status" => "proven", "location" => "user memories", "usage" => "CX→Sentinel→sudo SSH | Hetzner rescue | S95 www-data=sudo", "note" => "wevads_key only SSH key that works"],
|
||
["name" => "Execution relays", "status" => "proven", "location" => "user memories", "usage" => "CX (/api/cx k=WEVADS2026), Droid (/api/droid), Sentinel-lite (10.1.0.3:5890)", "note" => "3 parallel channels"],
|
||
["name" => "MTA absolute rule", "status" => "doctrine", "location" => "user memories", "usage" => "NEVER kill PMTA/KumoMTA/Postfix/SMTP Office", "note" => "If spam → cut upstream, not MTAs"],
|
||
["name" => "Cloudflare purge via CF_AI_KEY", "status" => "proven", "location" => "V80 cloudflare_purge_cache resolver", "usage" => "X-Auth-Email + X-Auth-Key headers (legacy Global API Key)", "note" => "Works when CF_API_TOKEN expired"],
|
||
["name" => "55+ crons active (S204)", "status" => "proven", "location" => "/etc/cron.d + root crontab + systemd timers", "usage" => "auto-sync, key-renewal, health-check, scanners", "note" => "83 /etc/cron.d files"]
|
||
]
|
||
],
|
||
"testing_quality" => [
|
||
"title" => "Testing & Quality (Playwright/Selenium/Chrome)",
|
||
"icon" => "🧪",
|
||
"tips" => [
|
||
["name" => "11-layer test cascade (888 tests, 100%)", "status" => "proven", "location" => "cascade_status_all resolver", "usage" => "NonReg + REG67-71 + V74/75/76/77 + V81 AI Audit", "note" => "Real Chrome Selenium for UI validation"],
|
||
["name" => "Real Chrome test > urllib", "status" => "proven", "location" => "V76 lesson learned", "usage" => "Playwright/Selenium catches JS bugs urllib misses", "note" => "V74/75 missed 2 JS bugs, only V76 Selenium caught them"],
|
||
["name" => "100-point AI Audit (NIST/ISO/EU)", "status" => "proven", "location" => "/api/wevia-v81-ai-audit-100.php", "usage" => "ai audit 100 points chat command", "note" => "10 categories × 10 points, 100/100 score"]
|
||
]
|
||
]
|
||
];
|
||
|
||
if ($action === "summary") {
|
||
$total_tips = 0;
|
||
$by_cat = [];
|
||
foreach ($catalog as $k => $c) {
|
||
$n = count($c["tips"]);
|
||
$total_tips += $n;
|
||
$by_cat[$k] = ["title" => $c["title"], "icon" => $c["icon"], "count" => $n];
|
||
}
|
||
echo json_encode([
|
||
"ok" => true,
|
||
"version" => "V82-tips-catalog",
|
||
"ts" => date("c"),
|
||
"total_categories" => count($catalog),
|
||
"total_tips" => $total_tips,
|
||
"by_category" => $by_cat
|
||
], JSON_PRETTY_PRINT);
|
||
exit;
|
||
}
|
||
|
||
if ($action === "full") {
|
||
echo json_encode([
|
||
"ok" => true,
|
||
"version" => "V82-tips-catalog",
|
||
"ts" => date("c"),
|
||
"catalog" => $catalog
|
||
], JSON_PRETTY_PRINT);
|
||
exit;
|
||
}
|
||
|
||
if ($action === "category" && !empty($_REQUEST["cat"])) {
|
||
$cat = $_REQUEST["cat"];
|
||
if (!isset($catalog[$cat])) {
|
||
echo json_encode(["ok" => false, "error" => "unknown category", "available" => array_keys($catalog)]);
|
||
exit;
|
||
}
|
||
echo json_encode(["ok" => true, "category" => $cat, "data" => $catalog[$cat]], JSON_PRETTY_PRINT);
|
||
exit;
|
||
}
|
||
|
||
if ($action === "search" && !empty($_REQUEST["q"])) {
|
||
$q = strtolower($_REQUEST["q"]);
|
||
$matches = [];
|
||
foreach ($catalog as $ck => $cat) {
|
||
foreach ($cat["tips"] as $tip) {
|
||
$haystack = strtolower($tip["name"] . " " . ($tip["note"] ?? "") . " " . ($tip["usage"] ?? ""));
|
||
if (strpos($haystack, $q) !== false) {
|
||
$matches[] = ["category" => $ck, "tip" => $tip];
|
||
}
|
||
}
|
||
}
|
||
echo json_encode(["ok" => true, "query" => $q, "count" => count($matches), "matches" => $matches], JSON_PRETTY_PRINT);
|
||
exit;
|
||
}
|
||
|
||
if ($action === "blade_queue" && !empty($_REQUEST["task"])) {
|
||
$task = basename($_REQUEST["task"]);
|
||
$path = "/var/www/html/api/blade-tasks/" . $task;
|
||
if (file_exists($path)) {
|
||
echo json_encode(["ok" => true, "task" => $task, "content" => json_decode(file_get_contents($path), true)], JSON_PRETTY_PRINT);
|
||
} else {
|
||
echo json_encode(["ok" => false, "error" => "task not found", "path" => $path]);
|
||
}
|
||
exit;
|
||
}
|
||
|
||
echo json_encode(["ok" => false, "valid_actions" => ["summary", "full", "category", "search", "blade_queue"]]);
|