import { buildAdapterContext } from "#channel/adapter-context.js";
import { type ChannelAdapter } from "#channel/adapter.js";
import type { ContextContainer } from "#context/container.js";
import { bindDynamicConnections } from "#execution/dynamic-connections.js";
import type { resolveEffectiveAgentRuntime } from "#execution/effective-agent-config.js";
import type { HandleEventFn } from "#harness/types.js";
import type { ExecutionInstrumentation } from "#instrumentation/runtime.js";
import type { CompiledBundle } from "#runtime/sessions/runtime-context-keys.js";
export interface SessionEventSinkInput {
    readonly abortSignal: AbortSignal | undefined;
    readonly adapter: ChannelAdapter;
    readonly bundle: CompiledBundle;
    readonly ctx: ContextContainer;
    readonly effectiveAgent: ReturnType<typeof resolveEffectiveAgentRuntime>;
    readonly instrumentation: ExecutionInstrumentation | undefined;
    readonly isFirstTurn: boolean;
    readonly sessionWritable: WritableStream<Uint8Array>;
    readonly sessionId: string;
}
export interface SessionEventSink {
    readonly adapterCtx: ReturnType<typeof buildAdapterContext>;
    readonly dynamicConnections: ReturnType<typeof bindDynamicConnections>;
    readonly effectiveNode: CompiledBundle["graph"]["root"];
    readonly handleEvent: HandleEventFn;
    /** Closes the parent stream; only a terminal `done` step does this. */
    close(): Promise<void>;
    /** Releases the writer lock so the next step can acquire it. Safe after `close()`. */
    release(): void;
}
/** Binds adapter context, dynamic connections, and event fan-out to one step's stream writer. */
export declare function createSessionEventSink(input: SessionEventSinkInput): SessionEventSink;
