/**
 * Bootstrap route spec for first-time account creation.
 *
 * One-shot endpoint: exchanges a bootstrap token + credentials for
 * an account with keeper privileges and a session cookie.
 *
 * @module
 */
import { z } from 'zod';
import type { Context } from 'hono';
import type { Logger } from '@fuzdev/fuz_util/log.js';
import type { SessionOptions } from './session_cookie.js';
import { type BootstrapAccountSuccess } from './bootstrap_account.js';
import type { Db } from '../db/db.js';
import { type RouteSpec } from '../http/route_spec.js';
import { type RateLimiter } from '../rate_limiter.js';
import type { RouteFactoryDeps } from './deps.js';
import type { StatResult } from '../runtime/deps.js';
/** Input for `POST /bootstrap`. `token` is the one-shot token file contents. */
export declare const BootstrapInput: z.ZodObject<{
    token: z.ZodString;
    username: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
    password: z.ZodString;
}, z.core.$strict>;
export type BootstrapInput = z.infer<typeof BootstrapInput>;
/** Output for `POST /bootstrap`. Session cookie is the operative side effect. */
export declare const BootstrapOutput: z.ZodObject<{
    ok: z.ZodLiteral<true>;
    account: z.ZodObject<{
        id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
        username: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
    }, z.core.$strict>;
    actor: z.ZodObject<{
        id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
    }, z.core.$strict>;
}, z.core.$strict>;
export type BootstrapOutput = z.infer<typeof BootstrapOutput>;
/**
 * Bootstrap status — runtime state computed once at startup.
 */
export interface BootstrapStatus {
    available: boolean;
    token_path: string | null;
}
/**
 * Per-factory configuration for bootstrap route specs.
 *
 * `bootstrap_status` is runtime state (a mutable ref), not a dep or options value —
 * it is passed through so the route handler can flip it on success.
 */
export interface BootstrapRouteOptions {
    session_options: SessionOptions<string>;
    /** Shared mutable reference — flipped to false after successful bootstrap. */
    bootstrap_status: BootstrapStatus;
    /**
     * Called after successful bootstrap (account + session created).
     * Use for app-specific post-bootstrap work like generating API tokens.
     */
    on_bootstrap?: (result: BootstrapAccountSuccess, c: Context) => Promise<void>;
    /** Rate limiter for bootstrap attempts (per-IP). Pass `null` to disable. */
    ip_rate_limiter: RateLimiter | null;
}
/**
 * Dependencies for checking bootstrap status at startup.
 */
export interface CheckBootstrapStatusDeps {
    stat: (path: string) => Promise<StatResult | null>;
    db: Db;
    log: Logger;
}
/**
 * Check bootstrap availability at startup.
 *
 * Bootstrap is available when:
 * 1. A token path is configured
 * 2. The token file exists on disk
 * 3. The `bootstrap_lock` table shows `bootstrapped = false`
 *
 * @param deps - filesystem and database access for the check
 * @param options - static configuration including `token_path`
 * @returns an object with `available` (boolean) and `token_path` (string | null)
 */
export declare const check_bootstrap_status: (deps: CheckBootstrapStatusDeps, options: {
    token_path: string | null;
}) => Promise<BootstrapStatus>;
/**
 * Create bootstrap route specs for first-time account creation.
 *
 * @param deps - stateless capabilities including filesystem access
 * @param options - per-factory configuration (session, token path, bootstrap status)
 * @returns route specs (not yet applied to Hono)
 */
export declare const create_bootstrap_route_specs: (deps: RouteFactoryDeps, options: BootstrapRouteOptions) => Array<RouteSpec>;
//# sourceMappingURL=bootstrap_routes.d.ts.map