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

Method defineProject

src/session/store.ts:419–427  ·  view source on GitHub ↗

Define or rename the project rooted at `cwd`. Idempotent (upsert).

(cwd: string, name: string, description?: string)

Source from the content-addressed store, hash-verified

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

Callers 2

handleSlashCommandFunction · 0.80

Calls 1

runMethod · 0.65

Tested by

no test coverage detected