phase50 doctrine188 ZERO MANUEL WEVIA via BLADE IA REMOTE | MCP blade 8765 17 tools exposed | ask_blade_<provider> pilote Chrome Yacine deja logge via blade_open_url+blade_send_keys | 8 providers: chatgpt claude gemini deepseek mistral poe perplexity hf | fallback: si blade offline -> ask_<provider>_web (CDP local) | 207->216 intents | test E2E: blade_status online 188ms | ask_blade_claude launched async 200ms | Yacine 0 login requis chrome blade deja connect
Some checks failed
WEVAL NonReg / nonreg (push) Has been cancelled

This commit is contained in:
Opus
2026-04-24 15:37:20 +02:00
parent 40bf5a23e0
commit e537675e7d
2 changed files with 1407 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,70 @@
#!/bin/bash
# ask-blade-ia.sh - pilote Chrome Yacine via MCP Blade (ZERO login manuel)
# Usage: ask-blade-ia.sh <provider>
# Workflow: blade_open_url -> blade_send_keys <prompt> + Enter -> wait -> blade_chrome_cdp extract text
PROVIDER="$1"
MCP="http://127.0.0.1:8765"
MSG_FILE="/tmp/wevia-last-msg.log"
[ -f "$MSG_FILE" ] || { echo "ERR: msg file missing"; exit 1; }
MSG=$(cat "$MSG_FILE")
# Alias mapping
case "$PROVIDER" in
openai) URL="https://chat.openai.com" ;;
anthropic) URL="https://claude.ai" ;;
google) URL="https://gemini.google.com" ;;
deepseek) URL="https://chat.deepseek.com" ;;
mistral) URL="https://chat.mistral.ai" ;;
poe) URL="https://poe.com" ;;
perplexity) URL="https://www.perplexity.ai" ;;
hf) URL="https://huggingface.co/chat" ;;
*) echo "Unknown provider: $PROVIDER"; exit 1 ;;
esac
case "$PROVIDER" in
openai) ALIASES="openai|chatgpt|gpt" ;;
anthropic) ALIASES="anthropic|claude" ;;
google) ALIASES="google|gemini|bard" ;;
deepseek) ALIASES="deepseek" ;;
mistral) ALIASES="mistral|lechat" ;;
poe) ALIASES="poe" ;;
perplexity) ALIASES="perplexity|pplx" ;;
hf) ALIASES="hf|huggingface" ;;
esac
PROMPT=$(echo "$MSG" | sed -E "s/^[^a-zA-Z]*(ask|demande)?[_ ]?(blade[_ ])?(${ALIASES})([_ ](web|ai|blade))?[ :,]+//i" | sed 's/^[[:space:]]*//')
if [ -z "$PROMPT" ] || [ ${#PROMPT} -lt 4 ]; then
echo "USAGE: ask_blade_${PROVIDER} <question>"
echo "Aliases: $ALIASES"
echo "Pilote Chrome Yacine sur Razer Blade (zero login manuel)"
exit 0
fi
# Check Blade online
BLADE_ONLINE=$(curl -s -m5 -X POST "$MCP" -H "Content-Type: application/json" \
-d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"blade_status\",\"arguments\":{}}}" \
2>/dev/null | python3 -c "
import json,sys
try:
d=json.load(sys.stdin)
t=d['result']['content'][0]['text']
s=json.loads(t)
print('yes' if s.get('status',{}).get('blade',{}).get('online') else 'no')
except: print('err')
")
if [ "$BLADE_ONLINE" != "yes" ]; then
echo "=== BLADE OFFLINE (status=$BLADE_ONLINE) ==="
echo "L'agent Blade sur le PC de Yacine ne repond pas."
echo "Fallback possible: ask_${PROVIDER}_web (CDP local)"
exit 1
fi
echo "=== ${PROVIDER} via BLADE Razer (Yacine Chrome logged-in) ==="
echo "prompt: ${PROMPT:0:100}"
echo "url: $URL"
# Launch async job
JOB_CMD="curl -s -m30 -X POST $MCP -H 'Content-Type: application/json' -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"blade_open_url\",\"arguments\":{\"url\":\"${URL}\"}}}' | head -20; sleep 4; curl -s -m30 -X POST $MCP -H 'Content-Type: application/json' -d '{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools/call\",\"params\":{\"name\":\"blade_send_keys\",\"arguments\":{\"keys\":\"${PROMPT//\"/\\\\\\\"}\\n\"}}}' | head -20"
/opt/weval-ops/opus-intents/async-exec.sh "$JOB_CMD"