From 519d6b850e07a0387511a8f024dc394250b1a241 Mon Sep 17 00:00:00 2001 From: Clawd Date: Sat, 28 Feb 2026 15:26:02 -0800 Subject: Clear artifacts when creating new session Each new session now starts with empty research.md and plan.md files, preventing stale content from previous sessions appearing. --- dist/main/db/projects.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 dist/main/db/projects.js (limited to 'dist/main/db/projects.js') diff --git a/dist/main/db/projects.js b/dist/main/db/projects.js new file mode 100644 index 0000000..af36cc0 --- /dev/null +++ b/dist/main/db/projects.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.listProjects = listProjects; +exports.getProject = getProject; +exports.createProject = createProject; +exports.deleteProject = deleteProject; +const index_1 = require("./index"); +const uuid_1 = require("uuid"); +function listProjects() { + return (0, index_1.getDb)() + .prepare("SELECT * FROM projects ORDER BY updated_at DESC") + .all(); +} +function getProject(id) { + return (0, index_1.getDb)() + .prepare("SELECT * FROM projects WHERE id = ?") + .get(id); +} +function createProject(name, projectPath) { + const db = (0, index_1.getDb)(); + const id = (0, uuid_1.v4)(); + const now = Math.floor(Date.now() / 1000); + db.prepare("INSERT INTO projects (id, name, path, created_at, updated_at) VALUES (?, ?, ?, ?, ?)").run(id, name, projectPath, now, now); + return { id, name, path: projectPath, created_at: now, updated_at: now }; +} +function deleteProject(id) { + (0, index_1.getDb)().prepare("DELETE FROM projects WHERE id = ?").run(id); +} -- cgit v1.2.3