List facts for a given scope. For 'project', pass the cwd.
(scope: 'project' | 'user', cwd: string, limit = 50)
| 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') { |
no outgoing calls
no test coverage detected