(model: string, mode: AgentMode, cwd: string)
| 50 | } |
| 51 | |
| 52 | createSession(model: string, mode: AgentMode, cwd: string): SessionInfo { |
| 53 | const now = new Date().toISOString(); |
| 54 | const id = createSessionId(); |
| 55 | const db = getDatabase(); |
| 56 | |
| 57 | db.prepare(` |
| 58 | INSERT INTO sessions ( |
| 59 | id, workspace_id, title, recap_text, recap_model, recap_updated_at, model, mode, cwd_at_start, cwd_last, status, created_at, updated_at |
| 60 | ) VALUES ( |
| 61 | @id, @workspace_id, NULL, NULL, NULL, NULL, @model, @mode, @cwd_at_start, @cwd_last, 'active', @created_at, @updated_at |
| 62 | ) |
| 63 | `).run({ |
| 64 | id, |
| 65 | workspace_id: this.workspace.id, |
| 66 | model, |
| 67 | mode, |
| 68 | cwd_at_start: cwd, |
| 69 | cwd_last: cwd, |
| 70 | created_at: now, |
| 71 | updated_at: now, |
| 72 | }); |
| 73 | |
| 74 | return this.getRequiredSession(id); |
| 75 | } |
| 76 | |
| 77 | getLatestSession(): SessionInfo | null { |
| 78 | const row = getDatabase() |
no test coverage detected