import type { FastifyReply, FastifyRequest } from 'fastify'; import { type AskAdapter, type CoreEvent } from '../core/types.js'; export interface AskServerDeps { adapter: AskAdapter; now?: () => number; setTimer?: typeof setTimeout; clearTimer?: typeof clearTimeout; } /** * The MCP `ask` tool (DES-CONTAINER-FLOOR step 5). The SDK speaks MCP; the ENGINE owns the questions: it verifies the * token, keeps one question open per run and queues the rest in arrival order (CONTRACT rev 2), and emits the * elicitation frames studio renders. This class only holds each call until its question's `elicitationResolved` frame, * its deadline, its client leaving, or its run ending. */ export declare class AskServer { private readonly deps; private readonly calls; /** * In-flight tool calls by ` `. Each POST is its own stateless SDK server, so a client's * `notifications/cancelled` (a later POST) cannot reach the SDK's per-server abort controller; it is routed here, * scoped to the same verified token so one seat cannot cancel another's call. */ private readonly inflight; private readonly early; private readonly now; private readonly setTimer; private readonly clearTimer; constructor(deps: AskServerDeps); handle(req: FastifyRequest, reply: FastifyReply): Promise; private unauthorized; /** * Hold the call until its question ends. The deadline, the client leaving and the run ending all count from arrival, * even while the engine's ticket is still on its way (a late ticket is closed at once). A close that fails cannot wedge * anything: the engine owns the run's queue. */ private wait; private outcome; ingest(event: CoreEvent): void; } //# sourceMappingURL=ask-server.d.ts.map