true, CURLOPT_TIMEOUT=>5]); $col = json_decode(curl_exec($ch), true); curl_close($ch); echo json_encode(["ok"=>true, "collection"=>"weval_skills", "points"=>$col["result"]["points_count"]??0, "status"=>$col["result"]["status"]??"unknown"]); exit; } // Search by scrolling and filtering by payload text match $ch = curl_init("http://127.0.0.1:6333/collections/weval_skills/points/scroll"); curl_setopt_array($ch, [ CURLOPT_POST=>true, CURLOPT_RETURNTRANSFER=>true, CURLOPT_TIMEOUT=>10, CURLOPT_HTTPHEADER=>["Content-Type: application/json"], CURLOPT_POSTFIELDS=>json_encode([ "limit" => 500, "with_payload" => true, "filter" => ["should" => [ ["key"=>"name", "match"=>["text"=>$q]], ["key"=>"desc", "match"=>["text"=>$q]], ]] ]) ]); $resp = json_decode(curl_exec($ch), true); curl_close($ch); $results = []; foreach (($resp["result"]["points"] ?? []) as $p) { $pay = $p["payload"] ?? []; if (stripos($pay["name"]??"", $q) !== false || stripos($pay["desc"]??"", $q) !== false) { $results[] = $pay; if (count($results) >= $limit) break; } } // Fallback: grep /opt/ for matching SKILL.md if (count($results) < 3) { $grep = trim(shell_exec("grep -rl \"" . escapeshellarg($q) . "\" /opt/*/skills/*/SKILL.md /opt/antigravity-awesome-skills/*/SKILL.md 2>/dev/null | head -5")); foreach (explode("\n", $grep) as $f) { if (!$f) continue; $results[] = ["name"=>basename(dirname($f)), "path"=>str_replace("/opt/","", $f), "source"=>"grep"]; } } echo json_encode(["ok"=>true, "query"=>$q, "results"=>array_slice($results, 0, $limit), "count"=>count($results)]);