Define or rename the project rooted at `cwd`. Idempotent (upsert).
(cwd: string, name: string, description?: string)
| 417 | if (!tokens.length) return []; |
| 418 | const likeClauses = tokens.map(() => `fact LIKE ?`).join(' AND '); |
| 419 | const likeArgs = tokens.map(t => `%${t}%`); |
| 420 | const rows = this.db.prepare( |
| 421 | `SELECT DISTINCT fact FROM session_facts WHERE ${where.replace(/f\./g, '')} AND ${likeClauses} ORDER BY id DESC LIMIT ?`, |
| 422 | ).all(...scopeArgs, ...likeArgs, limit) as { fact: string }[]; |
| 423 | return rows.map(r => r.fact); |
| 424 | } |
| 425 | |
| 426 | // ---- Project memory: a named project + a human-readable worklog per cwd. ---- |
| 427 | // The cwd is the project key (it already scopes sessions and facts). A project |
| 428 | // is "defined" by giving that cwd a name/description; the worklog is an |
| 429 | // append-only log of what was accomplished, surfaced on the next session. |
| 430 |
no test coverage detected