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

Method importPreparedChat

src/services/import/electron.ts:91–111  ·  view source on GitHub ↗
(
    sourceId: string,
    chatId: string,
    onProgress?: (p: ImportProgress) => void
  )

Source from the content-addressed store, hash-verified

89 }
90
91 async importPreparedChat(
92 sourceId: string,
93 chatId: string,
94 onProgress?: (p: ImportProgress) => void
95 ): Promise<ImportResult> {
96 const unlisten = window.chatApi.onImportProgress((progress: any) => {
97 onProgress?.({
98 stage: progress.stage || 'parsing',
99 progress: progress.percentage || progress.progress || 0,
100 message: progress.message || '',
101 bytesRead: progress.bytesRead,
102 totalBytes: progress.totalBytes,
103 messagesProcessed: progress.messagesProcessed,
104 })
105 })
106 try {
107 return await window.chatApi.importPreparedChat(sourceId, chatId)
108 } finally {
109 unlisten()
110 }
111 }
112
113 async releaseImportSource(sourceId: string): Promise<void> {
114 await window.chatApi.releaseImportSource(sourceId)

Callers

nothing calls this directly

Calls 2

importPreparedChatMethod · 0.65
onProgressFunction · 0.50

Tested by

no test coverage detected