openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
21 lines (20 loc) • 894 B
JavaScript
import { t as isCommandEnabled } from "./commands-registry-list-6-6JFUDI.mjs";
import { t as shouldHandleTextCommands } from "./commands-text-routing-BYEg7XMZ.mjs";
import { n as resolveCommandContextText } from "./context-text-D9JfaJrk.mjs";
import { t as hasControlCommand } from "./command-detection-BdYTt9PO.mjs";
//#region src/auto-reply/reply/dispatch-acp-command-bypass.ts
function shouldBypassAcpDispatchForCommand(e, t) {
const n = resolveCommandContextText(e);
if (!n) return false;
const r = shouldHandleTextCommands({
cfg: t,
surface: e.Surface ?? e.Provider ?? "",
commandSource: e.CommandSource
});
if (/^\/(?:new|reset|acp)(?:\s|$)/i.test(n)) return true;
if (hasControlCommand(n, t)) return r;
if (!n.startsWith("!") || !e.CommandAuthorized || !isCommandEnabled(t, "bash")) return false;
return r;
}
//#endregion
export { shouldBypassAcpDispatchForCommand as t };