/** * Permission questions waiting for an answer, oldest first. * * Sub-agents run concurrently and can each need an answer at the same moment. Holding the current * question in a single slot meant the second overwrote the first, whose promise then never * settled: that agent waited forever, the pool waiting on it never finished, and the turn hung * with nothing on screen to explain why. * * A queue rather than a set of simultaneous prompts, because a permission question is only * answerable if you can read it, and two at once on a terminal is neither. */ export interface AskRequest { tool: string; args: string; prefix: string; resolve: (answer: T) => void; } export declare class AskQueue { private readonly waiting; /** Adds a question. Returns true when it is the one now on screen. */ add(request: AskRequest): boolean; /** The question that should be shown, or undefined when there are none. */ current(): AskRequest | undefined; /** How many are behind the current one. */ get pending(): number; get size(): number; /** * Answers the current question and returns the next. * * Every exit from the panel goes through here, so no promise is left unsettled — one that is * stalls the agent waiting on it, and anything waiting on that agent, indefinitely. */ answer(value: T): AskRequest | undefined; /** * Answers everything still waiting with the same value. * * For a cancelled turn: the agents are going away, and leaving their promises hanging would * keep the pool alive after the work it was doing had been abandoned. */ drain(value: T): number; } //# sourceMappingURL=ask-queue.d.ts.map