MCPcopy Index your code
hub / github.com/Noumena-Network/code / getCommand

Function getCommand

src/commands.ts:715–730  ·  view source on GitHub ↗
(commandName: string, commands: Command[])

Source from the content-addressed store, hash-verified

713}
714
715export function getCommand(commandName: string, commands: Command[]): Command {
716 const command = findCommand(commandName, commands)
717 if (!command) {
718 throw ReferenceError(
719 `Command ${commandName} not found. Available commands: ${commands
720 .map(_ => {
721 const name = getCommandName(_)
722 return _.aliases ? `${name} (aliases: ${_.aliases.join(', ')})` : name
723 })
724 .sort((a, b) => a.localeCompare(b))
725 .join(', ')}`,
726 )
727 }
728
729 return command
730}
731
732/**
733 * Formats a command's description with its source annotation for user-facing UI.

Callers 3

runAgentFunction · 0.85
applyCommandSuggestionFunction · 0.85

Calls 2

findCommandFunction · 0.85
getCommandNameFunction · 0.50

Tested by

no test coverage detected