smart_ide/docs/API/smart-ide-tools-bridge-api.md
4NK 14c974f54c Add smart-ide-tools-bridge API for submodule tools + central local env
- New service: tools bridge (port 37147) registry + Carbonyl/PageIndex/Chandra POST jobs
- config/services.local.env.example and gitignore for services.local.env
- .env.example for repos-devtools, regex-search, ia-dev-gateway, orchestrator, claw proxy, langextract
- Orchestrator intents: tools.registry, tools.carbonyl.plan, tools.pageindex.run, tools.chandra.ocr
- Docs: API + repo service fiche, architecture index; do not commit dist/
2026-04-03 22:35:57 +02:00

43 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# API smart-ide-tools-bridge
Écoute **`127.0.0.1`** par défaut, port **`37147`** (`TOOLS_BRIDGE_PORT`). Auth : **`Authorization: Bearer <TOOLS_BRIDGE_TOKEN>`** (obligatoire sauf **`GET /health`**).
## Endpoints
| Méthode | Chemin | Rôle |
|---------|--------|------|
| GET | `/health` | Santé (sans Bearer). |
| GET | `/v1/registry` | JSON : URLs des services HTTP du monorepo + métadonnées des outils sous-module (chemins relatifs). |
| POST | `/v1/carbonyl/open-plan` | Corps `{"url":"https://…"}` → plan dexécution terminal (`docker` ou `native`). |
| POST | `/v1/pageindex/run` | Corps `{"mode":"pdf"\|"md","inputPath":"/abs/…"}` → sous-processus `run-pageindex.sh` ; réponse inclut `resultPath` si `…/upstream/results/<stem>_structure.json` existe. |
| POST | `/v1/chandra/ocr` | Corps `{"inputPath":"…","outputPath":"…","method":"hf"\|"vllm"}` (défaut `hf`) → scripts Chandra. |
## Corps JSON (exemples)
**Carbonyl**
```json
{ "url": "https://example.com" }
```
**PageIndex**
```json
{ "mode": "pdf", "inputPath": "/abs/smart_ide/docs/foo.pdf" }
```
**Chandra**
```json
{ "inputPath": "/abs/in.pdf", "outputPath": "/abs/out_dir", "method": "hf" }
```
## Sécurité des chemins
`inputPath` / `outputPath` doivent résoudre sous **`SMART_IDE_MONOREPO_ROOT`** ou sous un préfixe listé dans **`TOOLS_ALLOWED_PATH_PREFIXES`** (séparateur virgule).
## Voir aussi
- [README.md](../README.md) (table des ports)
- [repo/service-smart-ide-tools-bridge.md](../repo/service-smart-ide-tools-bridge.md)