UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

31 lines (30 loc) • 1.28 kB
import { t as isCommandFlagEnabled } from "./commands.flags-DCgrWS7a.mjs"; import { t as getChatCommands } from "./commands-registry.data-4VTf_jm9.mjs"; //#region src/auto-reply/commands-registry-list.ts function listChatCommands(params) { const commands = [...getChatCommands()]; for (const spec of params?.skillCommands ?? []) { const command = { key: `skill:${spec.skillName}`, nativeName: spec.name, description: spec.description, textAliases: [`/${spec.name}`], acceptsArgs: true, argsParsing: "none", scope: "both", category: "tools" }; if (spec.descriptionLocalizations) command.descriptionLocalizations = spec.descriptionLocalizations; commands.push(command); } return commands; } /** Applies config feature flags to command keys that can be operator-disabled. */ function isCommandEnabled(cfg, commandKey) { return commandKey === "config" || commandKey === "mcp" || commandKey === "plugins" || commandKey === "debug" || commandKey === "bash" ? isCommandFlagEnabled(cfg, commandKey) : true; } function listChatCommandsForConfig(cfg, params) { return listChatCommands(params).filter((command) => isCommandEnabled(cfg, command.key)); } //#endregion export { listChatCommands as n, listChatCommandsForConfig as r, isCommandEnabled as t };