-
Notifications
You must be signed in to change notification settings - Fork 116
/
Copy pathtypes.ts
88 lines (76 loc) · 2.2 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import { IDownloadProgress } from '@/types'
import { ProgressResponse } from 'ollama'
export interface IKernelUpdaterDownloadProgress {
transferred: number
total: number
percent: number
bytesPerSecond: number
}
export interface IKernelUpdaterExtractionProgress {
percent: number
extractedFiles: number
totalFiles: number
currentFile: string
}
export interface IKernelUpdaterStatus {
status: 'waiting-check' | 'checking' | 'downloading' | 'extracting' | 'completed' | 'error'
downloadProgress?: IKernelUpdaterDownloadProgress
extractionProgress?: IKernelUpdaterExtractionProgress
error?: Error
message?: string
}
export interface IOllamaUpdaterStatus {
status: 'waiting-check' | 'checking' | 'downloading' | 'running' | 'completed' | 'error' | 'extracting'
downloadProgress?: IKernelUpdaterDownloadProgress
extractionProgress?: IKernelUpdaterExtractionProgress
error?: Error
message?: string
}
export interface IElectronUpdaterStatus {
status: 'checking' | 'downloading' | 'completed' | 'no-update' | 'error' | 'waiting-download'
downloadProgress?: IKernelUpdaterDownloadProgress
error?: Error
message?: string
}
export interface IKernelHeartbeatStatus {
status: 'connecting' | 'connected' | 'waiting'
message: string
}
export interface IModelUpdaterStatus {
status: 'checking' | 'downloading' | 'completed' | 'error'
downloadProgress?: IDownloadProgress
error?: Error
message?: string
}
export interface IPipelineUpdaterStatus {
status:
| 'electron-update'
| 'kernel-update'
| 'model-update'
| 'embed-model-update'
| 'kernel-heartbeat'
| 'ollama-update'
}
export interface IEmbedModelUpdaterStatus {
status: 'waiting-check' | 'checking' | 'downloading' | 'completed' | 'error'
message: string
downloadProgress?: IDownloadProgress
error?: Error
}
export interface AbortableAsyncIterator<T> {
abort(): void
[Symbol.asyncIterator](): AsyncGenerator<T, void, unknown>
}
export interface OllamaProgressResponse {
name: string
progress?: ProgressResponse
error?: string
}
export interface IOllamaVersionInfo {
version: string
darwin_url?: string
windows_url?: string
linux_url?: string
release_date?: string
release_notes?: string
}