import { Router } from 'express'; /** * HTTP routes for the Codex integration. * * Mounted by `@agenticmail/api` (see app.ts) under * /api/agenticmail/integrations/codex * * Purpose: let an agent (Codex itself, a shell script, a CI job, …) * install the integration with a single POST request, no terminal * interaction required. The endpoints are deliberately registered * BEFORE the master-key auth middleware because they ARE the bootstrap * — a Codex session that doesn't yet have AgenticMail wired up has no * way to know the master key, so requiring it would defeat the purpose. * * Security model is identical to @agenticmail/claudecode's http-routes: * the master API binds to 127.0.0.1 by default; any process that can * reach this endpoint can already read ~/.agenticmail/config.json, so * leaving the routes unauthenticated does not widen the attack surface. */ /** * Build the Express router. Caller mounts at the prefix of its choosing * (typically `/api/agenticmail`); endpoints land at: * * GET /integrations/codex/status * POST /integrations/codex/install * POST /integrations/codex/uninstall */ declare function createIntegrationRoutes(): Router; export { createIntegrationRoutes };