/** * Queue awareness — let the running agent *see* messages the user typed * while it was busy, without delivering them early. * * The TUI queues plain messages typed mid-run and replays them as real user * turns after the run finishes (the queue drainer in app.tsx). That keeps * turn-taking clean, but the model is blind to the backlog: a queued message * may invalidate the current approach, add a constraint, or just be a * "by the way" note the user expected the agent to notice. * * Unlike `/btw` (a consume-once note channel, {@link ./btw.ts}), this is a * SNAPSHOT channel: the host mirrors the queue's current contents onto the * live `Context` on every queue mutation (enqueue, /queue delete, /queue * clear, dequeue-for-delivery). At each iteration boundary the agent loop * asks "did the snapshot change since the model last saw it?" and, if so, * injects an informational block listing the pending messages. The queue * itself is untouched — every queued message still arrives later as its own * user turn. * * Deliberate quietness: when the queue transitions to empty (cleared by the * user, drained between runs, or dropped by steering/abort) the snapshot is * marked seen WITHOUT injecting a "queue is now empty" block. The empty * transition usually happens at run boundaries where such a notice is stale * noise; the cost is that a mid-run `/queue clear` isn't announced, which is * safe because the block's framing already tells the model the queue may * change and the authoritative messages arrive as future turns. */ import type { Context } from './context.js'; /** * Mirror the host's pending-message queue onto the context. Call on every * queue mutation with the FULL current queue (head first) — not a delta. * Blank entries are dropped; the head-most {@link MAX_ITEMS} are kept since * the head is what arrives first. */ export declare function setQueuedMessagesSnapshot(ctx: Context, texts: string[]): void; /** Current snapshot (previews), without affecting seen-state. */ export declare function peekQueuedMessages(ctx: Context): string[]; /** * Called by the agent loop at each iteration boundary. Returns the queued * messages to surface when the snapshot changed since the model last saw it, * or `null` when there is nothing new to say. Marks the snapshot seen either * way, so the same state is never injected twice. An empty snapshot is * acknowledged silently (see module comment). */ export declare function consumeQueuedMessagesUpdate(ctx: Context): string[] | null; /** * Format the awareness block. Framing goals: (1) the model must NOT treat * the listed messages as instructions to execute now — they each arrive as * their own turn later; (2) it SHOULD let them influence in-flight decisions * (a queued message may invalidate the current approach or be a /btw-style * note); (3) the list is a full replacement of any earlier notice, so a * shrunken list implicitly communicates deletions. */ export declare function buildQueuedMessagesBlock(items: string[]): string; //# sourceMappingURL=queued-messages.d.ts.map