feat: auto-execute simple slash commands on Enter (#13985)

This commit is contained in:
Jack Wotherspoon
2025-12-01 12:29:03 -05:00
committed by GitHub
parent 844d3a4dfa
commit f918af82fe
38 changed files with 393 additions and 9 deletions
@@ -68,6 +68,7 @@ const listCommand: SlashCommand = {
name: 'list',
description: 'List saved conversation checkpoints',
kind: CommandKind.BUILT_IN,
autoExecute: true,
action: async (context): Promise<void> => {
const chatDetails = await getSavedChatTags(context, false);
@@ -85,6 +86,7 @@ const saveCommand: SlashCommand = {
description:
'Save the current conversation as a checkpoint. Usage: /chat save <tag>',
kind: CommandKind.BUILT_IN,
autoExecute: false,
action: async (context, args): Promise<SlashCommandActionReturn | void> => {
const tag = args.trim();
if (!tag) {
@@ -153,6 +155,7 @@ const resumeCommand: SlashCommand = {
description:
'Resume a conversation from a checkpoint. Usage: /chat resume <tag>',
kind: CommandKind.BUILT_IN,
autoExecute: false,
action: async (context, args) => {
const tag = args.trim();
if (!tag) {
@@ -236,6 +239,7 @@ const deleteCommand: SlashCommand = {
name: 'delete',
description: 'Delete a conversation checkpoint. Usage: /chat delete <tag>',
kind: CommandKind.BUILT_IN,
autoExecute: false,
action: async (context, args): Promise<MessageActionReturn> => {
const tag = args.trim();
if (!tag) {
@@ -309,6 +313,7 @@ const shareCommand: SlashCommand = {
description:
'Share the current conversation to a markdown or json file. Usage: /chat share <file>',
kind: CommandKind.BUILT_IN,
autoExecute: false,
action: async (context, args): Promise<MessageActionReturn> => {
let filePathArg = args.trim();
if (!filePathArg) {
@@ -376,6 +381,7 @@ export const chatCommand: SlashCommand = {
name: 'chat',
description: 'Manage conversation history',
kind: CommandKind.BUILT_IN,
autoExecute: false,
subCommands: [
listCommand,
saveCommand,