MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / generalQuestion

Function generalQuestion

graph-ui/src/browser-ai/question-intent.ts:105–111  ·  view source on GitHub ↗
(prompt: string, names: readonly string[])

Source from the content-addressed store, hash-verified

103/** "general" for a short general question about the selection or the open file, "detail" for the
104 * same question asking for detail, undefined for any other prompt. `names` are the selection's. */
105export function generalQuestion(prompt: string, names: readonly string[]): 'general' | 'detail' | undefined {
106 const text = normalize(prompt, names);
107 const detail = new RegExp(DETAIL.source, 'u').test(text);
108 const asked = detail ? text.replace(DETAIL, ' ').replace(/\s+/g, ' ').trim() : text;
109 if (!GENERAL.some(pattern => pattern.test(asked))) return undefined;
110 return detail ? 'detail' : 'general';
111}
112
113/** "general" for a short question about the current view ("erkläre die aktuelle Hierarchie",
114 * "what am I looking at"), "detail" for the same asking for detail, undefined otherwise (H1).

Callers 4

sendFunction · 0.90

Calls 1

normalizeFunction · 0.70

Tested by

no test coverage detected