UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

17 lines (16 loc) • 699 B
//#region src/cli/program/command-group-descriptors.ts /** Bind descriptors and registration arguments without importing the command modules. */ function buildCommandGroupEntries(descriptors, specs, ...args) { const descriptorsByName = new Map(descriptors.map((descriptor) => [descriptor.name, descriptor])); return specs.map(([commandNames, register]) => ({ names: commandNames, placeholders: commandNames.map((name) => { const descriptor = descriptorsByName.get(name); if (!descriptor) throw new Error(`Unknown command descriptor: ${name}`); return descriptor; }), register: (program) => register(program, ...args) })); } //#endregion export { buildCommandGroupEntries as t };