Elffuss BraidHub

kikocis/continue public

main · 552 BRawPermalink
1import { CustomCommand, SlashCommandWithSource } from "../..";
2
3export function convertCustomCommandToSlashCommand(
4 customCommand: CustomCommand,
5): SlashCommandWithSource {
6 const commandName = customCommand.name.startsWith("/")
7 ? customCommand.name.substring(1)
8 : customCommand.name;
9 return {
10 name: commandName,
11 description: customCommand.description ?? "",
12 prompt: customCommand.prompt,
13 source: "json-custom-command",
14 promptFile: customCommand.sourceFile, // TODO refactor promptFile to align with sourceFile
15 };
16}