MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / getFactsByScope

Method getFactsByScope

src/session/store.ts:334–345  ·  view source on GitHub ↗

List facts for a given scope. For 'project', pass the cwd.

(scope: 'project' | 'user', cwd: string, limit = 50)

Source from the content-addressed store, hash-verified

332 const projectRows = this.db.prepare(
333 `SELECT DISTINCT fact FROM session_facts WHERE cwd = ? AND scope = 'project' ORDER BY id DESC LIMIT ?`,
334 ).all(cwd, limit) as { fact: string }[];
335 const seen = new Set<string>();
336 const out: string[] = [];
337 for (const r of [...userRows, ...projectRows]) {
338 if (seen.has(r.fact)) continue;
339 seen.add(r.fact);
340 out.push(r.fact);
341 if (out.length >= limit) break;
342 }
343 return out;
344 }
345
346 /** List facts for a given scope. For 'project', pass the cwd. */
347 getFactsByScope(scope: 'project' | 'user', cwd: string, limit = 50): string[] {
348 if (scope === 'user') {

Callers 7

index.tsFile · 0.80
getMethod · 0.80
exportMemoryFunction · 0.80
importMemoryFunction · 0.80
gatherDashboardDataFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected