import { type Server } from 'node:http';
import type { AgentIdentity } from './identity.js';
export interface IdentityServerOptions {
    host?: string | undefined;
    port?: number | undefined;
    /**
     * Directory where Direct Sign-In callbacks are relayed as `{state}.json` (0600), so a
     * `poppy-agent signin` process can pick up a redirect received by `serve-identity`.
     */
    relayDir?: string | undefined;
    /** In-process callback hook (used when `signin` runs the server itself). */
    onCallback?: ((params: URLSearchParams) => void) | undefined;
    log?: ((line: string) => void) | undefined;
}
/**
 * Serves the agent's Client ID Metadata Document, JWKS (public keys only), logo, and the
 * Direct Sign-In redirect target, under the paths of `identity.baseUrl` (4.1).
 */
export declare function startIdentityServer(identity: AgentIdentity, opts?: IdentityServerOptions): Promise<{
    server: Server;
    url: string;
    close: () => Promise<void>;
}>;
/** Waits for a relayed callback file for `state` (written by `serve-identity`). */
export declare function waitForRelayedCallback(relayDir: string, state: string, opts?: {
    signal?: AbortSignal | undefined;
    pollMs?: number | undefined;
}): Promise<URLSearchParams>;
//# sourceMappingURL=identity_server.d.ts.map