- Add ia_dev submodule (projects/smart_ide on forge 4nk) - Document APIs, orchestrator, gateway, local-office, rollout - Add systemd/scripts layout; relocate setup scripts - Remove obsolete nginx/enso-only docs from this repo scope
2.1 KiB
2.1 KiB
API — agent-regex-search-api
Service Node : recherche regex sur fichiers via ripgrep (rg), résultats en JSON. Périmètre confiné à REGEX_SEARCH_ROOT.
- Code :
services/agent-regex-search-api/ - Bind :
REGEX_SEARCH_HOST(défaut127.0.0.1) - Port :
REGEX_SEARCH_PORT(défaut37143) - Prérequis :
rgdans lePATH(sinon réponse503sur/search)
Authentification
Authorization: Bearer <REGEX_SEARCH_TOKEN>
REGEX_SEARCH_TOKEN obligatoire au démarrage. Exception : GET /health ne exige pas le Bearer.
Endpoints
GET /health ou GET /health/
Réponse 200
{
"status": "ok",
"root": "<REGEX_SEARCH_ROOT résolu>"
}
POST /search
Corps JSON
| Champ | Obligatoire | Description |
|---|---|---|
pattern |
oui | Regex style Rust, passée à ripgrep |
subpath |
non | Chemin relatif sous la racine (pas de .., pas absolu) |
maxMatches |
non | Plafond de résultats (défaut 500, max 50000) |
timeoutMs |
non | Timeout exécution rg en ms (défaut 60000, max 300000) |
Réponse 200 (succès ripgrep, y compris « aucune correspondance », code sortie 1)
{
"root": "string",
"target": "string",
"matches": [{ "path": "string", "lineNumber": number, "line": "string" }],
"truncated": boolean,
"exitCode": number
}
Autres réponses
400: corps invalide,patternmanquant, ou erreur ripgrep code2(regex / IO) — peut inclureerror,matches,truncated,exitCode401/ absence de réponse utile : Bearer manquant ou incorrect sur/search404: chemin non géré503:rgintrouvable (exitCode127 côté implémentation) —{ "error", "matches": [], "truncated": false }
Variables d’environnement
| Variable | Obligatoire | Description |
|---|---|---|
REGEX_SEARCH_TOKEN |
oui | Secret Bearer |
REGEX_SEARCH_ROOT |
non | Répertoire de base des recherches (défaut /home/ncantu/code) |
REGEX_SEARCH_HOST |
non | Bind |
REGEX_SEARCH_PORT |
non | Port |