summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/commands/chatCommand.ts
diff options
context:
space:
mode:
authorAbhi <[email protected]>2025-07-20 16:57:34 -0400
committerGitHub <[email protected]>2025-07-20 20:57:34 +0000
commit2a95c8287ed3b6fc38e7dcec5f0a19b9e2d843e7 (patch)
tree1a9ffb6be8468aa44e54bfcb8ae2f961b970cf9a /packages/cli/src/ui/commands/chatCommand.ts
parent7a9821607bafcbb98cf059705aaab358d46e711c (diff)
prefactor(commands): Command Service Prefactor for Extensible Commands (#4511)
Diffstat (limited to 'packages/cli/src/ui/commands/chatCommand.ts')
-rw-r--r--packages/cli/src/ui/commands/chatCommand.ts13
1 files changed, 11 insertions, 2 deletions
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<MessageActionReturn> => {
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 <tag>',
+ kind: CommandKind.BUILT_IN,
action: async (context, args): Promise<MessageActionReturn> => {
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 <tag>',
+ 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],
};