UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.26 kB
import{o as normalizeLowercaseStringOrEmpty}from"./string-coerce-CpTFcSwY.mjs"; //!src/auto-reply/reply/abort-trigger-text.ts const ABORT_TRIGGERS=/* @__PURE__ */ new Set([`stop`,`esc`,`abort`,`exit`,`interrupt`,`detente`,`deten`,`detén`,`arrete`,`arrête`,`停止`,`停下来`,`暂停`,`やめて`,`止めて`,`रुको`,`توقف`,`стоп`,`остановись`,`останови`,`остановить`,`прекрати`,`halt`,`anhalten`,`aufhören`,`hoer auf`,`stopp`,`pare`,`stop openclaw`,`openclaw stop`,`stop action`,`stop current action`,`stop run`,`stop current run`,`stop agent`,`stop the agent`,`stop don't do anything`,`stop dont do anything`,`stop do not do anything`,`stop doing anything`,`do not do that`,`please stop`,`stop please`]);const ABORT_PUNCTUATION=String.raw`[.!?!?…,,。;;::'"’”)\]}]`;const TRAILING_ABORT_PUNCTUATION_RE=new RegExp(`(?<!${ABORT_PUNCTUATION})${ABORT_PUNCTUATION}+$`,`u`);function normalizeAbortTriggerText(e){return normalizeLowercaseStringOrEmpty(e).replace(/[’`]/g,`'`).replace(/\s+/g,` `).replace(TRAILING_ABORT_PUNCTUATION_RE,``).trim()}function isAbortTrigger(e){return e?ABORT_TRIGGERS.has(normalizeAbortTriggerText(e)):false}export{normalizeAbortTriggerText as n,isAbortTrigger as t};