Merge pull request #77 from Askhz/fix/commands-dedup-and-filter
fix: 修复 /agents/commands 接口 duplicate command name 和返回多余 TUI 命令
This commit is contained in:
commit
40a243a94e
|
|
@ -314,7 +314,7 @@ const COMMANDS = memoize((): Command[] => [
|
|||
// desktop,
|
||||
context,
|
||||
contextNonInteractive,
|
||||
cost,
|
||||
// cost 已重导出 usage/index.ts(name='usage', aliases=['cost','stats']),
|
||||
diff,
|
||||
doctor,
|
||||
effort,
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export function createInfoRoutes(sessionManager: SessionManager): Hono {
|
|||
const commands = await getCommands(process.cwd())
|
||||
return c.json(
|
||||
commands
|
||||
.filter(cmd => !cmd.isHidden)
|
||||
.filter(cmd => !cmd.isHidden && cmd.type === 'prompt')
|
||||
.map(cmd => ({
|
||||
name: getCommandName(cmd),
|
||||
description: cmd.description,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user