import { type ConnectorClient, type SendOutcomeUnknownReason } from "./connector-client.js"; import { type Party } from "./party.js"; import { type SentMessage } from "./sent-message-buffer.js"; import type { RuntimeSessionConversationsPage } from "./services-client/index.js"; import type { SendAckEvent } from "./types.js"; export interface OpenConversation { conversationRef: string; lastActivityAt: string; peer: { kind: "node" | "session"; nodeHandle?: string; nodeAddress?: string; name?: string; }; } export interface ConversationContinuation { conversationsWith(party: Party): OpenConversation[]; continueConversation(conversation: OpenConversation, content: string): Promise; } export interface ConversationReader { list(params: { limit?: number; since?: string; }): Promise; } export interface DirectedSessionSender { isDirectedSessionTarget(to: string): boolean; send(to: string, content: string): Promise; } export type SendResult = { status: "sent"; messageId: string; acknowledgementStatus: string; messageRef?: string; addressedTarget?: NonNullable; directed?: { nodeHandle: string; sessionLabel: string; }; } | { status: "unknown"; messageId: string; attempts: 1; retryable: false; reason: SendOutcomeUnknownReason; error: string; errorCode: "SEND_OUTCOME_UNKNOWN"; } | { status: "failed"; error?: string; errorCode?: string; }; export interface ConversationEntry { contact: string; address: string; lastMessageAt: number; initiatedBy: "local" | "remote"; inboundEnvelope?: InboundEnvelope; } export interface ConversationSummary { contact: string; address: string; lastMessageAt: number; initiatedBy: "local" | "remote"; } export interface InboundEnvelope { traceparent?: string; correlationId?: string; messageId?: string; receivedAt: number; } export declare const REPLY_CORRELATION_MAX_AGE_MS: number; export declare class ConversationManager { private continuation?; private directedSessionSender?; setDirectedSessionSender(sender: DirectedSessionSender | undefined): void; setContinuation(continuation: ConversationContinuation | undefined): void; private conversationReader?; setConversationReader(reader: ConversationReader | undefined): void; getConversationReader(): ConversationReader | undefined; private readonly client; private readonly sentMessageBuffer; private readonly conversations; private readonly conversationAliases; private readonly pendingOutreach; constructor(client: ConnectorClient); recordOutboundContext(peerAddress: string, content: string): void; getRecentOutboundContext(peerAddress: string): SentMessage[]; send(to: string, content: string, metadata?: Record): Promise; registerInbound(contact: string, address: string): void; refreshInboundPortrayal(contact: string, address: string): boolean; recordInboundEnvelope(address: string, envelope: Omit): void; listConversations(): ConversationSummary[]; hasConversation(contact: string): boolean; resolveAddress(contact: string): string; private resolveContactForSend; extractHandle(address: string): string; private resolveConversationAlias; private recordConversationAlias; private fileResolvedConversation; private ensureConversationEntry; } //# sourceMappingURL=conversation-manager.d.ts.map