openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
25 lines (24 loc) • 810 B
JavaScript
import { l as normalizeOptionalString } from "./string-coerce-CCIiB4H7.mjs";
import { v as clearSessionControllerMailbox } from "./session-controller.mailbox-BcK8UF_b.mjs";
import { a as getExistingFollowupQueue, d as completeFollowupRunLifecycle } from "./state-DGvM9kEH.mjs";
//#region src/auto-reply/reply/queue/cleanup.ts
function clearSessionQueues(e, t, n, r) {
const i = /* @__PURE__ */ new Set();
const a = /* @__PURE__ */ new Set();
const o = [];
for (const s of e) {
const e = normalizeOptionalString(s);
if (!e || i.has(e)) continue;
i.add(e);
o.push(e);
r?.();
const c = getExistingFollowupQueue(e, t);
if (c && !a.has(c)) {
a.add(c);
clearSessionControllerMailbox(c, completeFollowupRunLifecycle, n, r);
}
}
return o;
}
//#endregion
export { clearSessionQueues as t };