(payload: RenameSessionPayload)
| 52 | constructor(protected readonly session: Session) {} |
| 53 | |
| 54 | async renameSession(payload: RenameSessionPayload): Promise<void> { |
| 55 | const title = payload.title.trim(); |
| 56 | if (title.length === 0) { |
| 57 | throw new KimiError(ErrorCodes.SESSION_TITLE_EMPTY, 'Session title cannot be empty'); |
| 58 | } |
| 59 | this.session.metadata = { |
| 60 | ...this.session.metadata, |
| 61 | title, |
| 62 | isCustomTitle: true, |
| 63 | updatedAt: new Date().toISOString(), |
| 64 | }; |
| 65 | await this.session.writeMetadata(); |
| 66 | } |
| 67 | |
| 68 | async updateSessionMetadata(payload: UpdateSessionMetadataPayload): Promise<void> { |
| 69 | this.session.metadata = { |
no test coverage detected