import type { AgentMessage } from "@oh-my-pi/pi-agent-core"; export interface YieldDispatcher
{
/** Drop entries already delivered through another path. Called per-entry at flush time. */
isStale?(entry: P): boolean;
/** 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 (kind: string, dispatcher: YieldDispatcher ): () => void;
enqueue (kind: string, entry: P): void;
has(kind?: string): boolean;
flush(mode: YieldFlushMode): Promise