openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
31 lines (30 loc) • 1.12 kB
JavaScript
import { t as isCommandFlagEnabled } from "./commands.flags-bgyYi4vf.mjs";
import { t as getChatCommands } from "./commands-registry.data-CoxL3Db3.mjs";
//#region src/auto-reply/commands-registry-list.ts
function listChatCommands(e) {
const t = [...getChatCommands()];
for (const n of e?.skillCommands ?? []) {
const e = {
key: `skill:${n.skillName}`,
nativeName: n.name,
description: n.description,
textAliases: [`/${n.name}`],
acceptsArgs: true,
argsParsing: "none",
scope: "both",
category: "tools"
};
if (n.descriptionLocalizations) e.descriptionLocalizations = n.descriptionLocalizations;
t.push(e);
}
return t;
}
/** Applies config feature flags to command keys that can be operator-disabled. */
function isCommandEnabled(e, t) {
return t === "config" || t === "mcp" || t === "plugins" || t === "debug" || t === "bash" ? isCommandFlagEnabled(e, t) : true;
}
function listChatCommandsForConfig(e, t) {
return listChatCommands(t).filter((t) => isCommandEnabled(e, t.key));
}
//#endregion
export { listChatCommands as n, listChatCommandsForConfig as r, isCommandEnabled as t };