aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/db')
-rw-r--r--src/main/db/sessions.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/db/sessions.ts b/src/main/db/sessions.ts
index 3e6352c..bc22d15 100644
--- a/src/main/db/sessions.ts
+++ b/src/main/db/sessions.ts
@@ -36,21 +36,21 @@ export function getSession(id: string): Session | undefined {
36 .get(id) as Session | undefined; 36 .get(id) as Session | undefined;
37} 37}
38 38
39export function createSession(projectId: string, name: string): Session { 39export function createSession(projectId: string, name: string, phase: Phase = "research"): Session {
40 const db = getDb(); 40 const db = getDb();
41 const id = uuid(); 41 const id = uuid();
42 const now = Math.floor(Date.now() / 1000); 42 const now = Math.floor(Date.now() / 1000);
43 43
44 db.prepare( 44 db.prepare(
45 `INSERT INTO sessions (id, project_id, name, phase, permission_mode, created_at, updated_at) 45 `INSERT INTO sessions (id, project_id, name, phase, permission_mode, created_at, updated_at)
46 VALUES (?, ?, ?, 'research', 'acceptEdits', ?, ?)` 46 VALUES (?, ?, ?, ?, 'acceptEdits', ?, ?)`
47 ).run(id, projectId, name, now, now); 47 ).run(id, projectId, name, phase, now, now);
48 48
49 return { 49 return {
50 id, 50 id,
51 project_id: projectId, 51 project_id: projectId,
52 name, 52 name,
53 phase: "research", 53 phase,
54 claude_session_id: null, 54 claude_session_id: null,
55 permission_mode: "acceptEdits", 55 permission_mode: "acceptEdits",
56 git_branch: null, 56 git_branch: null,