continue-custom/core/commands/slash/customSlashCommand.ts
2025-06-23 09:26:10 -07:00

15 lines
457 B
TypeScript

import { CustomCommand, SlashCommandWithSource } from "../..";
export function convertCustomCommandToSlashCommand(
customCommand: CustomCommand,
): SlashCommandWithSource {
const commandName = customCommand.name.startsWith("/")
? customCommand.name.substring(1)
: customCommand.name;
return {
name: commandName,
description: customCommand.description ?? "",
prompt: customCommand.prompt,
source: "json-custom-command",
};
}