mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 04:30:48 +00:00
updated /stats to use new slash command arch (#4146)
This commit is contained in:
parent
8d9dc44b71
commit
03b3917f62
6 changed files with 163 additions and 105 deletions
|
|
@ -247,36 +247,6 @@ export const useSlashCommandProcessor = (
|
|||
description: 'set external editor preference',
|
||||
action: (_mainCommand, _subCommand, _args) => openEditorDialog(),
|
||||
},
|
||||
{
|
||||
name: 'stats',
|
||||
altName: 'usage',
|
||||
description: 'check session stats. Usage: /stats [model|tools]',
|
||||
action: (_mainCommand, subCommand, _args) => {
|
||||
if (subCommand === 'model') {
|
||||
addMessage({
|
||||
type: MessageType.MODEL_STATS,
|
||||
timestamp: new Date(),
|
||||
});
|
||||
return;
|
||||
} else if (subCommand === 'tools') {
|
||||
addMessage({
|
||||
type: MessageType.TOOL_STATS,
|
||||
timestamp: new Date(),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const now = new Date();
|
||||
const { sessionStartTime } = session.stats;
|
||||
const wallDuration = now.getTime() - sessionStartTime.getTime();
|
||||
|
||||
addMessage({
|
||||
type: MessageType.STATS,
|
||||
duration: formatDuration(wallDuration),
|
||||
timestamp: new Date(),
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'mcp',
|
||||
description: 'list configured MCP servers and tools',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue