import { u as ReplyPayload } from "./types-CgXdquv1.js"; import { r as CommandTurnContext, t as FinalizedMsgContext, u as InboundEventKind } from "./templating-BLkCZBKN.js"; import { i as OpenClawConfig } from "./types.openclaw-Dkap9jPv.js"; import { d as ContextVisibilityMode } from "./types.base-bTa1ro6X.js"; import { P as MessageReceipt } from "./types-CejLKAZg.js"; import { n as ReplyDispatchKind } from "./reply-dispatcher.types-D6zjGnXN.js"; import { t as FinalizeInboundContextOptions } from "./inbound-context-BQ2UeuLA.js"; import { n as DurableFinalDeliveryRequirement, r as DurableFinalDeliveryRequirements, t as DeliverOutboundPayloadsParams } from "./deliver-KmSK2RgG.js"; import { i as createChannelReplyPipeline, n as CreateChannelReplyPipelineParams } from "./reply-pipeline-D2hqei8U.js"; import { A as SupplementalContextFacts, C as NormalizedTurnInput, D as RouteFacts, E as ReplyPlanFacts, M as clearChannelBotPairLoopGuardForTests, N as listTrackedChannelBotPairsForTests, O as RunChannelTurnParams, P as recordChannelBotPairLoopAndCheckSuppression, S as MessageFacts, T as PreparedChannelTurn, _ as ChannelTurnResult, a as ChannelDeliveryResult, b as DispatchedChannelTurnResult, c as ChannelTurnAdapter, d as ChannelTurnDroppedHistoryOptions, f as ChannelTurnHistoryFinalizeOptions, g as ChannelTurnResolved, h as ChannelTurnReplyPipelineOptions, i as ChannelDeliveryIntent, j as ChannelBotLoopProtectionFacts, k as SenderFacts, l as ChannelTurnAdmission, m as ChannelTurnRecordOptions, n as AssembledChannelTurn, o as ChannelEventClass, p as ChannelTurnLogEvent, r as ChannelDeliveryInfo, s as ChannelEventDeliveryAdapter, t as AccessFacts, u as ChannelTurnDispatcherOptions, v as CommandFacts, w as PreflightFacts, x as InboundMediaFacts, y as ConversationFacts } from "./types-z4sQdwp3.js"; import { n as createChannelHistoryWindow, t as ChannelHistoryWindow } from "./history-window-DpOfKxmG.js"; //#region src/channels/inbound-event/context.d.ts type MaybePromise = T | Promise; type ChannelInboundSupplementalMediaResolver = () => MaybePromise; type ChannelInboundSupplementalQuoteFacts = NonNullable & { isSelf?: boolean; media?: readonly InboundMediaFacts[] | ChannelInboundSupplementalMediaResolver; }; type ChannelInboundSupplementalFacts = Omit & { quote?: ChannelInboundSupplementalQuoteFacts; }; /** * @deprecated Prefer passing `resolveSupplementalMedia: true` directly to * `buildChannelInboundEventContext` without naming this compatibility type. */ type ChannelInboundSupplementalResolutionOptions = { resolveSupplementalMedia: true; suppressSelfQuoteBody?: boolean; suppressSelfQuoteMedia?: boolean; }; type BuildAccessFacts = Omit & { commands?: Partial>; }; type BuildChannelInboundEventContextParams = { channel: string; accountId?: string; provider?: string; surface?: string; messageId?: string; messageIdFull?: string; timestamp?: number; from: string; sender: SenderFacts; conversation: ConversationFacts; route: RouteFacts; reply: ReplyPlanFacts; message: MessageFacts; access?: BuildAccessFacts; command?: CommandFacts; commandTurn?: CommandTurnContext; media?: InboundMediaFacts[]; supplemental?: ChannelInboundSupplementalFacts; contextVisibility?: ContextVisibilityMode; finalize?: FinalizeInboundContextFn; finalizeOptions?: FinalizeInboundContextOptions; extra?: Record; }; /** * @deprecated Prefer `BuildChannelInboundEventContextParams` with * `resolveSupplementalMedia: true` at call sites that need lazy quote media. */ type BuildChannelInboundEventContextAsyncParams = BuildChannelInboundEventContextParams & ChannelInboundSupplementalResolutionOptions; type BuiltChannelInboundEventContext = FinalizedMsgContext & { Body: string; BodyForAgent: string; BodyForCommands: string; ChatType: ConversationFacts["kind"]; CommandAuthorized: boolean; CommandBody: string; From: string; RawBody: string; SessionKey: string; To: string; InboundEventKind: InboundEventKind; }; type FinalizeInboundContextFn = (ctx: Record, opts?: FinalizeInboundContextOptions) => unknown; /** * @deprecated Used by deprecated `finalizeChannelInboundContext`; new channel * code should pass facts to `buildChannelInboundEventContext`. */ type FinalizeChannelInboundContextParams> = { context: T; supplemental?: SupplementalContextFacts | ChannelInboundSupplementalFacts; contextVisibility?: ContextVisibilityMode; media?: readonly InboundMediaFacts[]; finalize?: FinalizeInboundContextFn; finalizeOptions?: FinalizeInboundContextOptions; }; /** * @deprecated Prefer `FinalizeChannelInboundContextParams` with * `resolveSupplementalMedia: true` when lazy quote media must be resolved. */ type FinalizeChannelInboundContextAsyncParams> = FinalizeChannelInboundContextParams & { resolveSupplementalMedia: true; } & Pick; /** * @deprecated Result type for deprecated `finalizeChannelInboundContext`. */ type FinalizeChannelInboundContextResult> = { context: T & FinalizedMsgContext; supplemental?: SupplementalContextFacts; quoteHidden: boolean; forwardedHidden: boolean; threadHidden: boolean; }; declare function filterChannelInboundSupplementalContext(params: { supplemental?: SupplementalContextFacts; contextVisibility?: ContextVisibilityMode; }): SupplementalContextFacts | undefined; declare function filterChannelInboundQuoteContext(contextVisibility: ContextVisibilityMode | undefined, quote: SupplementalContextFacts["quote"] | undefined): SupplementalContextFacts["quote"] | undefined; /** * @deprecated Prefer `buildChannelInboundEventContext({ resolveSupplementalMedia: true })` * for channel inbound payloads. */ declare function resolveChannelInboundSupplementalContext(params: { supplemental?: ChannelInboundSupplementalFacts; contextVisibility?: ContextVisibilityMode; media?: readonly InboundMediaFacts[]; suppressSelfQuoteBody?: boolean; suppressSelfQuoteMedia?: boolean; }): Promise<{ supplemental?: SupplementalContextFacts; media: InboundMediaFacts[]; quoteHidden: boolean; }>; /** * @deprecated Public compatibility for callers that already prepared legacy * prompt fields. New channel code should use `buildChannelInboundEventContext`. */ declare function finalizeChannelInboundContext>(params: FinalizeChannelInboundContextAsyncParams): Promise>; declare function finalizeChannelInboundContext>(params: FinalizeChannelInboundContextParams): FinalizeChannelInboundContextResult; declare function buildChannelInboundEventContext(params: BuildChannelInboundEventContextAsyncParams): Promise; declare function buildChannelInboundEventContext(params: BuildChannelInboundEventContextParams): BuiltChannelInboundEventContext; //#endregion //#region src/channels/turn/durable-delivery.d.ts type DurableInboundReplyDeliveryOptions = Pick & { to?: string | null; replyToId?: string | null; requiredCapabilities?: DurableFinalDeliveryRequirements; }; type DurableInboundReplyDeliveryParams = DurableInboundReplyDeliveryOptions & { cfg: OpenClawConfig; channel: string; accountId?: string; agentId: string; ctxPayload: FinalizedMsgContext; payload: ReplyPayload; info: ChannelDeliveryInfo; }; type DurableInboundReplyDeliveryResult = { status: "not_applicable"; reason: "non_final"; } | { status: "unsupported"; reason: "missing_channel" | "missing_target" | "missing_outbound_handler" | "capability_mismatch"; capability?: DurableFinalDeliveryRequirement; } | { status: "handled_visible"; delivery: ChannelDeliveryResult; } | { status: "handled_no_send"; reason: "no_visible_result"; delivery: ChannelDeliveryResult; } | { status: "failed"; error: unknown; sentBeforeError?: true; }; declare function isDurableInboundReplyDeliveryHandled(result: DurableInboundReplyDeliveryResult): result is Extract; declare function throwIfDurableInboundReplyDeliveryFailed(result: DurableInboundReplyDeliveryResult): void; declare function deliverInboundReplyWithMessageSendContext(params: DurableInboundReplyDeliveryParams): Promise; /** @deprecated Use `deliverInboundReplyWithMessageSendContext`. */ declare const deliverDurableInboundReplyPayload: typeof deliverInboundReplyWithMessageSendContext; //#endregion //#region src/channels/turn/delivery-result.d.ts declare function createChannelDeliveryResultFromReceipt(params: { receipt: MessageReceipt; threadId?: string; replyToId?: string; visibleReplySent?: boolean; deliveryIntent?: ChannelDeliveryIntent; }): ChannelDeliveryResult; //#endregion //#region src/channels/turn/dispatch-result.d.ts type ChannelTurnDispatchResultLike = { queuedFinal?: boolean; counts?: Partial>; } | null | undefined; type ChannelTurnVisibleDeliverySignals = { observedReplyDelivery?: boolean; fallbackDelivered?: boolean; deliverySummaryDelivered?: boolean; }; declare const EMPTY_CHANNEL_TURN_DISPATCH_COUNTS: Record; declare function resolveChannelTurnDispatchCounts(result: ChannelTurnDispatchResultLike): Record; declare function hasVisibleChannelTurnDispatch(result: ChannelTurnDispatchResultLike, signals?: ChannelTurnVisibleDeliverySignals): boolean; declare function hasFinalChannelTurnDispatch(result: ChannelTurnDispatchResultLike, signals?: Pick): boolean; declare namespace kernel_d_exports { export { AccessFacts, AssembledChannelTurn, BuildChannelInboundEventContextParams, ChannelBotLoopProtectionFacts, ChannelDeliveryInfo, ChannelDeliveryResult, ChannelEventClass, ChannelEventDeliveryAdapter, ChannelHistoryWindow, ChannelTurnAdapter, ChannelTurnAdmission, ChannelTurnDispatchResultLike, ChannelTurnDispatcherOptions, ChannelTurnDroppedHistoryOptions, ChannelTurnHistoryFinalizeOptions, ChannelTurnLogEvent, ChannelTurnRecordOptions, ChannelTurnReplyPipelineOptions, ChannelTurnResolved, ChannelTurnResult, ChannelTurnVisibleDeliverySignals, ConversationFacts, DispatchedChannelTurnResult, DurableInboundReplyDeliveryOptions, DurableInboundReplyDeliveryParams, DurableInboundReplyDeliveryResult, EMPTY_CHANNEL_TURN_DISPATCH_COUNTS, InboundMediaFacts, MessageFacts, NormalizedTurnInput, PreflightFacts, PreparedChannelTurn, ReplyPlanFacts, RouteFacts, RunChannelTurnParams, SenderFacts, SupplementalContextFacts, buildChannelInboundEventContext, clearChannelBotPairLoopGuardForTests, createChannelDeliveryResultFromReceipt, createChannelHistoryWindow, createChannelTurnReplyPipeline, createNoopChannelEventDeliveryAdapter, deliverDurableInboundReplyPayload, deliverInboundReplyWithMessageSendContext, dispatchAssembledChannelTurn, dispatchChannelInboundReply, filterChannelInboundSupplementalContext, hasFinalChannelTurnDispatch, hasVisibleChannelTurnDispatch, isDurableInboundReplyDeliveryHandled, listTrackedChannelBotPairsForTests, recordChannelBotPairLoopAndCheckSuppression, recordDroppedChannelInboundHistory, recordDroppedChannelTurnHistory, resolveChannelTurnDispatchCounts, runChannelInboundEvent, runChannelTurn, runPreparedChannelTurn, runPreparedInboundReply, throwIfDurableInboundReplyDeliveryFailed }; } /** * @deprecated Compatibility assembly for legacy buffered reply dispatchers. * New channel plugins should expose `defineChannelMessageAdapter(...)` from * `openclaw/plugin-sdk/channel-outbound` and route send/receive behavior through * the message lifecycle helpers. */ declare function createChannelTurnReplyPipeline(params: CreateChannelReplyPipelineParams): ReturnType; declare function createNoopChannelEventDeliveryAdapter(): ChannelEventDeliveryAdapter; declare function recordDroppedChannelTurnHistory(params: { input: NormalizedTurnInput; preflight: PreflightFacts; admission?: ChannelTurnAdmission; }): Promise; declare const recordDroppedChannelInboundHistory: typeof recordDroppedChannelTurnHistory; type AssembledChannelTurnWithBotLoopProtection = AssembledChannelTurn & { botLoopProtection: NonNullable; }; type AssembledChannelTurnWithoutBotLoopProtection = Omit & { botLoopProtection?: undefined; }; declare function dispatchAssembledChannelTurn(params: AssembledChannelTurnWithBotLoopProtection): Promise; declare function dispatchAssembledChannelTurn(params: AssembledChannelTurnWithoutBotLoopProtection): Promise; declare function dispatchAssembledChannelTurn(params: AssembledChannelTurn): Promise; declare const dispatchChannelInboundReply: typeof dispatchAssembledChannelTurn; type PreparedChannelTurnWithBotLoopProtection = PreparedChannelTurn & { botLoopProtection: NonNullable["botLoopProtection"]>; }; type PreparedChannelTurnWithoutBotLoopProtection = Omit, "botLoopProtection"> & { botLoopProtection?: undefined; }; declare function runPreparedChannelTurn(params: PreparedChannelTurnWithBotLoopProtection): Promise>; declare function runPreparedChannelTurn(params: PreparedChannelTurnWithoutBotLoopProtection): Promise>; declare function runPreparedChannelTurn(params: PreparedChannelTurn): Promise>; declare const runPreparedInboundReply: typeof runPreparedChannelTurn; declare function runChannelTurn(params: RunChannelTurnParams): Promise>; declare const runChannelInboundEvent: typeof runChannelTurn; //#endregion export { finalizeChannelInboundContext as C, filterChannelInboundSupplementalContext as S, FinalizeChannelInboundContextAsyncParams as _, runPreparedInboundReply as a, buildChannelInboundEventContext as b, resolveChannelTurnDispatchCounts as c, DurableInboundReplyDeliveryResult as d, deliverInboundReplyWithMessageSendContext as f, ChannelInboundSupplementalResolutionOptions as g, BuiltChannelInboundEventContext as h, runChannelInboundEvent as i, DurableInboundReplyDeliveryOptions as l, BuildChannelInboundEventContextParams as m, kernel_d_exports as n, hasFinalChannelTurnDispatch as o, BuildChannelInboundEventContextAsyncParams as p, recordDroppedChannelInboundHistory as r, hasVisibleChannelTurnDispatch as s, dispatchChannelInboundReply as t, DurableInboundReplyDeliveryParams as u, FinalizeChannelInboundContextParams as v, resolveChannelInboundSupplementalContext as w, filterChannelInboundQuoteContext as x, FinalizeChannelInboundContextResult as y };