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

Method updateSkill

packages/memos-core/src/storage/sqlite.ts:1766–1779  ·  view source on GitHub ↗
(skillId: string, fields: { description?: string; version?: number; status?: SkillStatus; installed?: number; qualityScore?: number | null; updatedAt?: number })

Source from the content-addressed store, hash-verified

1764 }
1765
1766 updateSkill(skillId: string, fields: { description?: string; version?: number; status?: SkillStatus; installed?: number; qualityScore?: number | null; updatedAt?: number }): void {
1767 const sets: string[] = [];
1768 const params: unknown[] = [];
1769 if (fields.description !== undefined) { sets.push("description = ?"); params.push(fields.description); }
1770 if (fields.version !== undefined) { sets.push("version = ?"); params.push(fields.version); }
1771 if (fields.status !== undefined) { sets.push("status = ?"); params.push(fields.status); }
1772 if (fields.installed !== undefined) { sets.push("installed = ?"); params.push(fields.installed); }
1773 if (fields.qualityScore !== undefined) { sets.push("quality_score = ?"); params.push(fields.qualityScore); }
1774 if (sets.length === 0) return;
1775 sets.push("updated_at = ?");
1776 params.push(fields.updatedAt ?? Date.now());
1777 params.push(skillId);
1778 this.db.prepare(`UPDATE skills SET ${sets.join(", ")} WHERE id = ?`).run(...params);
1779 }
1780
1781 listSkills(opts: { status?: string; session?: string; owner?: string } = {}): Skill[] {
1782 const conditions: string[] = [];

Callers 2

disableSkillMethod · 0.95
enableSkillMethod · 0.95

Calls 3

prepareMethod · 0.80
runMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected