import '../assert_dev_env.js';
import { Uuid } from '@fuzdev/fuz_util/id.js';
import type { BackendConfig } from '../cross_backend/backend_config.js';
import type { FetchTransport } from './fetch_transport.js';
/** Input for `bootstrap()`. */
export interface BootstrapOptions {
    /**
     * The cookie-threading HTTP transport pointed at the binary. After
     * `bootstrap()` resolves, the transport carries the keeper session
     * cookie — every later call against it is authenticated as keeper.
     */
    readonly transport: FetchTransport;
    /**
     * Backend config — used for `bootstrap_path` plus the
     * `bootstrap.username` / `bootstrap.password` / `bootstrap.token`
     * credentials. The runner already wrote `bootstrap.token` to
     * `bootstrap.token_path` before spawning, so the binary picks the
     * token up at startup.
     */
    readonly config: BackendConfig;
}
/** The keeper credentials captured from `POST /api/account/bootstrap`. */
export interface BootstrapResult {
    /**
     * Same transport that came in, now carrying the keeper session
     * cookie in its jar. Returned for call-site clarity (callers don't
     * have to remember the mutation happens in place).
     */
    readonly transport: FetchTransport;
    /** Account JSON returned by `POST /bootstrap`. */
    readonly account: {
        readonly id: Uuid;
        readonly username: string;
    };
    /** Actor JSON returned by `POST /bootstrap`. */
    readonly actor: {
        readonly id: Uuid;
    };
    /** Raw `Set-Cookie` values for threading into a WS transport. */
    readonly cookies: ReadonlyArray<string>;
}
/**
 * Fire `POST {config.bootstrap_path}` and capture the keeper session.
 *
 * @throws Error when the binary refuses bootstrap (non-2xx response) or
 *   the body fails to parse as the expected `{account, actor}` envelope.
 *   The error carries the status + raw body so a mistyped token /
 *   username collision / boot-time DB drift surfaces with enough
 *   context to debug.
 */
export declare const bootstrap: (options: BootstrapOptions) => Promise<BootstrapResult>;
//# sourceMappingURL=bootstrap.d.ts.map