openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
29 lines (28 loc) • 1.01 kB
JavaScript
import { l as normalizeOptionalString } from "./string-coerce-CIXf7egm.js";
import { n as clearCommandLane } from "./command-queue-C3Fv2rcU.js";
import { i as clearFollowupQueue } from "./settings-jmDsm5RI.js";
import { t as resolveEmbeddedSessionLane } from "./lanes-CVttd5qX.js";
import { t as clearFollowupDrainCallback } from "./drain-Bt23d2Dt.js";
//#region src/auto-reply/reply/queue/cleanup.ts
function clearSessionQueues(keys) {
const seen = /* @__PURE__ */ new Set();
let followupCleared = 0;
let laneCleared = 0;
const clearedKeys = [];
for (const key of keys) {
const cleaned = normalizeOptionalString(key);
if (!cleaned || seen.has(cleaned)) continue;
seen.add(cleaned);
clearedKeys.push(cleaned);
followupCleared += clearFollowupQueue(cleaned);
clearFollowupDrainCallback(cleaned);
laneCleared += clearCommandLane(resolveEmbeddedSessionLane(cleaned));
}
return {
followupCleared,
laneCleared,
keys: clearedKeys
};
}
//#endregion
export { clearSessionQueues as t };