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

Function buildPrompt

graph-ui/src/compiler/prompt-contract.ts:230–248  ·  view source on GitHub ↗
(input: PromptInput)

Source from the content-addressed store, hash-verified

228 * which is what makes a temperature-zero run with a fixed seed reproducible.
229 */
230export function buildPrompt(input: PromptInput): PromptPlan {
231 const cards = input.cards.cards;
232 const cardIds = cards.map((card) => card.id);
233 const parts: string[] = [CARDS_HEADING, renderCards(cards)];
234 if (input.cards.gaps.length > 0) {
235 parts.push('', GAPS_HEADING, ...input.cards.gaps.map((gap) => `- ${gap}`));
236 }
237 parts.push('', QUESTION_HEADING, input.question, '', CLASS_HINTS[input.klass]);
238 const user = parts.join('\n');
239 const system = SYSTEM_PROMPT;
240 return {
241 system,
242 user,
243 cards,
244 cardIds,
245 estimatedTokens: Math.ceil((system.length + user.length) / 4),
246 nonThinking: nonThinkingFor(input.modelName),
247 };
248}
249
250/**
251 * The refine prompt: rewrite a deterministic block, keep every number.

Callers 2

planForFunction · 0.90
compileQuestionFunction · 0.90

Calls 3

renderCardsFunction · 0.90
nonThinkingForFunction · 0.85
pushMethod · 0.45

Tested by 1

planForFunction · 0.72