MCPcopy Index your code
hub / github.com/CopilotKit/CopilotKit / toCommandSpec

Function toCommandSpec

packages/bot/src/commands.ts:86–96  ·  view source on GitHub ↗
(command: BotCommand)

Source from the content-addressed store, hash-verified

84}
85
86export function toCommandSpec(command: BotCommand): CommandSpec {
87 return {
88 // Preserve hyphens here (display/registration name): Discord and Slack
89 // accept them, so `/file-issue` stays `/file-issue` there. Telegram's
90 // adapter converts hyphens to underscores itself; routing still matches
91 // because `normalizeCommandName` collapses both forms.
92 name: command.name.trim().replace(/^\//, "").toLowerCase(),
93 description: command.description ?? "",
94 options: command.options ? toJsonSchema(command.options) : undefined,
95 };
96}

Callers 1

commands.test.tsFile · 0.85

Calls 1

toJsonSchemaFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…