/**
 * Phase D-0b — Stepped-build debug protocol.
 *
 * When `session.debug.steppedBuild === true`, the gateway pauses at named
 * gates in the per-turn build pipeline, emits `debug.step.*` events to admin
 * subscribers, and waits for a `debug.stepContinue` RPC before proceeding.
 *
 * Design:
 * - Per-session pause Promise stored in a Map keyed by sessionKey.
 * - Auto-resume after `pauseTimeoutMs` (default 10 min) so disconnected hubs
 *   don't deadlock real users.
 * - `skipAll` switches a session out of stepped mode for the rest of the
 *   build (one-shot resume, all remaining gates fire-through).
 * - Zero overhead when debug is OFF: the entry helper returns immediately
 *   without allocating Promises, timeouts, or events.
 *
 * Per LD-9 the protocol is admin-gated — wiring is in
 * server-broadcast.ts EVENT_SCOPE_GUARDS and server-methods-list.ts.
 */
export type DebugStepName = "agent_resolved" | "eligible_pool_computed" | "pre_prompt_build_dispatched" | "pre_prompt_build_merged" | "llm_call_starting" | "section_assembly_started" | "prompt_assembled" | "pre_prompt_build_handler";
export type DebugStepEvent = {
    category: "debug.step";
    step: DebugStepName;
    sessionKey: string;
    agentId?: string;
    state: Record<string, unknown>;
    ts: number;
};
/**
 * Inject point for tests / runtime: how to broadcast a debug.step.* event.
 * In production the gateway server wires this to its WS broadcast.
 */
type Broadcaster = (event: string, payload: unknown) => void;
export declare function setDebugStepBroadcaster(fn: Broadcaster | null): void;
/**
 * Hub-driven toggle: enable or disable stepped build for a session. Hub UI
 * calls this via the `debug.setSteppedBuild` RPC. The toggle persists for
 * the session's lifetime in the gateway pause registry.
 */
export declare function setSteppedBuild(params: {
    sessionKey: string;
    enabled: boolean;
    pauseTimeoutMs?: number;
}): void;
export declare function isSteppedBuildEnabled(sessionKey: string): boolean;
/**
 * Called by build pipeline gates. If stepping is OFF for this session,
 * returns immediately (zero overhead). Otherwise emits the step event
 * and awaits a continue/skip RPC (or auto-resumes after timeout).
 *
 * If `steppedBuild` is undefined the helper consults the per-session
 * registry (set via `setSteppedBuild`). This is the typical path —
 * fire-points pass undefined, hub controls enable via RPC.
 */
export declare function awaitDebugStep(params: {
    sessionKey: string | undefined;
    agentId?: string;
    step: DebugStepName;
    state: Record<string, unknown>;
    steppedBuild?: boolean;
    pauseTimeoutMs?: number;
}): Promise<void>;
/**
 * RPC handler: `debug.stepContinue({ sessionKey, fromStep })`.
 * Resolves the active pause Promise for the session, allowing the build
 * pipeline to advance to the next gate. The optional `fromStep` lets the
 * hub confirm which step it intended to release (idempotent — silently
 * no-ops if step has already advanced).
 *
 * Returns the step that was released, or null if there was no active pause.
 */
export declare function debugStepContinue(params: {
    sessionKey: string;
    fromStep?: DebugStepName;
}): {
    released: DebugStepName | null;
};
/**
 * RPC handler: `debug.skipAll({ sessionKey })`.
 * Releases the current pause AND marks the session so subsequent gates
 * fire through without pausing for the rest of this build.
 */
export declare function debugSkipAll(params: {
    sessionKey: string;
}): {
    skipped: boolean;
};
/**
 * Reset stepping state for a session — called when a new turn starts so
 * `skipAll` doesn't carry over from a prior turn.
 */
export declare function resetSessionStepping(sessionKey: string): void;
/** Test-only: clear all state. */
export declare function _resetAllForTest(): void;
export {};
