MCPcopy Create free account
hub / github.com/Noumena-Network/code / formatDescriptionWithSource

Function formatDescriptionWithSource

src/commands.ts:739–765  ·  view source on GitHub ↗
(cmd: Command)

Source from the content-addressed store, hash-verified

737 * For model-facing prompts (like SkillTool), use cmd.description directly.
738 */
739export function formatDescriptionWithSource(cmd: Command): string {
740 if (cmd.type !== 'prompt') {
741 return cmd.description
742 }
743
744 if (cmd.kind === 'workflow') {
745 return `${cmd.description} (workflow)`
746 }
747
748 if (cmd.source === 'plugin') {
749 const pluginName = cmd.pluginInfo?.pluginManifest.name
750 if (pluginName) {
751 return `(${pluginName}) ${cmd.description}`
752 }
753 return `${cmd.description} (plugin)`
754 }
755
756 if (cmd.source === 'builtin' || cmd.source === 'mcp') {
757 return cmd.description
758 }
759
760 if (cmd.source === 'bundled') {
761 return `${cmd.description} (bundled)`
762 }
763
764 return `${cmd.description} (${getSettingSourceName(cmd.source)})`
765}

Callers 4

CommandsFunction · 0.85
runHeadlessStreamingFunction · 0.85
handleInitializeRequestFunction · 0.85

Calls 1

getSettingSourceNameFunction · 0.85

Tested by

no test coverage detected