# ia-dev-gateway (`services/ia-dev-gateway/`) HTTP API for the **ia_dev** checkout: agent registry (`.smartIde/agents/*.md`), `POST /v1/runs` (script-backed runner), and SSE streaming on `/v1/runs/:id/events`. ## Build / run ```bash cd services/ia-dev-gateway npm install npm run build export IA_DEV_GATEWAY_TOKEN='your-secret' # optional: IA_DEV_ROOT=/absolute/path/to/ia_dev npm start ``` Écoute par défaut : **`127.0.0.1:37144`**. ## IA_DEV_ROOT resolution If `IA_DEV_ROOT` is not set, the gateway resolves it in this order: - `./ia_dev` - `./services/ia_dev` When using `./services/ia_dev`, you typically need to create project links so scripts can resolve `projects//conf.json`: ```bash ./scripts/ensure-ia-dev-project-link.sh smart_ide ./scripts/ensure-ia-dev-project-link.sh enso ./scripts/ensure-ia-dev-project-link.sh builazoo ``` ## Script-backed runner (current) The v1 runner executes a subset of agent IDs by spawning `bash` scripts under `IA_DEV_ROOT/deploy/` and streaming stdout/stderr as SSE events. Supported agent IDs: - `change-to-all-branches` → `deploy/change-to-all-branches.sh` - `branch-align-by-script-from-test` → `deploy/branch-align.sh` (defaults to `env=test` if omitted) - `deploy-by-script` → `deploy/deploy.sh` (env `test`) or `deploy/deploy-by-script-to.sh` (env `pprod|prod`) - `push-by-script` → `deploy/pousse.sh` - `site-generate` → `tools/site-generate.sh` ### `payload` conventions - **`payload.args`**: `string[]` appended to the script arguments. - **`payload.stdin`**: `string` written to the script stdin. - **`payload.commitMessage`**: `string` alias for stdin for `push-by-script`. - **`payload.remote`**: `string` passed as `--remote ` for `push-by-script`. - **`payload.bumpVersion`**: `boolean` adds `--bump-version` for `push-by-script`. ## Contrats [API/ia-dev-gateway.md](../API/ia-dev-gateway.md), [features/ia-dev-service.md](../features/ia-dev-service.md).