Elffuss BraidHub

kikocis/continue public

main · 1015 BRawPermalink
1import {
2 SlashCommand,
3 SlashCommandDescription,
4 SlashCommandWithSource,
5} from "../../..";
6import GenerateTerminalCommand from "./cmd";
7import CommitMessageCommand from "./commit";
8import DraftIssueCommand from "./draftIssue";
9import HttpSlashCommand from "./http";
10import OnboardSlashCommand from "./onboard";
11import ReviewMessageCommand from "./review";
12import ShareSlashCommand from "./share";
13
14const LegacyBuiltInSlashCommands: SlashCommand[] = [
15 DraftIssueCommand,
16 ShareSlashCommand,
17 GenerateTerminalCommand,
18 HttpSlashCommand,
19 CommitMessageCommand,
20 ReviewMessageCommand,
21 OnboardSlashCommand,
22];
23
24export function getLegacyBuiltInSlashCommandFromDescription(
25 desc: SlashCommandDescription,
26): SlashCommandWithSource | undefined {
27 const cmd = LegacyBuiltInSlashCommands.find((cmd) => cmd.name === desc.name);
28 if (!cmd) {
29 return undefined;
30 }
31 return {
32 ...cmd,
33 params: desc.params,
34 description: desc.description ?? cmd.description,
35 source: "built-in-legacy",
36 };
37}