(cmd: string)
| 619 | : ALL_COMMANDS.filter((cmd) => !FREEBUFF_ONLY_COMMANDS.has(cmd.name)) |
| 620 | |
| 621 | export function findCommand(cmd: string): CommandDefinition | undefined { |
| 622 | const lowerCmd = cmd.toLowerCase() |
| 623 | |
| 624 | // First check the static command registry |
| 625 | const staticCommand = COMMAND_REGISTRY.find( |
| 626 | (def) => def.name === lowerCmd || def.aliases.includes(lowerCmd), |
| 627 | ) |
| 628 | if (staticCommand) { |
| 629 | return staticCommand |
| 630 | } |
| 631 | |
| 632 | // Check if this is a skill command (prefixed with "skill:") |
| 633 | if (lowerCmd.startsWith('skill:')) { |
| 634 | const skillName = lowerCmd.slice('skill:'.length) |
| 635 | const skill = getSkillByName(skillName) |
| 636 | if (skill) { |
| 637 | return createSkillCommand(skill.name) |
| 638 | } |
| 639 | } |
| 640 | |
| 641 | return undefined |
| 642 | } |
| 643 | |
| 644 | /** |
| 645 | * Creates a dynamic command definition for a skill. |
no test coverage detected