fix(webui): drive slash command routing from metadata
This commit is contained in:
@@ -674,12 +674,16 @@ describe("webui API helpers", () => {
|
||||
title: "Stop current task",
|
||||
description: "Cancel the active task.",
|
||||
icon: "square",
|
||||
lifecycle: "stop_active_turn",
|
||||
accepts_args: false,
|
||||
},
|
||||
{
|
||||
command: "/restart",
|
||||
title: "Restart nanobot",
|
||||
description: "Restart the bot process.",
|
||||
icon: "rotate-cw",
|
||||
lifecycle: "side_channel",
|
||||
accepts_args: false,
|
||||
},
|
||||
{
|
||||
command: "/history",
|
||||
@@ -687,18 +691,46 @@ describe("webui API helpers", () => {
|
||||
description: "Print the last N messages.",
|
||||
icon: "history",
|
||||
arg_hint: "[n]",
|
||||
lifecycle: "side_channel",
|
||||
accepts_args: true,
|
||||
},
|
||||
{
|
||||
command: "/legacy",
|
||||
title: "Legacy row",
|
||||
description: "Old metadata should not be guessed.",
|
||||
icon: "circle-help",
|
||||
},
|
||||
],
|
||||
}),
|
||||
} as Response);
|
||||
|
||||
await expect(listSlashCommands("tok")).resolves.toEqual([
|
||||
{
|
||||
command: "/stop",
|
||||
title: "Stop current task",
|
||||
description: "Cancel the active task.",
|
||||
icon: "square",
|
||||
argHint: "",
|
||||
lifecycle: "stop_active_turn",
|
||||
acceptsArgs: false,
|
||||
},
|
||||
{
|
||||
command: "/restart",
|
||||
title: "Restart nanobot",
|
||||
description: "Restart the bot process.",
|
||||
icon: "rotate-cw",
|
||||
argHint: "",
|
||||
lifecycle: "side_channel",
|
||||
acceptsArgs: false,
|
||||
},
|
||||
{
|
||||
command: "/history",
|
||||
title: "Show conversation history",
|
||||
description: "Print the last N messages.",
|
||||
icon: "history",
|
||||
argHint: "[n]",
|
||||
lifecycle: "side_channel",
|
||||
acceptsArgs: true,
|
||||
},
|
||||
]);
|
||||
expect(fetch).toHaveBeenCalledWith(
|
||||
|
||||
Reference in New Issue
Block a user