MCPcopy Create free account
hub / github.com/MemTensor/MemOS / getTasksBySkill

Method getTasksBySkill

packages/memos-core/src/storage/sqlite.ts:1998–2009  ·  view source on GitHub ↗
(skillId: string)

Source from the content-addressed store, hash-verified

1996 }
1997
1998 getTasksBySkill(skillId: string): Array<{ task: Task; relation: TaskSkillRelation }> {
1999 const rows = this.db.prepare(`
2000 SELECT t.*, ts.relation
2001 FROM task_skills ts JOIN tasks t ON t.id = ts.task_id
2002 WHERE ts.skill_id = ?
2003 ORDER BY t.started_at DESC
2004 `).all(skillId) as Array<TaskRow & { relation: string }>;
2005 return rows.map(r => ({
2006 task: rowToTask(r),
2007 relation: r.relation as TaskSkillRelation,
2008 }));
2009 }
2010
2011 countSkills(status?: string): number {
2012 const cond = status ? "WHERE status = ?" : "";

Callers 1

serveSkillDetailMethod · 0.45

Calls 4

allMethod · 0.80
prepareMethod · 0.80
mapMethod · 0.80
rowToTaskFunction · 0.70

Tested by

no test coverage detected