From 2a95c8287ed3b6fc38e7dcec5f0a19b9e2d843e7 Mon Sep 17 00:00:00 2001 From: Abhi <43648792+abhipatel12@users.noreply.github.com> Date: Sun, 20 Jul 2025 16:57:34 -0400 Subject: prefactor(commands): Command Service Prefactor for Extensible Commands (#4511) --- packages/cli/src/ui/commands/chatCommand.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'packages/cli/src/ui/commands/chatCommand.ts') diff --git a/packages/cli/src/ui/commands/chatCommand.ts b/packages/cli/src/ui/commands/chatCommand.ts index fd56afbd..2f669481 100644 --- a/packages/cli/src/ui/commands/chatCommand.ts +++ b/packages/cli/src/ui/commands/chatCommand.ts @@ -5,7 +5,12 @@ */ import * as fsPromises from 'fs/promises'; -import { CommandContext, SlashCommand, MessageActionReturn } from './types.js'; +import { + CommandContext, + SlashCommand, + MessageActionReturn, + CommandKind, +} from './types.js'; import path from 'path'; import { HistoryItemWithoutId, MessageType } from '../types.js'; @@ -54,6 +59,7 @@ const getSavedChatTags = async ( const listCommand: SlashCommand = { name: 'list', description: 'List saved conversation checkpoints', + kind: CommandKind.BUILT_IN, action: async (context): Promise => { const chatDetails = await getSavedChatTags(context, false); if (chatDetails.length === 0) { @@ -81,6 +87,7 @@ const saveCommand: SlashCommand = { name: 'save', description: 'Save the current conversation as a checkpoint. Usage: /chat save ', + kind: CommandKind.BUILT_IN, action: async (context, args): Promise => { const tag = args.trim(); if (!tag) { @@ -122,9 +129,10 @@ const saveCommand: SlashCommand = { const resumeCommand: SlashCommand = { name: 'resume', - altName: 'load', + altNames: ['load'], description: 'Resume a conversation from a checkpoint. Usage: /chat resume ', + kind: CommandKind.BUILT_IN, action: async (context, args) => { const tag = args.trim(); if (!tag) { @@ -193,5 +201,6 @@ const resumeCommand: SlashCommand = { export const chatCommand: SlashCommand = { name: 'chat', description: 'Manage conversation history.', + kind: CommandKind.BUILT_IN, subCommands: [listCommand, saveCommand, resumeCommand], }; -- cgit v1.2.3