eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
36 lines (35 loc) • 1.58 kB
TypeScript
import type { DeliverHookPayload } from "#channel/types.js";
import type { NextDriverAction } from "#execution/next-driver-action.js";
import type { SessionDeliveryHook } from "#execution/session-delivery-hook.js";
/** Owns one turn's driver-side control hook and public-delivery relay state. */
export declare class TurnControlReceiver {
private readonly bufferedDeliveries;
private readonly control;
private readonly controlIterator;
private readonly deliveryHook;
private pendingControl;
constructor(input: {
readonly bufferedDeliveries: DeliverHookPayload[];
readonly deliveryHook: SessionDeliveryHook;
readonly token: string;
});
/** Token passed to the turn workflow so it can publish control messages. */
get token(): string;
/** Releases the turn control hook and its iterator. */
dispose(): Promise<void>;
/** Services control messages until the active turn returns its terminal driver action. */
waitForAction(): Promise<NextDriverAction>;
private bufferTurnDeliveries;
private consumeControl;
private getControlPromise;
private nextControl;
private readTerminalControl;
private serviceDeliveryRequest;
/**
* Waits for the active turn to resolve a forwarded delivery. The turn either
* accepts it (consumed) or releases it on cancellation or termination, in
* which case the delivery returns to the buffer ahead of the turn's own
* remainders so the next parent turn still observes it in arrival order.
*/
private awaitForwardedDelivery;
}