aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/db/sessions.ts
diff options
context:
space:
mode:
authorbndw <ben@bdw.to>2026-03-04 21:36:32 -0800
committerbndw <ben@bdw.to>2026-03-04 21:36:32 -0800
commit73d2680b83ccbdbd8dfec2d319533e98b379b830 (patch)
tree193eaf5157edcf12d06dde85fb44efaf3aae2004 /src/main/db/sessions.ts
parentb6405dd6a4ba65fc5dc6746db7be7be7d0bb29f3 (diff)
feat: Thread optional `phase` param into `db/sessions.ts::cre… (+7 more)
- ✅ Thread optional `phase` param into `db/sessions.ts::createSession()` - ✅ Thread optional `phase` param into `ipc/handlers.ts` sessions:create handler - ✅ Thread optional `phase` param into `preload.ts` createSession API - ✅ Update Plan phase system prompt to gracefully handle missing research.md - ✅ Update Implement phase system prompt to gracefully handle missing plan.md - ✅ Create `renderer/src/components/NewSessionModal.tsx` - ✅ Update `App.tsx`: add modal state, split handler, add modal JSX - ✅ Add modal CSS to `globals.css`
Diffstat (limited to 'src/main/db/sessions.ts')
-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,