MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / incrementalImport

Method incrementalImport

src/services/import/electron.ts:142–160  ·  view source on GitHub ↗
(
    sessionId: string,
    file: File | string,
    onProgress?: (p: ImportProgress) => void
  )

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 3

resolveFilePathFunction · 0.85
incrementalImportMethod · 0.65
onProgressFunction · 0.50

Tested by

no test coverage detected