/** * `/api/hosted-nodes` — the host's "Join a cadre" action and the nodes it made. * Loopback, no bearer: same-machine admin, matching the local-UI "no login" * posture. Clients: the `cadre-host join` / `cadre-host node` CLI and the local * UI. * * GET /api/hosted-nodes every hosted node (secret and invitation stripped) * POST /api/hosted-nodes { invitation? } start a node waiting to be claimed, or one * that redeems the invitation → 201 { node } * GET /api/hosted-nodes/:id one node * GET /api/hosted-nodes/:id/claim the QR payload: 409 unless unclaimed, 503 until the child answers * DELETE /api/hosted-nodes/:id stop the node and delete its data → 204 * POST /api/hosted-nodes/:id/reset remove, then start a fresh node → 201 { node } * POST /api/hosted-nodes/:id/retry start an invitation node again after no member * could be reached → { node }; 409 unless so * * Responses use the `/api/*` envelope (`{ ok, data }`); errors come from * `HostedNodeError`, which `server/error-handler.ts` maps. The mutations publish * nothing themselves: the service reports every change through its listener, * which `server/index.ts` wires to the bus as `hosted-nodes-changed`, so a * change the watcher or the supervisor makes reaches the SPA the same way. */ import type { FastifyInstance } from 'fastify'; import type { HostedNodeService } from '../../hosted/hosted-node-service.js'; export interface HostedNodesRoutesOptions { hostedNodes: HostedNodeService; } export declare function registerHostedNodesRoutes(app: FastifyInstance, opts: HostedNodesRoutesOptions): void;