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,
|
// desktop,
|
||||||
context,
|
context,
|
||||||
contextNonInteractive,
|
contextNonInteractive,
|
||||||
cost,
|
// cost 已重导出 usage/index.ts(name='usage', aliases=['cost','stats']),
|
||||||
diff,
|
diff,
|
||||||
doctor,
|
doctor,
|
||||||
effort,
|
effort,
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ export function createInfoRoutes(sessionManager: SessionManager): Hono {
|
||||||
const commands = await getCommands(process.cwd())
|
const commands = await getCommands(process.cwd())
|
||||||
return c.json(
|
return c.json(
|
||||||
commands
|
commands
|
||||||
.filter(cmd => !cmd.isHidden)
|
.filter(cmd => !cmd.isHidden && cmd.type === 'prompt')
|
||||||
.map(cmd => ({
|
.map(cmd => ({
|
||||||
name: getCommandName(cmd),
|
name: getCommandName(cmd),
|
||||||
description: cmd.description,
|
description: cmd.description,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user