(dirPath: string, fileName: string)
| 147 | const rootDir = this.getLocalSaveRoot(); |
| 148 | await fs.mkdir(rootDir, { recursive: true }); |
| 149 | |
| 150 | const displayName = await this.getChatDisplayName(chatId); |
| 151 | const dirName = this.sanitizePathSegment(chatId, "chat"); |
| 152 | const chatDir = path.join(rootDir, dirName); |
| 153 | await fs.mkdir(chatDir, { recursive: true }); |
| 154 | |
| 155 | return { rootDir, chatDir, displayName }; |
| 156 | } |
| 157 | |
| 158 | private getLocalChatRelativeDirectory(chatId: string): string { |
| 159 | const chatDir = path.join(this.getLocalSaveRoot(), this.sanitizePathSegment(chatId, "chat")); |
| 160 | return path.relative(process.cwd(), chatDir) || chatDir; |
| 161 | } |
| 162 | |
| 163 | private formatLocalDirectorySummary(savedFiles: LocalSavedFile[]): string { |
| 164 | const directories = Array.from( |
| 165 | new Set(savedFiles.map((file) => this.getLocalChatRelativeDirectory(file.sourceChatId))) |
no outgoing calls
no test coverage detected