import { t as resolveConversationLabel } from "../conversation-label-NxB9yMgt.js";
import { a as testing, i as registerSessionBindingAdapter, n as getSessionBindingService, o as unregisterSessionBindingAdapter, r as isSessionBindingError, t as SessionBindingError } from "../session-binding-service-JMl271d0.js";
import { a as readChannelAllowFromStore, c as readLegacyChannelAllowFromStoreSync, d as upsertChannelPairingRequest, i as listChannelPairingRequests, l as removeChannelAllowFromStoreEntry, n as approveChannelPairingCode, o as readChannelAllowFromStoreSync, r as clearPairingAllowFromReadCacheForTest, s as readLegacyChannelAllowFromStore, t as addChannelAllowFromStoreEntry, u as resolveChannelAllowFromPath } from "../pairing-store-o987WgAW.js";
import { l as resolvePinnedMainDmOwnerFromAllowlist } from "../dm-policy-shared-DfWcWVlK.js";
import { t as resolveThreadBindingLifecycle } from "../thread-binding-lifecycle-BL-h7xfb.js";
import { a as resolveThreadBindingIdleTimeoutMs, c as resolveThreadBindingMaxAgeMsForChannel, d as resolveThreadBindingsEnabled, i as resolveThreadBindingEffectiveExpiresAt, n as formatThreadBindingSpawnDisabledError, o as resolveThreadBindingIdleTimeoutMsForChannel, s as resolveThreadBindingMaxAgeMs, t as formatThreadBindingDisabledError, u as resolveThreadBindingSpawnPolicy } from "../thread-bindings-policy-lJCSOaX_.js";
import "../channel-access-compat-B30I4dx6.js";
import { _ as getConversationBindingCapabilities, a as buildPluginBindingUnavailableText, b as touchConversationBindingRecord, c as hasShownPluginBindingFallbackNotice, d as markPluginBindingFallbackNoticeShown, f as parsePluginBindingApprovalCustomId, g as createConversationBindingRecord, h as toPluginConversationBinding, i as buildPluginBindingResolvedText, l as isPluginOwnedBindingMetadata, m as resolvePluginConversationBindingApproval, n as buildPluginBindingDeclinedText, o as detachPluginConversationBinding, p as requestPluginConversationBinding, r as buildPluginBindingErrorText, s as getCurrentPluginConversationBinding, t as buildPluginBindingApprovalCustomId, u as isPluginOwnedSessionBindingRecord, v as listSessionBindingRecords, x as unbindConversationBindingRecord, y as resolveConversationBindingRecord } from "../conversation-binding-D8BWPBBz.js";
import { a as resolveConfiguredBindingRecordForConversation, i as resolveConfiguredBindingRecordBySessionKey, n as resolveConfiguredBinding, r as resolveConfiguredBindingRecord, t as primeConfiguredBindingRegistry } from "../binding-registry-D3uIeMfH.js";
import { n as createStaticReplyToModeResolver, r as createTopLevelChannelReplyToModeResolver, t as createScopedAccountReplyToModeResolver } from "../threading-helpers-JSVFlQzA.js";
import { t as recordInboundSession } from "../session-KXkNr7O1.js";
import { t as buildPairingReply } from "../pairing-messages-iGGK2g8O.js";
import { n as ensureConfiguredBindingTargetSession, r as resetConfiguredBindingTargetInPlace, t as ensureConfiguredBindingTargetReady } from "../binding-targets-D4iuglwq.js";
import { n as resolveConfiguredBindingRoute, r as resolveRuntimeConversationBindingRoute, t as ensureConfiguredBindingRouteReady } from "../binding-routing-Cw6wdZp0.js";
import { t as resolveThreadBindingConversationIdFromBindingId } from "../thread-binding-id-Bkm-THw-.js";
import { i as resolveThreadBindingThreadName, n as resolveThreadBindingFarewellText, r as resolveThreadBindingIntroText, t as formatThreadBindingDurationLabel } from "../thread-bindings-messages-BO8l-lwu.js";
import { t as issuePairingChallenge } from "../pairing-challenge-DDaSznoh.js";
import { t as resolvePairingIdLabel } from "../pairing-labels-DqI6Gjl3.js";
//#region src/channels/session-meta.ts
let inboundSessionRuntimePromise = null;
function loadInboundSessionRuntime() {
	inboundSessionRuntimePromise ??= import("../inbound.runtime-C4M6pqUP.js");
	return inboundSessionRuntimePromise;
}
async function recordInboundSessionMetaSafe(params) {
	const runtime = await loadInboundSessionRuntime();
	const storePath = runtime.resolveStorePath(params.cfg.session?.store, { agentId: params.agentId });
	try {
		await runtime.recordSessionMetaFromInbound({
			storePath,
			sessionKey: params.sessionKey,
			ctx: params.ctx
		});
	} catch (err) {
		params.onError?.(err);
	}
}
//#endregion
export { SessionBindingError, testing as __testing, testing, addChannelAllowFromStoreEntry, approveChannelPairingCode, buildPairingReply, buildPluginBindingApprovalCustomId, buildPluginBindingDeclinedText, buildPluginBindingErrorText, buildPluginBindingResolvedText, buildPluginBindingUnavailableText, clearPairingAllowFromReadCacheForTest, createConversationBindingRecord, createScopedAccountReplyToModeResolver, createStaticReplyToModeResolver, createTopLevelChannelReplyToModeResolver, detachPluginConversationBinding, ensureConfiguredBindingRouteReady, ensureConfiguredBindingTargetReady, ensureConfiguredBindingTargetSession, formatThreadBindingDisabledError, formatThreadBindingDurationLabel, formatThreadBindingSpawnDisabledError, getConversationBindingCapabilities, getCurrentPluginConversationBinding, getSessionBindingService, hasShownPluginBindingFallbackNotice, isPluginOwnedBindingMetadata, isPluginOwnedSessionBindingRecord, isSessionBindingError, issuePairingChallenge, listChannelPairingRequests, listSessionBindingRecords, markPluginBindingFallbackNoticeShown, parsePluginBindingApprovalCustomId, primeConfiguredBindingRegistry, readChannelAllowFromStore, readChannelAllowFromStoreSync, readLegacyChannelAllowFromStore, readLegacyChannelAllowFromStoreSync, recordInboundSession, recordInboundSessionMetaSafe, registerSessionBindingAdapter, removeChannelAllowFromStoreEntry, requestPluginConversationBinding, resetConfiguredBindingTargetInPlace, resolveChannelAllowFromPath, resolveConfiguredBinding, resolveConfiguredBindingRecord, resolveConfiguredBindingRecordBySessionKey, resolveConfiguredBindingRecordForConversation, resolveConfiguredBindingRoute, resolveConversationBindingRecord, resolveConversationLabel, resolvePairingIdLabel, resolvePinnedMainDmOwnerFromAllowlist, resolvePluginConversationBindingApproval, resolveRuntimeConversationBindingRoute, resolveThreadBindingConversationIdFromBindingId, resolveThreadBindingEffectiveExpiresAt, resolveThreadBindingFarewellText, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingIdleTimeoutMsForChannel, resolveThreadBindingIntroText, resolveThreadBindingLifecycle, resolveThreadBindingMaxAgeMs, resolveThreadBindingMaxAgeMsForChannel, resolveThreadBindingSpawnPolicy, resolveThreadBindingThreadName, resolveThreadBindingsEnabled, toPluginConversationBinding, touchConversationBindingRecord, unbindConversationBindingRecord, unregisterSessionBindingAdapter, upsertChannelPairingRequest };
