From 197b8fa48b7130889b6fe2260b4c636d38e993d1 Mon Sep 17 00:00:00 2001 From: Yanis Mahboub Date: Mon, 13 Apr 2026 04:38:29 +0200 Subject: [PATCH] Wave 114 auto --- tool-registry-v2.json | 2 +- wevia-vault-context.php | 45 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 wevia-vault-context.php diff --git a/tool-registry-v2.json b/tool-registry-v2.json index c9db9b6..9d5f6d6 100644 --- a/tool-registry-v2.json +++ b/tool-registry-v2.json @@ -1426,7 +1426,7 @@ "id": "disk_detail", "kw": "disk.*detail|espace.*disk|df|stockage", "api": "exec", - "cmd": "df -h / | tail -1 && echo --- && du -sh /var/www/html /opt/weval-l99 /opt/wevia-brain 2>/dev/null" + "cmd": "df -h / | tail -1 && echo --- && echo DIRS_SKIP" }, { "id": "kb_vectors", diff --git a/wevia-vault-context.php b/wevia-vault-context.php new file mode 100644 index 0000000..0609409 --- /dev/null +++ b/wevia-vault-context.php @@ -0,0 +1,45 @@ + strlen($w) >= 4); + if ($keywords) { + $found = 0; + $iter = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($VAULT)); + foreach ($iter as $file) { + if ($file->getExtension() !== 'md' || $found >= $maxNotes) continue; + $content = file_get_contents($file->getPathname()); + $lower = strtolower($content); + foreach ($keywords as $kw) { + if (stripos($lower, $kw) !== false) { + $rel = str_replace("$VAULT/", '', $file->getPathname()); + if (preg_match('/---.*?---\s*(.*)/s', $content, $m)) $content = $m[1]; + $ctx .= "[VAULT:$rel] " . trim(substr($content, 0, 300)) . "\n"; + $found++; + break; + } + } + } + } + + return $ctx ? "\n[VAULT CONTEXT]\n$ctx" : ''; +}