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

Function recordWhyAnswer

graph-ui/src/why/why-store.ts:79–91  ·  view source on GitHub ↗
(store: KeyValueStore, project: string, intent?: WhyIntent)

Source from the content-addressed store, hash-verified

77
78/** Record the answer, or the decline. Returns what now stands. */
79export function recordWhyAnswer(store: KeyValueStore, project: string, intent?: WhyIntent): WhyAnswer {
80 const answer: WhyAnswer = intent === undefined ? { asked: true } : { asked: true, intent };
81 if (project.length === 0) {
82 return answer;
83 }
84 try {
85 store.setItem(whyKey(project), JSON.stringify(answer));
86 } catch {
87 // A refused storage costs the reader one repeated question on the next
88 // load, which is a better failure than a panel that will not close.
89 }
90 return answer;
91}

Callers 2

ProjectWindowViewFunction · 0.90
why-store.test.tsFile · 0.90

Calls 2

whyKeyFunction · 0.85
setItemMethod · 0.65

Tested by

no test coverage detected