MCPcopy
hub / github.com/codedogQBY/ReadAny / insertSkill

Function insertSkill

packages/core/src/db/skill-queries.ts:39–60  ·  view source on GitHub ↗
(skill: Skill)

Source from the content-addressed store, hash-verified

37}
38
39export async function insertSkill(skill: Skill): Promise<void> {
40 const database = await getDB();
41 const deviceId = await getDeviceId();
42 const syncVersion = await nextSyncVersion(database, "skills");
43 await database.execute(
44 "INSERT INTO skills (id, name, description, icon, enabled, parameters, prompt, built_in, created_at, updated_at, sync_version, last_modified_by) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
45 [
46 skill.id,
47 skill.name,
48 skill.description,
49 skill.icon || null,
50 skill.enabled ? 1 : 0,
51 JSON.stringify(skill.parameters),
52 skill.prompt,
53 skill.builtIn ? 1 : 0,
54 skill.createdAt,
55 skill.updatedAt,
56 syncVersion,
57 deviceId,
58 ],
59 );
60}
61
62export async function upsertSkill(skill: Skill): Promise<void> {
63 const database = await getDB();

Callers 3

SkillsScreenFunction · 0.90
handleSaveSkillFunction · 0.85

Calls 4

getDBFunction · 0.90
getDeviceIdFunction · 0.90
nextSyncVersionFunction · 0.90
executeMethod · 0.65

Tested by

no test coverage detected