JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
fix:registerCommand()递归注册所有子命令
openJiuwen-bot62a1862e8c6a
diff --git a/jiuwenclaw/cli/src/core/commands/CommandService.ts b/jiuwenclaw/cli/src/core/commands/CommandService.tsindex ce188202a4..fcf76731b2 100644--- a/jiuwenclaw/cli/src/core/commands/CommandService.ts+++ b/jiuwenclaw/cli/src/core/commands/CommandService.ts@@ -48,8 +48,10 @@ export function parseSlashCommand(raw: string, commands: readonly SlashCommand[]export class CommandService {private commands = new Map<string, SlashCommand>();private aliases = new Map<string, string>();+ private topLevelCommands: SlashCommand[] = [];register(commands: readonly SlashCommand[]): void {+ this.topLevelCommands = [...commands];for (const command of commands) {this.registerCommand(command);}@@ -71,7 +73,7 @@ export class CommandService {}getAll(): SlashCommand[] {- return [...this.commands.values()]+ return this.topLevelCommands.filter((command) => !command.hidden).sort((a, b) => a.name.localeCompare(b.name));}