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

Function noQuestion

graph-ui/src/browser-ai/question-intent.ts:133–139  ·  view source on GitHub ↗
(prompt: string, known: (word: string) => boolean)

Source from the content-addressed store, hash-verified

131 * ("test"), or only greetings ("hallo du"). The name of the selection or of a known symbol
132 * is a question about it. */
133export function noQuestion(prompt: string, known: (word: string) => boolean): boolean {
134 const words = prompt.toLowerCase().match(/[\p{L}\p{N}_][\p{L}\p{N}_.:/-]*/gu) ?? [];
135 if (!words.length) return true;
136 if (words.some(word => known(word.replace(/[.:/-]+$/, '')))) return false;
137 if (words.length === 1) return !ONE_WORD_QUESTION.test(words[0]);
138 return words.length <= 3 && words.every(word => GREETINGS.has(word));
139}
140
141/** What the examples of a prompt without a question are about; a Galaxy selection with its evidence. */
142export type ExampleSubject = { kind: 'galaxy'; name: string; evidence?: GalaxyEvidence } | { kind: 'other'; name: string } | { kind: 'marked' };

Callers 3

sendFunction · 0.90

Calls 1

knownFunction · 0.70

Tested by

no test coverage detected