/** * Process-local channel delivery dedupe for Phase 1. * * Event-id acceptance is process-local only: fine for unit tests and * single-replica / local `mda dev`. Multi-replica Host deployments can still * double-invoke on Slack retries until durable placement lands. */ import type { ChannelEvent } from "./types.js"; export type DeliveryStatus = "accepted" | "filtered" | "running" | "response_pending" | "delivered" | "failed"; export interface DeliveryRecord { deliveryId: string; deploymentId: string; channelDefinitionId: string; provider: string; providerEventId?: string; status: DeliveryStatus; attemptCount: number; sourceThreadKey?: string; runId?: string; outboundMessageIds: string[]; filterReason?: string; createdAt: string; updatedAt: string; } /** Process-local store used by unit tests and local development. */ export declare class InMemoryChannelStore { readonly deliveries: Map; /** Maps acceptance key → deliveryId for idempotent acceptance. */ readonly acceptanceIndex: Map; acceptanceKey(parts: { deploymentId: string; channelDefinitionId: string; apiAppId: string; eventId: string; }): string; /** * Dedupe key for provider message identity (Slack dual-delivers distinct * event_ids for app_mention + message that share the same message ts). */ providerMessageKey(parts: { deploymentId: string; channelDefinitionId: string; apiAppId: string; conversationId: string; messageId: string; }): string; acceptDelivery(input: { deploymentId: string; channelDefinitionId: string; provider: string; apiAppId: string; eventId?: string; /** Slack message ts (or equivalent); dedupes dual app_mention/message. */ providerMessageId?: string; conversationId?: string; sourceThreadKey?: string; status: Extract; filterReason?: string; event?: ChannelEvent; }): { delivery: DeliveryRecord; duplicate: boolean; }; } //# sourceMappingURL=store.d.ts.map