UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

27 lines (26 loc) • 1.06 kB
import { r as resolveGlobalMap } from "./global-singleton-D7yf05nR.mjs"; import { t as pruneMapToMaxSize } from "./map-size-BBr20tbc.mjs"; import { n as normalizeCommandBody } from "./commands-registry-normalize-dI3NYF5y.mjs"; import { n as normalizeAbortTriggerText, t as isAbortTrigger } from "./abort-trigger-text-id3HRMGA.mjs"; //#region src/auto-reply/reply/abort-primitives.ts const ABORT_MEMORY = resolveGlobalMap(Symbol.for("openclaw.abortMemory"), "close-and-restart"); const ABORT_MEMORY_MAX = 2e3; function isAbortRequestText(e, t) { if (!e) return false; const n = normalizeCommandBody(e, t); return normalizeAbortTriggerText(n) === "/stop" || isAbortTrigger(n); } function getAbortMemory(e) { const t = e.trim(); return t ? ABORT_MEMORY.get(t) : void 0; } function setAbortMemory(e, t) { const n = e.trim(); if (!n) return; ABORT_MEMORY.delete(n); if (!t) return; ABORT_MEMORY.set(n, true); pruneMapToMaxSize(ABORT_MEMORY, ABORT_MEMORY_MAX); } //#endregion export { isAbortRequestText as n, setAbortMemory as r, getAbortMemory as t };