import type { OpenClawConfig } from "../../config/types.openclaw.js" ;
import { getChannelPlugin } from "./registry.js" ;
import type { ChannelId } from "./types.public.js" ;
export async function createChannelConversationBindingManager(params: {
channelId: ChannelId;
cfg: OpenClawConfig;
accountId?: string | null ;
}): Promise<{ stop: () => void | Promise<void > } | null > {
const createManager = getChannelPlugin(params.channelId)?.conversationBindings?.createManager;
if (!createManager) {
return null ;
}
return await createManager({
cfg: params.cfg,
accountId: params.accountId,
});
}
export function setChannelConversationBindingIdleTimeoutBySessionKey(params: {
channelId: ChannelId;
targetSessionKey: string;
accountId?: string | null ;
idleTimeoutMs: number;
}): Array<{
boundAt: number;
lastActivityAt: number;
idleTimeoutMs?: number;
maxAgeMs?: number;
}> {
const setIdleTimeoutBySessionKey = getChannelPlugin(params.channelId)?.conversationBindings
?.setIdleTimeoutBySessionKey;
if (!setIdleTimeoutBySessionKey) {
return [];
}
return setIdleTimeoutBySessionKey({
targetSessionKey: params.targetSessionKey,
accountId: params.accountId,
idleTimeoutMs: params.idleTimeoutMs,
});
}
export function setChannelConversationBindingMaxAgeBySessionKey(params: {
channelId: ChannelId;
targetSessionKey: string;
accountId?: string | null ;
maxAgeMs: number;
}): Array<{
boundAt: number;
lastActivityAt: number;
idleTimeoutMs?: number;
maxAgeMs?: number;
}> {
const setMaxAgeBySessionKey = getChannelPlugin(params.channelId)?.conversationBindings
?.setMaxAgeBySessionKey;
if (!setMaxAgeBySessionKey) {
return [];
}
return setMaxAgeBySessionKey({
targetSessionKey: params.targetSessionKey,
accountId: params.accountId,
maxAgeMs: params.maxAgeMs,
});
}
Messung V0.5 in Prozent C=89 H=95 G=91
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-07)
¤
*© Formatika GbR, Deutschland