openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 943 B
JavaScript
import{i as resolveGlobalMap}from"./global-singleton-DolL9xGt.mjs";import{t as pruneMapToMaxSize}from"./map-size-DLQqorvK.mjs";import{n as normalizeCommandBody}from"./commands-registry-normalize-yxTxMnHJ.mjs";import{n as normalizeAbortTriggerText,t as isAbortTrigger}from"./abort-trigger-text-DayuA6in.mjs";
//!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)}export{isAbortRequestText as n,setAbortMemory as r,getAbortMemory as t};