MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / getSlashCommandsWithSkills

Function getSlashCommandsWithSkills

cli/src/data/slash-commands.ts:227–246  ·  view source on GitHub ↗
(skills: SkillsMap)

Source from the content-addressed store, hash-verified

225 * Skills become slash commands that users can invoke directly.
226 */
227export function getSlashCommandsWithSkills(skills: SkillsMap): SlashCommand[] {
228 const skillCommands: SlashCommand[] = Object.values(skills).map((skill) => ({
229 id: `skill:${skill.name}`,
230 label: `skill:${skill.name}`,
231 description: truncateDescription(skill.description),
232 }))
233
234 let commands = [...SLASH_COMMANDS, ...skillCommands]
235
236 if (IS_FREEBUFF && !getChatGptOAuthStatus().connected) {
237 commands = commands.map((cmd) => {
238 if (cmd.id === 'review' || cmd.id === 'plan') {
239 return { ...cmd, description: 'Connect required. ' + cmd.description }
240 }
241 return cmd
242 })
243 }
244
245 return commands
246}

Callers 1

ChatFunction · 0.90

Calls 2

getChatGptOAuthStatusFunction · 0.90
truncateDescriptionFunction · 0.85

Tested by

no test coverage detected