MCPcopy Create free account
hub / github.com/codeaashu/claude-code / createSuggestionFromSource

Function createSuggestionFromSource

src/hooks/unifiedSuggestions.ts:46–68  ·  view source on GitHub ↗

* Creates a unified suggestion item from a source

(source: SuggestionSource)

Source from the content-addressed store, hash-verified

44 * Creates a unified suggestion item from a source
45 */
46function createSuggestionFromSource(source: SuggestionSource): SuggestionItem {
47 switch (source.type) {
48 case 'file':
49 return {
50 id: `file-${source.path}`,
51 displayText: source.displayText,
52 description: source.description,
53 }
54 case 'mcp_resource':
55 return {
56 id: `mcp-resource-${source.server}__${source.uri}`,
57 displayText: source.displayText,
58 description: source.description,
59 }
60 case 'agent':
61 return {
62 id: `agent-${source.agentType}`,
63 displayText: source.displayText,
64 description: source.description,
65 color: source.color,
66 }
67 }
68}
69
70const MAX_UNIFIED_SUGGESTIONS = 15
71const DESCRIPTION_MAX_LENGTH = 60

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected