openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
11 lines (10 loc) • 686 B
JavaScript
import { c as startsWithSilentToken, l as stripLeadingSilentToken, r as SILENT_REPLY_TOKEN, u as stripSilentToken } from "./tokens-Ljy0DfNV.mjs";
//#region src/auto-reply/reply/mixed-silent-reply-tokens.ts
/** Returns null when mixed-content text has no silent token to normalize. */
function stripMixedSilentReplyTokens(text, token = SILENT_REPLY_TOKEN) {
const hasLeadingToken = startsWithSilentToken(text, token);
const remainder = hasLeadingToken ? stripLeadingSilentToken(text, token) : text;
return hasLeadingToken || remainder.toLowerCase().includes(token.toLowerCase()) ? stripSilentToken(remainder, token) : null;
}
//#endregion
export { stripMixedSilentReplyTokens as t };