/**
 * Common route spec factories for fuz_app consumers.
 *
 * Generic HTTP route factories with no auth-domain dependencies.
 * Auth-aware route factories (account status) live in `auth/account_routes.ts`.
 *
 * @module
 */
import { z } from 'zod';
/**
 * Create a public health check route spec.
 *
 * Infrastructure endpoint for uptime monitors and load balancers.
 * Bootstrap availability is exposed via `/api/account/status` instead.
 */
export const create_health_route_spec = () => ({
    method: 'GET',
    path: '/health',
    auth: { account: 'none', actor: 'none' },
    handler: (c) => c.json({ status: 'ok' }),
    description: 'Health check',
    input: z.null(),
    output: z.strictObject({ status: z.literal('ok') }),
});
/**
 * Create an authenticated server status route spec.
 *
 * Returns version and uptime. Unlike the public health check,
 * this requires authentication.
 */
export const create_server_status_route_spec = (options) => ({
    method: 'GET',
    path: '/api/server/status',
    auth: { account: 'required', actor: 'none' },
    handler: (c) => c.json({ version: options.version, uptime_ms: options.get_uptime_ms() }),
    description: 'Server version and uptime',
    input: z.null(),
    output: z.looseObject({ version: z.string(), uptime_ms: z.number() }),
});
/**
 * Create an authenticated route spec that serves the `AppSurface` as JSON.
 *
 * Surface data reveals API structure (routes, auth, schemas), so this
 * requires authentication like the server status route.
 */
export const create_surface_route_spec = (options) => ({
    method: 'GET',
    path: '/api/surface',
    auth: { account: 'required', actor: 'none' },
    handler: (c) => c.json(options.surface),
    description: 'Application surface (routes, middleware, schemas)',
    input: z.null(),
    output: z.looseObject({
        routes: z.array(z.looseObject({})),
        middleware: z.array(z.looseObject({})),
    }),
});
