import type { RuntimeEventBus, RuntimeEventEnvelope, AnyRuntimeEvent } from '../runtime/events/index.js';
import type { ChannelRenderEvent, ChannelRenderResult, ChannelSurface } from './types.js';
import type { ChannelPluginRegistry } from './plugin-registry.js';
import type { RouteBindingManager } from './route-manager.js';
export interface TrackedChannelReply {
    readonly agentId: string;
    readonly surfaceKind: ChannelSurface;
    readonly task: string;
    readonly agentTask?: string | undefined;
    readonly workflowChainId?: string | undefined;
    readonly createdAt: number;
    readonly sessionId?: string | undefined;
    readonly routeId?: string | undefined;
    readonly [key: string]: unknown;
}
interface ReplyPipelineDeps {
    readonly channelPlugins: ChannelPluginRegistry;
    readonly routeBindings: RouteBindingManager;
    readonly runtimeBus?: RuntimeEventBus | null | undefined;
    readonly now?: (() => number) | undefined;
}
export declare function normalizeChannelRenderEventFromRuntime(envelope: RuntimeEventEnvelope<AnyRuntimeEvent['type'], AnyRuntimeEvent>): ChannelRenderEvent[];
export declare class ChannelReplyPipeline {
    private readonly channelPlugins;
    private readonly routeBindings;
    private readonly now;
    private readonly buffers;
    private readonly workflowChains;
    private readonly unsubscribers;
    constructor(deps: ReplyPipelineDeps);
    attachRuntimeBus(runtimeBus: RuntimeEventBus | null): void;
    dispose(): void;
    trackPending(pending: TrackedChannelReply): void;
    untrack(agentId: string): void;
    has(agentId: string): boolean;
    getPending(agentId: string): TrackedChannelReply | null;
    deliverProgress(agentId: string, explicitText?: string, force?: boolean): Promise<ChannelRenderResult | null>;
    deliverFinal(agentId: string, explicitText: string, options?: {
        readonly keepTracking?: boolean;
    }): Promise<ChannelRenderResult | null>;
    private handleEnvelope;
    private handleWorkflowEnvelope;
    private trackChildPendingReply;
    private findPendingForWorkflowTask;
    private associateWorkflowChain;
    private resolvePolicy;
    private dispatch;
    private disposeSubscriptions;
}
export {};
//# sourceMappingURL=reply-pipeline.d.ts.map