/** A single steering instruction the user sent while a turn was already running. */ export type SteerMessage = { id: string; text: string; /** Epoch ms the steer was enqueued; useful for ordering/debugging. */ at: number; }; /** * In-process, per-session buffer of steering instructions. * * While an agent turn is streaming (thinking / calling tools) the user may send * one or more extra instructions ("steers"). Each is enqueued here by the * `/agent/steer` endpoint and drained by the `beforeModel` steer middleware just * before the next model call in the same running loop, so the model course-corrects * mid-turn instead of the user having to abort and restart. * * The buffer is deliberately in-process: a steer only makes sense for a turn that * is *currently running*, and that turn's SSE stream is held open on exactly one * instance/process. In a multi-instance deployment the `/agent/steer` request must * therefore reach the same instance running the turn (same constraint the in-memory * HITL cache / MemorySaver already carry when no persistent checkpointer is set). */ export declare class SteerBuffer { private readonly buffers; /** Enqueue a steering instruction for a session. Returns the created entry. */ add(sessionId: string, text: string): SteerMessage; /** Number of steers currently buffered for a session. */ size(sessionId: string): number; /** Return every buffered steer for a session and remove them from the buffer. */ drain(sessionId: string): SteerMessage[]; /** Discard any buffered steers for a session (e.g. when its turn ends unconsumed). */ clear(sessionId: string): void; }