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

Function incrementalImport

apps/cli/src/import/stream-import.ts:174–205  ·  view source on GitHub ↗
(
  dbManager: DatabaseManager,
  sessionId: string,
  filePath: string,
  options?: ImportOptions & { onProgress?: ImportProgressCallback }
)

Source from the content-addressed store, hash-verified

172}
173
174export async function incrementalImport(
175 dbManager: DatabaseManager,
176 sessionId: string,
177 filePath: string,
178 options?: ImportOptions & { onProgress?: ImportProgressCallback }
179): Promise<IncrementalImportResult> {
180 const { onProgress, ...importOpts } = options || {}
181 let compatibilityError: DataDirCompatibilityError | null = null
182 const result = await sharedIncrementalImport(
183 sessionId,
184 filePath,
185 buildIncrementalDeps(dbManager, onProgress, (error) => {
186 compatibilityError = error
187 }),
188 importOpts
189 )
190 if (compatibilityError) throw compatibilityError
191 if (!result.success) return result
192
193 try {
194 dbManager.raiseCurrentChatDbCompatibilityGate()
195 } catch (error) {
196 return {
197 ...result,
198 success: false,
199 newMessageCount: 0,
200 error: error instanceof Error ? error.message : String(error),
201 }
202 }
203
204 return result
205}
206
207export async function analyzeIncrementalImport(
208 dbManager: DatabaseManager,

Callers 3

registerImportRoutesFunction · 0.90
incrementalImportFileMethod · 0.90

Calls 2

buildIncrementalDepsFunction · 0.85

Tested by

no test coverage detected