23 lines
850 B
Python
23 lines
850 B
Python
#!/usr/bin/env python3
|
|
"""V102 - Extend orchestrator multi-agent trigger regex (additif pur)"""
|
|
path = "/var/www/html/api/wevia-orchestrator.php"
|
|
with open(path, "rb") as f:
|
|
raw = f.read()
|
|
|
|
if b"orchestrate|status all|all status|parallel|simultan" in raw:
|
|
print("ALREADY EXTENDED")
|
|
exit(0)
|
|
|
|
old = b'$is_multi = preg_match("/(multi.?agent|orchestre|mobilise|coordonne|tout finir|rapport|reconcile|6sigma|full scan)/i", $q_lower);'
|
|
|
|
new = b'$is_multi = preg_match("/(multi.?agent|orchestre|orchestrate|mobilise|coordonne|tout finir|rapport|reconcile|6sigma|full scan|status all|all status|parallel|simultan|bilan|exhaustif|cartograph|tous les agents)/i", $q_lower);'
|
|
|
|
if old not in raw:
|
|
print("MARKER NOT FOUND")
|
|
exit(1)
|
|
|
|
raw = raw.replace(old, new, 1)
|
|
with open(path, "wb") as f:
|
|
f.write(raw)
|
|
print(f"PATCHED size={len(raw)}")
|