UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

22 lines (21 loc) 817 B
import { a as normalizeLowercaseStringOrEmpty } from "./string-coerce-mnp54Vah.js"; //#region src/auto-reply/reply/commands-reset-mode.ts function parseSoftResetCommand(commandBodyNormalized) { const resetMatch = normalizeLowercaseStringOrEmpty(commandBodyNormalized).match(/^\/reset(?:\s|$)/); if (!resetMatch) return { matched: false }; const rest = commandBodyNormalized.slice(resetMatch[0].length).trimStart(); if (!rest) return { matched: false }; const restLower = normalizeLowercaseStringOrEmpty(rest); const softMatch = restLower.match(/^soft(?:\s|$)/); if (!softMatch) return { matched: false }; if (restLower === "soft") return { matched: true, tail: "" }; return { matched: true, tail: rest.slice(softMatch[0].length).trimStart() }; } //#endregion export { parseSoftResetCommand as t };