prefactor(commands): Command Service Prefactor for Extensible Commands (#4511)

This commit is contained in:
Abhi
2025-07-20 16:57:34 -04:00
committed by GitHub
parent 7a9821607b
commit 2a95c8287e
36 changed files with 919 additions and 720 deletions

View File

@@ -6,12 +6,17 @@
import { MessageType, HistoryItemStats } from '../types.js';
import { formatDuration } from '../utils/formatters.js';
import { type CommandContext, type SlashCommand } from './types.js';
import {
type CommandContext,
type SlashCommand,
CommandKind,
} from './types.js';
export const statsCommand: SlashCommand = {
name: 'stats',
altName: 'usage',
altNames: ['usage'],
description: 'check session stats. Usage: /stats [model|tools]',
kind: CommandKind.BUILT_IN,
action: (context: CommandContext) => {
const now = new Date();
const { sessionStartTime } = context.session.stats;
@@ -38,6 +43,7 @@ export const statsCommand: SlashCommand = {
{
name: 'model',
description: 'Show model-specific usage statistics.',
kind: CommandKind.BUILT_IN,
action: (context: CommandContext) => {
context.ui.addItem(
{
@@ -50,6 +56,7 @@ export const statsCommand: SlashCommand = {
{
name: 'tools',
description: 'Show tool-specific usage statistics.',
kind: CommandKind.BUILT_IN,
action: (context: CommandContext) => {
context.ui.addItem(
{