import { r as KlawConfig } from "./types.klaw-xKUw_Rz7.js"; import { n as GetReplyOptions } from "./get-reply-options.types-CS-CA1Iq.js"; import { t as FinalizedMsgContext } from "./templating-B8JLQEN3.js"; import { t as OutboundReplyPayload } from "./reply-payload-BEbdg63T.js"; import { n as ReplyDispatcher } from "./reply-dispatcher.types-DrTstzbu.js"; import { t as DispatchFromConfigResult } from "./dispatch-from-config.types-C7798lTY.js"; import { t as DispatchReplyWithBufferedBlockDispatcher } from "./provider-dispatcher.types-Ddx7dYu6.js"; import { F as recordChannelBotPairLoopAndCheckSuppression, M as ChannelBotLoopProtectionFacts, O as RunChannelTurnParams, T as PreparedChannelTurn, _ as ChannelTurnResult, b as DispatchedChannelTurnResult, d as ChannelTurnDroppedHistoryOptions, m as ChannelTurnRecordOptions } from "./types-D30xjkkK.js"; import { c as DurableInboundReplyDeliveryParams, r as recordDroppedChannelTurnHistory, s as DurableInboundReplyDeliveryOptions, u as deliverInboundReplyWithMessageSendContext } from "./kernel-U-3TwuAx.js"; import { a as hasVisibleChannelTurnDispatch, i as hasFinalChannelTurnDispatch, o as resolveChannelTurnDispatchCounts } from "./dispatch-result-NL50C8I0.js"; import { t as recordInboundSession } from "./session-DflxSRHV.js"; //#region src/plugin-sdk/inbound-reply-dispatch.d.ts declare namespace inbound_reply_dispatch_d_exports { export { ChannelBotLoopProtectionFacts, ChannelTurnDroppedHistoryOptions, ChannelTurnRecordOptions, DurableInboundReplyDeliveryParams, buildChannelMessageReplyDispatchBase, buildInboundReplyDispatchBase, deliverInboundReplyWithMessageSendContext as deliverDurableInboundReplyPayload, deliverInboundReplyWithMessageSendContext, dispatchChannelMessageReplyWithBase, dispatchInboundReplyWithBase, dispatchReplyFromConfigWithSettledDispatcher, hasFinalChannelMessageReplyDispatch, hasFinalChannelTurnDispatch as hasFinalInboundReplyDispatch, hasVisibleChannelMessageReplyDispatch, hasVisibleChannelTurnDispatch as hasVisibleInboundReplyDispatch, recordChannelBotPairLoopAndCheckSuppression, recordChannelMessageReplyDispatch, recordDroppedChannelTurnHistory, recordInboundSessionAndDispatchReply, resolveChannelMessageReplyDispatchCounts, resolveChannelTurnDispatchCounts as resolveInboundReplyDispatchCounts, runInboundReplyTurn, runPreparedInboundReplyTurn }; } type ReplyOptionsWithoutModelSelected = Omit, "onModelSelected">; type RecordInboundSessionFn = typeof recordInboundSession; type ReplyDispatchFromConfigOptions = Omit; /** Run an already assembled channel turn through shared session-record + dispatch ordering. */ type PreparedInboundReplyTurnWithBotLoopProtection = PreparedChannelTurn & { botLoopProtection: NonNullable["botLoopProtection"]>; }; type PreparedInboundReplyTurnWithoutBotLoopProtection = Omit, "botLoopProtection"> & { botLoopProtection?: undefined; }; declare function runPreparedInboundReplyTurn(params: PreparedInboundReplyTurnWithBotLoopProtection): Promise>; declare function runPreparedInboundReplyTurn(params: PreparedInboundReplyTurnWithoutBotLoopProtection): Promise>; declare function runPreparedInboundReplyTurn(params: PreparedChannelTurn): Promise>; /** Run a channel turn through shared ingest, record, dispatch, and finalize ordering. */ declare function runInboundReplyTurn(params: RunChannelTurnParams): Promise>; /** Run `dispatchReplyFromConfig` with a dispatcher that always gets its settled callback. */ declare function dispatchReplyFromConfigWithSettledDispatcher(params: { cfg: KlawConfig; ctxPayload: FinalizedMsgContext; dispatcher: ReplyDispatcher; onSettled: () => void | Promise; replyOptions?: ReplyDispatchFromConfigOptions; configOverride?: KlawConfig; }): Promise; /** Assemble the common inbound reply dispatch dependencies for a resolved route. */ declare function buildInboundReplyDispatchBase(params: { cfg: KlawConfig; channel: string; accountId?: string; route: { agentId: string; sessionKey: string; }; storePath: string; ctxPayload: FinalizedMsgContext; core: { channel: { session: { recordInboundSession: RecordInboundSessionFn; }; reply: { dispatchReplyWithBufferedBlockDispatcher: DispatchReplyWithBufferedBlockDispatcher; }; }; }; }): { cfg: KlawConfig; channel: string; accountId: string | undefined; agentId: string; routeSessionKey: string; storePath: string; ctxPayload: FinalizedMsgContext; recordInboundSession: typeof recordInboundSession; dispatchReplyWithBufferedBlockDispatcher: DispatchReplyWithBufferedBlockDispatcher; }; type BuildInboundReplyDispatchBaseParams = Parameters[0]; type RecordChannelMessageReplyDispatchParams = { cfg: KlawConfig; channel: string; accountId?: string; agentId: string; routeSessionKey: string; storePath: string; ctxPayload: FinalizedMsgContext; recordInboundSession: RecordInboundSessionFn; dispatchReplyWithBufferedBlockDispatcher: DispatchReplyWithBufferedBlockDispatcher; deliver: (payload: OutboundReplyPayload) => Promise; durable?: false | DurableInboundReplyDeliveryOptions; onRecordError: (err: unknown) => void; onDispatchError: (err: unknown, info: { kind: string; }) => void; replyOptions?: ReplyOptionsWithoutModelSelected; }; /** * Resolve the shared dispatch base and immediately record + dispatch one inbound reply turn. * * @deprecated Compatibility reply-dispatch bridge. New channel plugins should * expose a `message` adapter via `defineChannelMessageAdapter(...)` and route * sends through `deliverInboundReplyWithMessageSendContext(...)` or * `sendDurableMessageBatch(...)`. */ declare function dispatchChannelMessageReplyWithBase(params: BuildInboundReplyDispatchBaseParams & Pick): Promise; /** * Resolve the shared dispatch base and immediately record + dispatch one inbound reply turn. * * @deprecated Legacy inbound reply helper. New channel plugins should expose a * `message` adapter via `defineChannelMessageAdapter(...)` and use * `dispatchChannelMessageReplyWithBase` only for compatibility dispatchers that * have not moved to the message lifecycle yet. */ declare function dispatchInboundReplyWithBase(params: Parameters[0]): Promise; /** * Record the inbound session first, then dispatch the reply using normalized outbound delivery. * * @deprecated Compatibility reply-dispatch bridge. New channel plugins should * expose a `message` adapter via `defineChannelMessageAdapter(...)` and route * sends through `deliverInboundReplyWithMessageSendContext(...)` or * `sendDurableMessageBatch(...)`. */ declare function recordChannelMessageReplyDispatch(params: RecordChannelMessageReplyDispatchParams): Promise; /** * Record the inbound session first, then dispatch the reply using normalized outbound delivery. * * @deprecated Legacy inbound reply helper. New channel plugins should expose a * `message` adapter via `defineChannelMessageAdapter(...)` and use * `recordChannelMessageReplyDispatch` only for compatibility dispatchers that * have not moved to the message lifecycle yet. */ declare function recordInboundSessionAndDispatchReply(params: RecordChannelMessageReplyDispatchParams): Promise; /** @deprecated Compatibility helper for legacy reply dispatch bridges. */ declare const buildChannelMessageReplyDispatchBase: typeof buildInboundReplyDispatchBase; /** @deprecated Compatibility helper for legacy reply dispatch results. */ declare const hasFinalChannelMessageReplyDispatch: typeof hasFinalChannelTurnDispatch; /** @deprecated Compatibility helper for legacy reply dispatch results. */ declare const hasVisibleChannelMessageReplyDispatch: typeof hasVisibleChannelTurnDispatch; /** @deprecated Compatibility helper for legacy reply dispatch results. */ declare const resolveChannelMessageReplyDispatchCounts: typeof resolveChannelTurnDispatchCounts; //#endregion export { dispatchReplyFromConfigWithSettledDispatcher as a, inbound_reply_dispatch_d_exports as c, resolveChannelMessageReplyDispatchCounts as d, runInboundReplyTurn as f, dispatchInboundReplyWithBase as i, recordChannelMessageReplyDispatch as l, buildInboundReplyDispatchBase as n, hasFinalChannelMessageReplyDispatch as o, runPreparedInboundReplyTurn as p, dispatchChannelMessageReplyWithBase as r, hasVisibleChannelMessageReplyDispatch as s, buildChannelMessageReplyDispatchBase as t, recordInboundSessionAndDispatchReply as u };