openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
32 lines (31 loc) • 1.34 kB
JavaScript
import { v as requireActivePluginRegistry } from "./runtime-ezCEpumg.mjs";
import { t as listRegisteredPluginCommands } from "./plugin-command-registry-Djk4s-ty.mjs";
import "./command-registry-state-D8aXLQW8.mjs";
import "./command-registration-BssVVqxs.mjs";
import { t as executeRegisteredPluginCommand } from "./plugin-command-execution-CLFpMqy0.mjs";
import { t as matchRegisteredPluginCommand } from "./plugin-command-matcher-CoCJ8ZcZ.mjs";
//#region src/plugins/commands.ts
/** Match one compatibility command invocation against the current command registry. */
function matchPluginCommand(e, t = {}) {
const n = requireActivePluginRegistry();
return matchRegisteredPluginCommand({
commands: listRegisteredPluginCommands(n),
commandBody: e,
channel: t.channel,
aliasScope: { kind: "all" }
});
}
async function executePluginCommand(e) {
return await executeRegisteredPluginCommand(requireActivePluginRegistry(), e);
}
/** List registered plugin commands for help and command discovery. */
function listPluginCommands() {
return listRegisteredPluginCommands(requireActivePluginRegistry()).map((e) => ({
name: e.name,
description: e.description,
pluginId: e.pluginId,
acceptsArgs: e.acceptsArgs ?? false
}));
}
//#endregion
export { listPluginCommands as n, matchPluginCommand as r, executePluginCommand as t };