continue-custom/core/commands/slash/customSlashCommand.ts
2025-09-29 16:05:05 -07:00

16 lines
499 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",
sourceFile: customCommand.sourceFile,
};
}