import type { AgentMessage } from "@gajae-code/agent-core"; export interface YieldDispatcher

{ /** Drop entries already delivered through another path. Called per-entry at flush time. */ isStale?(entry: P): boolean; /** * Optional ownership-origin key: when provided, the flush builds ONE * message per distinct key instead of one message for the whole batch, so * a later scope:"owned" drop of one origin never suppresses entries of * another origin (review thread P2). */ groupKey?(entry: P): string; /** Produce one batched AgentMessage from non-stale entries. Return null to skip. */ build(survivors: P[]): AgentMessage | null; } export interface YieldQueueOptions { isStreaming: () => boolean; injectStreaming(msg: AgentMessage): void; injectIdle(messages: AgentMessage[]): Promise; scheduleIdleFlush(run: () => Promise): void; } type YieldFlushMode = "streaming" | "idle"; export declare class YieldQueue { #private; constructor(options: YieldQueueOptions); register

(kind: string, dispatcher: YieldDispatcher

): () => void; enqueue

(kind: string, entry: P): void; has(kind?: string): boolean; flush(mode: YieldFlushMode): Promise; clear(): void; /** Drop only the queued entries of a single kind, leaving other kinds intact. */ clearKind(kind: string): void; /** * Re-schedule an idle flush if work remains and the session is idle. Used after * a transition (e.g. handoff) releases a delivery fence so entries queued while * fenced are not stranded until an unrelated enqueue or agent yield. */ rearmIdle(): void; } export {};