import { s as ReplyPayload } from "./get-reply-options.types-CS-CA1Iq.js"; import { A as LivePreviewFinalizerCapability, C as DurableFinalDeliveryCapability, D as DurableMessageSendIntent, F as MessageReceiptPartKind, I as MessageReceiptSourceResult, L as MessageSendContext, M as MessageDurabilityPolicy, N as MessageReceipt, R as RenderedMessageBatch, S as DeriveDurableFinalDeliveryRequirementsParams, T as DurableFinalDeliveryRequirementMap, a as ChannelMessageLiveCapability, c as ChannelMessageReceiveAdapterShape, g as ChannelMessageSendPayloadContext, h as ChannelMessageSendMediaContext, i as ChannelMessageLiveAdapterShape, j as LivePreviewFinalizerCapabilityMap, k as LiveMessageState, n as ChannelMessageAdapterShape, s as ChannelMessageReceiveAckPolicy, t as ChannelMessageAdapter, y as ChannelMessageSendTextContext } from "./types-CPrjYzuc.js"; import { b as OutboundDeliveryResult } from "./outbound.types-P0E6jGE1.js"; import { n as CreateChannelReplyPipelineParams, t as ChannelReplyPipeline } from "./reply-pipeline-BJbW2NFd.js"; import { i as OutboundDeliveryIntent, t as DeliverOutboundPayloadsParams } from "./deliver-CwujvoXi.js"; import { n as kernel_d_exports, u as deliverInboundReplyWithMessageSendContext$1 } from "./kernel-U-3TwuAx.js"; import { a as hasVisibleChannelTurnDispatch, i as hasFinalChannelTurnDispatch, o as resolveChannelTurnDispatchCounts } from "./dispatch-result-NL50C8I0.js"; import { c as inbound_reply_dispatch_d_exports } from "./inbound-reply-dispatch-CUlrfTng.js"; //#region src/channels/message/capabilities.d.ts declare function deriveDurableFinalDeliveryRequirements(params: DeriveDurableFinalDeliveryRequirementsParams): DurableFinalDeliveryRequirementMap; //#endregion //#region src/channels/message/outbound-bridge.d.ts type ChannelMessageOutboundBridgeResult = MessageReceiptSourceResult & { receipt?: MessageReceipt; messageId?: string; }; type ChannelMessageOutboundBridgeAdapter = { deliveryCapabilities?: { durableFinal?: DurableFinalDeliveryRequirementMap; }; sendText?: (ctx: ChannelMessageSendTextContext) => Promise; sendMedia?: (ctx: ChannelMessageSendMediaContext) => Promise; sendPayload?: (ctx: ChannelMessageSendPayloadContext) => Promise; }; type CreateChannelMessageAdapterFromOutboundParams = { id?: string; outbound: ChannelMessageOutboundBridgeAdapter; capabilities?: DurableFinalDeliveryRequirementMap; live?: ChannelMessageLiveAdapterShape; receive?: ChannelMessageReceiveAdapterShape; }; declare function createChannelMessageAdapterFromOutbound(params: CreateChannelMessageAdapterFromOutboundParams): ChannelMessageAdapterShape; //#endregion //#region src/channels/message/contracts.d.ts type DurableFinalCapabilityProof = () => Promise | void; type DurableFinalCapabilityProofMap = Partial>; type DurableFinalCapabilityProofResult = { capability: DurableFinalDeliveryCapability; status: "verified" | "not_declared"; }; type LivePreviewFinalizerCapabilityProof = () => Promise | void; type ChannelMessageLiveCapabilityProof = () => Promise | void; type ChannelMessageReceiveAckPolicyProof = () => Promise | void; type LivePreviewFinalizerCapabilityProofMap = Partial>; type ChannelMessageLiveCapabilityProofMap = Partial>; type ChannelMessageReceiveAckPolicyProofMap = Partial>; type LivePreviewFinalizerCapabilityProofResult = { capability: LivePreviewFinalizerCapability; status: "verified" | "not_declared"; }; type ChannelMessageLiveCapabilityProofResult = { capability: ChannelMessageLiveCapability; status: "verified" | "not_declared"; }; type ChannelMessageReceiveAckPolicyProofResult = { policy: ChannelMessageReceiveAckPolicy; status: "verified" | "not_declared"; }; declare function listDeclaredDurableFinalCapabilities(capabilities: DurableFinalDeliveryRequirementMap | undefined): DurableFinalDeliveryCapability[]; declare function listDeclaredLivePreviewFinalizerCapabilities(capabilities: LivePreviewFinalizerCapabilityMap | undefined): LivePreviewFinalizerCapability[]; declare function listDeclaredChannelMessageLiveCapabilities(capabilities: Partial> | undefined): ChannelMessageLiveCapability[]; declare function listDeclaredReceiveAckPolicies(receive: ChannelMessageAdapterShape["receive"] | undefined): ChannelMessageReceiveAckPolicy[]; declare function verifyDurableFinalCapabilityProofs(params: { adapterName: string; capabilities?: DurableFinalDeliveryRequirementMap; proofs: DurableFinalCapabilityProofMap; }): Promise; declare function verifyLivePreviewFinalizerCapabilityProofs(params: { adapterName: string; capabilities?: LivePreviewFinalizerCapabilityMap; proofs: LivePreviewFinalizerCapabilityProofMap; }): Promise; declare function verifyChannelMessageLiveCapabilityProofs(params: { adapterName: string; capabilities?: Partial>; proofs: ChannelMessageLiveCapabilityProofMap; }): Promise; declare function verifyChannelMessageReceiveAckPolicyProofs(params: { adapterName: string; receive?: ChannelMessageAdapterShape["receive"]; proofs: ChannelMessageReceiveAckPolicyProofMap; }): Promise; declare function verifyChannelMessageAdapterCapabilityProofs(params: { adapterName: string; adapter: Pick; proofs: DurableFinalCapabilityProofMap; }): Promise; declare function verifyChannelMessageReceiveAckPolicyAdapterProofs(params: { adapterName: string; adapter: Pick; proofs: ChannelMessageReceiveAckPolicyProofMap; }): Promise; declare function verifyChannelMessageLiveFinalizerProofs(params: { adapterName: string; adapter: Pick; proofs: LivePreviewFinalizerCapabilityProofMap; }): Promise; declare function verifyChannelMessageLiveCapabilityAdapterProofs(params: { adapterName: string; adapter: Pick; proofs: ChannelMessageLiveCapabilityProofMap; }): Promise; //#endregion //#region src/channels/message/receipt.d.ts type MessageReceiptInputResult = MessageReceiptSourceResult & { receipt?: MessageReceipt; }; declare function createMessageReceiptFromOutboundResults(params: { results: readonly MessageReceiptInputResult[]; kind?: MessageReceiptPartKind; threadId?: string; replyToId?: string; sentAt?: number; }): MessageReceipt; declare function listMessageReceiptPlatformIds(receipt: MessageReceipt): string[]; declare function resolveMessageReceiptPrimaryId(receipt: MessageReceipt): string | undefined; //#endregion //#region src/channels/message/receive.d.ts type MessageAckPolicy = ChannelMessageReceiveAckPolicy; type MessageAckStage = "receive_record" | "agent_dispatch" | "durable_send" | "manual"; type MessageAckState = "pending" | "acked" | "nacked"; type MessageReceiveContext = { id: string; channel: string; accountId?: string; message: TMessage; ackPolicy: MessageAckPolicy; ackState: MessageAckState; ackedAt?: number; nackErrorMessage?: string; receivedAt: number; signal: AbortSignal; shouldAckAfter(stage: MessageAckStage): boolean; ack(): Promise; nack(error: unknown): Promise; }; declare function shouldAckMessageAfterStage(policy: MessageAckPolicy, stage: MessageAckStage): boolean; declare function createMessageReceiveContext(params: { id: string; channel: string; accountId?: string; message: TMessage; ackPolicy?: MessageAckPolicy; receivedAt?: number; signal?: AbortSignal; onAck?: () => Promise | void; onNack?: (error: unknown) => Promise | void; }): MessageReceiveContext; //#endregion //#region src/channels/message/state.d.ts type DurableMessageSendState = "pending" | "sent" | "suppressed" | "failed" | "unknown_after_send"; type DurableMessageStateRecord = { intent: DurableMessageSendIntent; state: DurableMessageSendState; receipt?: MessageReceipt; updatedAt: number; errorMessage?: string; }; declare function createDurableMessageStateRecord(params: { intent: DurableMessageSendIntent; state?: DurableMessageSendState; receipt?: MessageReceipt; updatedAt?: number; error?: unknown; }): DurableMessageStateRecord; declare function classifyDurableSendRecoveryState(params: { hasIntent: boolean; hasReceipt: boolean; platformSendMayHaveStarted: boolean; failed?: boolean; suppressed?: boolean; }): DurableMessageSendState; //#endregion //#region src/channels/message/send.d.ts type DurableMessageBatchSendParams = Omit & { payloads: ReplyPayload[]; attempt?: number; signal?: AbortSignal; /** @deprecated Use `signal`. */ abortSignal?: AbortSignal; previousReceipt?: MessageReceipt; }; type DurableMessageSuppressionReason = "cancelled_by_message_sending_hook" | "empty_after_message_sending_hook" | "no_visible_payload" | "adapter_returned_no_identity" | "no_visible_result"; type DurableMessageFailureStage = "platform_send" | "queue" | "unknown"; type DurableMessagePayloadDeliveryOutcome = { index: number; status: "sent"; results: OutboundDeliveryResult[]; } | { index: number; status: "suppressed"; reason: DurableMessageSuppressionReason; hookEffect?: { cancelReason?: string; metadata?: Record; }; } | { index: number; status: "failed"; error: unknown; sentBeforeError: boolean; stage: DurableMessageFailureStage; }; type DurableMessageBatchSendResult = { status: "sent"; results: OutboundDeliveryResult[]; receipt: MessageReceipt; deliveryIntent?: OutboundDeliveryIntent; payloadOutcomes?: DurableMessagePayloadDeliveryOutcome[]; } | { status: "suppressed"; results: []; receipt: MessageReceipt; deliveryIntent?: OutboundDeliveryIntent; reason: DurableMessageSuppressionReason; payloadOutcomes?: DurableMessagePayloadDeliveryOutcome[]; } | { status: "partial_failed"; results: OutboundDeliveryResult[]; receipt: MessageReceipt; error: unknown; sentBeforeError: true; deliveryIntent?: OutboundDeliveryIntent; payloadOutcomes?: DurableMessagePayloadDeliveryOutcome[]; } | { status: "failed"; error: unknown; stage?: DurableMessageFailureStage; payloadOutcomes?: DurableMessagePayloadDeliveryOutcome[]; }; type DurableMessageSendContextParams = DurableMessageBatchSendParams & { durability?: Exclude; preview?: LiveMessageState; onPreviewUpdate?: (rendered: RenderedMessageBatch, state: LiveMessageState) => Promise> | LiveMessageState; onEditReceipt?: (receipt: MessageReceipt, rendered: RenderedMessageBatch) => Promise | MessageReceipt; onDeleteReceipt?: (receipt: MessageReceipt) => Promise | void; onCommitReceipt?: (receipt: MessageReceipt) => Promise | void; onSendFailure?: (error: unknown) => Promise | void; }; type DurableMessageSendContext = MessageSendContext; //#endregion //#region src/plugin-sdk/channel-message.d.ts type ChannelTurnKernelModule = typeof kernel_d_exports; type InboundReplyDispatchModule = typeof inbound_reply_dispatch_d_exports; /** @deprecated Use `createChannelMessageReplyPipeline(...)` for compatibility dispatchers. */ declare function createChannelTurnReplyPipeline(params: CreateChannelReplyPipelineParams): ChannelReplyPipeline; /** @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; /** @deprecated Compatibility helper for legacy reply dispatch bridges. */ declare const buildChannelMessageReplyDispatchBase: InboundReplyDispatchModule["buildChannelMessageReplyDispatchBase"]; /** * @deprecated Compatibility reply-dispatch bridge. New channel plugins should * expose a `message` adapter and route sends through * `deliverInboundReplyWithMessageSendContext(...)` or * `sendDurableMessageBatch(...)`. */ declare const dispatchChannelMessageReplyWithBase: InboundReplyDispatchModule["dispatchChannelMessageReplyWithBase"]; /** * @deprecated Compatibility reply-dispatch bridge. New channel plugins should * expose a `message` adapter and route sends through * `deliverInboundReplyWithMessageSendContext(...)` or * `sendDurableMessageBatch(...)`. */ declare const recordChannelMessageReplyDispatch: InboundReplyDispatchModule["recordChannelMessageReplyDispatch"]; declare const deliverInboundReplyWithMessageSendContext: ChannelTurnKernelModule["deliverInboundReplyWithMessageSendContext"]; /** @deprecated Use `deliverInboundReplyWithMessageSendContext`. */ declare const deliverDurableInboundReplyPayload: typeof deliverInboundReplyWithMessageSendContext$1; declare function sendDurableMessageBatch(params: DurableMessageBatchSendParams): Promise; declare function withDurableMessageSendContext(params: DurableMessageSendContextParams, run: (ctx: DurableMessageSendContext) => Promise): Promise; declare const defaultManualReceiveAdapter: { readonly defaultAckPolicy: "manual"; readonly supportedAckPolicies: readonly ["manual"]; }; type ChannelMessageAdapterWithDefaultReceive = TAdapter & { receive: TAdapter["receive"] extends undefined ? typeof defaultManualReceiveAdapter : NonNullable; }; declare function defineChannelMessageAdapter(adapter: TAdapter): ChannelMessageAdapter>; //#endregion export { verifyLivePreviewFinalizerCapabilityProofs as $, ChannelMessageLiveCapabilityProof as A, LivePreviewFinalizerCapabilityProofMap as B, MessageAckState as C, createMessageReceiptFromOutboundResults as D, shouldAckMessageAfterStage as E, ChannelMessageReceiveAckPolicyProofResult as F, listDeclaredReceiveAckPolicies as G, listDeclaredChannelMessageLiveCapabilities as H, DurableFinalCapabilityProof as I, verifyChannelMessageLiveCapabilityProofs as J, verifyChannelMessageAdapterCapabilityProofs as K, DurableFinalCapabilityProofMap as L, ChannelMessageLiveCapabilityProofResult as M, ChannelMessageReceiveAckPolicyProof as N, listMessageReceiptPlatformIds as O, ChannelMessageReceiveAckPolicyProofMap as P, verifyDurableFinalCapabilityProofs as Q, DurableFinalCapabilityProofResult as R, MessageAckStage as S, createMessageReceiveContext as T, listDeclaredDurableFinalCapabilities as U, LivePreviewFinalizerCapabilityProofResult as V, listDeclaredLivePreviewFinalizerCapabilities as W, verifyChannelMessageReceiveAckPolicyAdapterProofs as X, verifyChannelMessageLiveFinalizerProofs as Y, verifyChannelMessageReceiveAckPolicyProofs as Z, DurableMessageSendState as _, deliverInboundReplyWithMessageSendContext as a, createDurableMessageStateRecord as b, hasVisibleChannelMessageReplyDispatch as c, sendDurableMessageBatch as d, ChannelMessageOutboundBridgeAdapter as et, withDurableMessageSendContext as f, DurableMessageSendContextParams as g, DurableMessageSendContext as h, deliverDurableInboundReplyPayload as i, deriveDurableFinalDeliveryRequirements as it, ChannelMessageLiveCapabilityProofMap as j, resolveMessageReceiptPrimaryId as k, recordChannelMessageReplyDispatch as l, DurableMessageBatchSendResult as m, createChannelTurnReplyPipeline as n, CreateChannelMessageAdapterFromOutboundParams as nt, dispatchChannelMessageReplyWithBase as o, DurableMessageBatchSendParams as p, verifyChannelMessageLiveCapabilityAdapterProofs as q, defineChannelMessageAdapter as r, createChannelMessageAdapterFromOutbound as rt, hasFinalChannelMessageReplyDispatch as s, buildChannelMessageReplyDispatchBase as t, ChannelMessageOutboundBridgeResult as tt, resolveChannelMessageReplyDispatchCounts as u, DurableMessageStateRecord as v, MessageReceiveContext as w, MessageAckPolicy as x, classifyDurableSendRecoveryState as y, LivePreviewFinalizerCapabilityProof as z };