refactor(mcp): extract all MCP tools into dedicated modules and add shared helpers

This commit is contained in:
jubnl
2026-04-09 18:09:08 +02:00
parent 91c9421b5e
commit 63784d86a3
36 changed files with 8154 additions and 1249 deletions
+26
View File
@@ -321,6 +321,32 @@ export function createCollabNote(
return db.prepare('SELECT * FROM collab_notes WHERE id = ?').get(result.lastInsertRowid) as TestCollabNote;
}
// ---------------------------------------------------------------------------
// Todo Items
// ---------------------------------------------------------------------------
export interface TestTodoItem {
id: number;
trip_id: number;
name: string;
checked: number;
category: string | null;
sort_order: number;
}
export function createTodoItem(
db: Database.Database,
tripId: number,
overrides: Partial<{ name: string; category: string; checked: number }> = {}
): TestTodoItem {
const maxOrder = db.prepare('SELECT MAX(sort_order) as max FROM todo_items WHERE trip_id = ?').get(tripId) as { max: number | null };
const sortOrder = (maxOrder.max !== null ? maxOrder.max : -1) + 1;
const result = db.prepare(
'INSERT INTO todo_items (trip_id, name, checked, category, sort_order) VALUES (?, ?, ?, ?, ?)'
).run(tripId, overrides.name ?? 'Test Todo', overrides.checked ?? 0, overrides.category ?? null, sortOrder);
return db.prepare('SELECT * FROM todo_items WHERE id = ?').get(result.lastInsertRowid) as TestTodoItem;
}
// ---------------------------------------------------------------------------
// Day Assignments
// ---------------------------------------------------------------------------