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: tui 隐藏/help中部分命令,取消禁用
jingjinduocecdf00f57b6
diff --git a/jiuwenswarm/channels/tui/frontend/src/core/commands/CommandService.ts b/jiuwenswarm/channels/tui/frontend/src/core/commands/CommandService.tsindex e473ad14b0..ff9d64383e 100644--- a/jiuwenswarm/channels/tui/frontend/src/core/commands/CommandService.ts+++ b/jiuwenswarm/channels/tui/frontend/src/core/commands/CommandService.ts@@ -87,9 +87,9 @@ export class CommandService {return this.commands.get(target);}- getAll(): SlashCommand[] {+ getAll(includeHidden = false): SlashCommand[] {return this.topLevelCommands- .filter((command) => !command.hidden)+ .filter((command) => includeHidden || !command.hidden).sort((a, b) => a.name.localeCompare(b.name));}@@ -130,7 +130,7 @@ export class CommandService {}async execute(raw: string, ctx: CommandContext): Promise<void> {- const parsed = parseSlashCommand(raw.trim(), this.getAll());+ const parsed = parseSlashCommand(raw.trim(), this.getAll(true));const command = parsed.command;if (!command) {// /<skill> <query> shorthand: check if the unknown name matches an installed skill.diff --git a/jiuwenswarm/channels/tui/frontend/src/core/commands/types.ts b/jiuwenswarm/channels/tui/frontend/src/core/commands/types.tsindex 4926887db6..1f89625e06 100644--- a/jiuwenswarm/channels/tui/frontend/src/core/commands/types.ts+++ b/jiuwenswarm/channels/tui/frontend/src/core/commands/types.ts@@ -115,6 +115,7 @@ export interface SlashCommand {* e.g. "name=任务名 cron_expr=\"时间\" description=\"让Agent做什么\""*/argGuide?: string;+ /** 在/help中隐藏,但仍可执行 */hidden?: boolean;isSafeConcurrent?: boolean;kind: CommandKind;diff --git a/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts b/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.tsindex 4cc61489c5..9af9416976 100644--- a/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts+++ b/jiuwenswarm/channels/tui/frontend/src/ui/app-screen.ts@@ -3219,7 +3219,7 @@ export class AppScreen implements Component, Focusable {return null;}- const parsed = parseSlashCommand(text, this.commands.getAll());+ const parsed = parseSlashCommand(text, this.commands.getAll(true));if (!parsed.command) {return null;}@@ -3317,7 +3317,7 @@ export class AppScreen implements Component, Focusable {): ComposerAutocompleteProvider {// Convert each installed skill to a TuiSlashCommand so CombinedAutocompleteProvider// treats /<skillName> exactly like any other slash command for name completion.- const registeredNames = new Set(this.commands.getAll().map((c) => c.name));+ const registeredNames = new Set(this.commands.getAll(true).map((c) => c.name));const skillCommands: TuiSlashCommand[] = skills.filter((skill) => !registeredNames.has(skill.name)).map((skill) => ({@@ -3338,7 +3338,7 @@ export class AppScreen implements Component, Focusable {private buildSlashCommands(): TuiSlashCommand[] {const hasAnyCompletion = (cmd: SlashCommand): boolean =>!!cmd.completion || (cmd.subCommands?.some(hasAnyCompletion) ?? false);- return this.commands.getAll().map((command) => ({+ return this.commands.getAll(true).map((command) => ({name: command.name,description: command.description,getArgumentCompletions: hasAnyCompletion(command)