(
sessionId: string,
file: File | string,
onProgress?: (p: ImportProgress) => void
)
| 140 | } |
| 141 | |
| 142 | async incrementalImport( |
| 143 | sessionId: string, |
| 144 | file: File | string, |
| 145 | onProgress?: (p: ImportProgress) => void |
| 146 | ): Promise<IncrementalImportResult> { |
| 147 | const filePath = resolveFilePath(file) |
| 148 | if (!filePath) return { success: false, newMessageCount: 0, error: 'Cannot resolve file path' } |
| 149 | |
| 150 | const unlisten = window.chatApi.onImportProgress((progress: any) => { |
| 151 | onProgress?.(progress) |
| 152 | }) |
| 153 | |
| 154 | try { |
| 155 | const result = await window.chatApi.incrementalImport(sessionId, filePath) |
| 156 | return result |
| 157 | } finally { |
| 158 | unlisten() |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | async importDirectory( |
| 163 | source: File[] | string, |
nothing calls this directly
no test coverage detected