( session: DesignSession, responseId: string, feedback: string, outputPath: string, )
| 65 | * Update a session with new iteration data. |
| 66 | */ |
| 67 | export function updateSession( |
| 68 | session: DesignSession, |
| 69 | responseId: string, |
| 70 | feedback: string, |
| 71 | outputPath: string, |
| 72 | ): void { |
| 73 | session.lastResponseId = responseId; |
| 74 | session.feedbackHistory.push(feedback); |
| 75 | session.outputPaths.push(outputPath); |
| 76 | session.updatedAt = new Date().toISOString(); |
| 77 | |
| 78 | fs.writeFileSync(sessionPath(session.id), JSON.stringify(session, null, 2)); |
| 79 | } |
no test coverage detected