import { i as NodmixConfig } from "./types.nodmix-B9QJSty6.js";
import { c as SessionBindingRecord, n as BindingTargetKind } from "./session-binding.types-cd2c9es6.js";
import { l as unregisterSessionBindingAdapter, s as registerSessionBindingAdapter, t as SessionBindingAdapter } from "./session-binding-service-B-xINtPn.js";
import { f as resolveThreadBindingConversationIdFromBindingId, l as resolveThreadBindingMaxAgeMsForChannel, s as resolveThreadBindingIdleTimeoutMsForChannel } from "./thread-bindings-policy-9j1mGAFW.js";
import { i as resolveThreadBindingFarewellText, n as resolveThreadBindingLifecycle } from "./thread-binding-lifecycle-BzpPZ9dy.js";

//#region src/infra/outbound/account-scoped-conversation-bindings.d.ts
type AccountScopedConversationBindingRecord<TKind extends string = string> = {
  accountId: string;
  conversationId: string;
  targetKind: TKind;
  targetSessionKey: string;
  agentId?: string;
  label?: string;
  boundBy?: string;
  boundAt: number;
  lastActivityAt: number;
};
type AccountScopedConversationBindingManager<TKind extends string = string> = {
  accountId: string;
  getByConversationId: (conversationId: string) => AccountScopedConversationBindingRecord<TKind> | undefined;
  listBySessionKey: (targetSessionKey: string) => AccountScopedConversationBindingRecord<TKind>[];
  bindConversation: (params: {
    conversationId: string;
    targetKind: BindingTargetKind;
    targetSessionKey: string;
    metadata?: Record<string, unknown>;
  }) => AccountScopedConversationBindingRecord<TKind> | null;
  touchConversation: (conversationId: string, at?: number) => AccountScopedConversationBindingRecord<TKind> | null;
  unbindConversation: (conversationId: string) => AccountScopedConversationBindingRecord<TKind> | null;
  unbindBySessionKey: (targetSessionKey: string) => AccountScopedConversationBindingRecord<TKind>[];
  stop: () => void;
};
declare function createAccountScopedConversationBindingManager<TKind extends string>(params: {
  channel: string;
  cfg: NodmixConfig;
  stateKey: symbol;
  accountId?: string | null;
  toStoredTargetKind: (raw: BindingTargetKind) => TKind;
  toSessionBindingTargetKind: (raw: TKind) => BindingTargetKind;
}): AccountScopedConversationBindingManager<TKind>;
declare function resetAccountScopedConversationBindingsForTests(params: {
  stateKey: symbol;
}): void;
//#endregion
export { type AccountScopedConversationBindingManager, type AccountScopedConversationBindingRecord, type BindingTargetKind, type SessionBindingAdapter, type SessionBindingRecord, createAccountScopedConversationBindingManager, registerSessionBindingAdapter, resetAccountScopedConversationBindingsForTests, resolveThreadBindingConversationIdFromBindingId, resolveThreadBindingFarewellText, resolveThreadBindingIdleTimeoutMsForChannel, resolveThreadBindingLifecycle, resolveThreadBindingMaxAgeMsForChannel, unregisterSessionBindingAdapter };