import { Nn as SilentReplyConversationType, r as KlawConfig } from "./types.klaw-xKUw_Rz7.js"; import { T as ReplyToMode } from "./types.base-Dkv2492C.js"; import { M as ReplyPayloadDelivery, b as MessagePresentation, m as InteractiveReply, s as ReplyPayload } from "./get-reply-options.types-CS-CA1Iq.js"; import { t as OutboundSendDeps } from "./send-deps-BMd-KmRC.js"; import { t as OutboundMediaAccess } from "./load-options-BmNzjB18.js"; import { b as OutboundDeliveryResult, d as OutboundDeliveryFormattingOptions, t as ChannelDeliveryCapabilities, u as OutboundIdentity, x as OutboundPayloadDeliveryOutcome } from "./outbound.types-P0E6jGE1.js"; import { v as resolveSendableOutboundReplyParts } from "./reply-payload-BEbdg63T.js"; import { a as OutboundSessionContext, i as OutboundChannel, r as QueuedRenderedMessageBatchPlan, s as DeliveryMirror } from "./delivery-queue-X7rawx8x.js"; //#region src/infra/outbound/payloads.d.ts type NormalizedOutboundPayload = { text: string; mediaUrls: string[]; audioAsVoice?: boolean; presentation?: MessagePresentation; delivery?: ReplyPayloadDelivery; interactive?: InteractiveReply; channelData?: Record; /** Hook-only content for audio-only TTS payloads. Never used as channel text/caption. */ hookContent?: string; }; type OutboundPayloadJson = { text: string; mediaUrl: string | null; mediaUrls?: string[]; audioAsVoice?: boolean; presentation?: MessagePresentation; delivery?: ReplyPayloadDelivery; interactive?: InteractiveReply; channelData?: Record; }; type OutboundPayloadPlan = { sourceIndex: number; payload: ReplyPayload; parts: ReturnType; hasPresentation: boolean; hasInteractive: boolean; hasChannelData: boolean; }; type OutboundPayloadPlanContext = { cfg?: KlawConfig; sessionKey?: string; surface?: string; conversationType?: SilentReplyConversationType; extractMarkdownImages?: boolean; }; declare function createOutboundPayloadPlan(payloads: readonly ReplyPayload[], context?: OutboundPayloadPlanContext): OutboundPayloadPlan[]; declare function projectOutboundPayloadPlanForDelivery(plan: readonly OutboundPayloadPlan[]): ReplyPayload[]; declare function projectOutboundPayloadPlanForJson(plan: readonly OutboundPayloadPlan[]): OutboundPayloadJson[]; //#endregion //#region src/infra/outbound/deliver.d.ts type OutboundDeliveryQueuePolicy = "required" | "best_effort"; type OutboundDeliveryIntent = { id: string; channel: Exclude; to: string; accountId?: string; queuePolicy: OutboundDeliveryQueuePolicy; }; type DurableFinalDeliveryRequirement = keyof NonNullable; type DurableFinalDeliveryRequirements = Partial>; type DeliverOutboundPayloadsCoreParams = { cfg: KlawConfig; channel: Exclude; to: string; accountId?: string; payloads: ReplyPayload[]; replyToId?: string | null; replyToMode?: ReplyToMode; formatting?: OutboundDeliveryFormattingOptions; threadId?: string | number | null; identity?: OutboundIdentity; deps?: OutboundSendDeps; mediaAccess?: OutboundMediaAccess; gifPlayback?: boolean; forceDocument?: boolean; abortSignal?: AbortSignal; bestEffort?: boolean; onError?: (err: unknown, payload: NormalizedOutboundPayload) => void; onPayload?: (payload: NormalizedOutboundPayload) => void; onPayloadDeliveryOutcome?: (outcome: OutboundPayloadDeliveryOutcome) => void; /** Session/agent context used for hooks and media local-root scoping. */ session?: OutboundSessionContext; mirror?: DeliveryMirror; silent?: boolean; gatewayClientScopes?: readonly string[]; }; /** * @deprecated Direct outbound delivery is compatibility/runtime substrate. * New message lifecycle code should use `sendDurableMessageBatch` from * `src/channels/message/send.ts` or `deliverInboundReplyWithMessageSendContext` * from `src/channels/turn/durable-delivery.ts`. Keep direct use only for * outbound substrate, recovery, and compatibility paths. */ type DeliverOutboundPayloadsParams = DeliverOutboundPayloadsCoreParams & { /** @internal Skip write-ahead queue (used by crash-recovery to avoid re-enqueueing). */skipQueue?: boolean; /** @internal Let recovery run commit hooks after it has acked the recovered queue entry. */ deferCommitHooks?: boolean; queuePolicy?: OutboundDeliveryQueuePolicy; renderedBatchPlan?: QueuedRenderedMessageBatchPlan; onDeliveryIntent?: (intent: OutboundDeliveryIntent) => void; }; /** * @deprecated Direct outbound delivery is compatibility/runtime substrate. * New message lifecycle code should use `sendDurableMessageBatch` from * `src/channels/message/send.ts` or `deliverInboundReplyWithMessageSendContext` * from `src/channels/turn/durable-delivery.ts`. Keep direct use only for * outbound substrate, recovery, and compatibility paths. */ declare function deliverOutboundPayloads(params: DeliverOutboundPayloadsParams): Promise; //#endregion export { OutboundDeliveryQueuePolicy as a, projectOutboundPayloadPlanForDelivery as c, OutboundDeliveryIntent as i, projectOutboundPayloadPlanForJson as l, DurableFinalDeliveryRequirement as n, deliverOutboundPayloads as o, DurableFinalDeliveryRequirements as r, createOutboundPayloadPlan as s, DeliverOutboundPayloadsParams as t };