* 更新 session 元数据
(sessionId: string, updates: Partial<SessionMeta>)
| 290 | * 更新 Session 元数据 |
| 291 | */ |
| 292 | async updateSessionMeta(sessionId: string, updates: Partial<SessionMeta>): Promise<void> { |
| 293 | const index = this.readIndex(); |
| 294 | const sessionIndex = index.sessions.findIndex(s => s.id === sessionId); |
| 295 | |
| 296 | if (sessionIndex >= 0) { |
| 297 | index.sessions[sessionIndex] = { |
| 298 | ...index.sessions[sessionIndex], |
| 299 | ...updates, |
| 300 | updatedAt: new Date().toISOString(), |
| 301 | }; |
| 302 | this.writeIndex(index); |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | /** |
| 307 | * 删除 Session |
no test coverage detected