@syncshio/kano-plugin-sdk 0.0.0-stage → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,272 @@
1
+ import type { LaunchProvider } from './providers';
2
+ import type { PluginApi } from '../api/types';
3
+ import type { GitInfo, LaunchCheckAction, LaunchResult, PreCheckResult } from './launch';
4
+ export type LaunchBackendKind = 'cuda' | 'hip' | 'zluda' | 'directml' | 'level-zero' | 'mps' | 'cpu';
5
+ export type LaunchFactsCollectionStatus = 'skipped' | 'collected' | 'failed';
6
+ export type LaunchGpuVendor = 'nvidia' | 'amd' | 'intel' | 'apple' | 'cpu' | 'unknown';
7
+ export interface LaunchHostGpuFacts {
8
+ id: string;
9
+ ordinal: number;
10
+ vendor: LaunchGpuVendor;
11
+ name: string;
12
+ memoryTotal: number;
13
+ memoryFree?: number;
14
+ driverVersion?: string;
15
+ pciBusId?: string;
16
+ computeCapability?: string;
17
+ memoryPoolsSupported?: boolean;
18
+ usingTcc?: boolean;
19
+ backendCandidates: Exclude<LaunchBackendKind, 'cpu'>[];
20
+ }
21
+ export interface LaunchHostBackendFacts {
22
+ kind: Exclude<LaunchBackendKind, 'cpu'>;
23
+ available: boolean;
24
+ version?: string;
25
+ driverVersion?: string;
26
+ driverSupportedVersion?: string;
27
+ toolkitVersion?: string;
28
+ toolkitPath?: string;
29
+ runtimePath?: string;
30
+ path?: string;
31
+ }
32
+ export interface LaunchHostFacts {
33
+ status: LaunchFactsCollectionStatus;
34
+ generation?: number;
35
+ os: {
36
+ name: string;
37
+ platform: string;
38
+ version: string;
39
+ architecture: string;
40
+ };
41
+ platform: {
42
+ hostname?: string;
43
+ uptime?: number;
44
+ homeDir?: string;
45
+ };
46
+ cpu: {
47
+ model: string;
48
+ cores: number;
49
+ threads: number;
50
+ frequency?: number;
51
+ };
52
+ memory: {
53
+ total: number;
54
+ available: number;
55
+ used?: number;
56
+ usedPct?: number;
57
+ };
58
+ pageFile?: {
59
+ total?: number;
60
+ available?: number;
61
+ };
62
+ gpus: LaunchHostGpuFacts[];
63
+ backends: Partial<Record<Exclude<LaunchBackendKind, 'cpu'>, LaunchHostBackendFacts>>;
64
+ hostCandidates?: LaunchResolvedBackendCandidate[];
65
+ defaultSelection?: LaunchSelection;
66
+ }
67
+ export interface LaunchPythonPackageFacts {
68
+ name: string;
69
+ version?: string;
70
+ location?: string;
71
+ }
72
+ export interface LaunchTorchFacts {
73
+ version?: string;
74
+ cudaVersion?: string;
75
+ hipVersion?: string;
76
+ xpuVersion?: string;
77
+ supportsDirectML?: boolean;
78
+ supportsIpex?: boolean;
79
+ }
80
+ export interface LaunchOnnxRuntimeFacts {
81
+ version?: string;
82
+ useCuda?: boolean;
83
+ cudaVersion?: string;
84
+ }
85
+ export interface LaunchPythonRuntimeInfo {
86
+ path?: string;
87
+ version?: string;
88
+ architecture?: string;
89
+ isVirtualEnv?: boolean;
90
+ }
91
+ export interface LaunchRuntimeFacts {
92
+ status: LaunchFactsCollectionStatus;
93
+ node?: {
94
+ path: string;
95
+ version: string;
96
+ environment: Record<string, string>;
97
+ };
98
+ python?: LaunchPythonRuntimeInfo;
99
+ packages?: LaunchPythonPackageFacts[];
100
+ torch?: LaunchTorchFacts;
101
+ onnxruntime?: LaunchOnnxRuntimeFacts;
102
+ metadata?: Record<string, unknown>;
103
+ }
104
+ export interface LaunchFactsRequirements {
105
+ repo?: boolean;
106
+ pythonRuntime?: boolean;
107
+ backendSelection?: boolean;
108
+ }
109
+ export interface LaunchSelection {
110
+ backend?: LaunchBackendKind;
111
+ gpuId?: string;
112
+ gpuOrdinal?: number;
113
+ }
114
+ export interface LaunchCapabilityFeatureSet {
115
+ bf16?: boolean;
116
+ fp16?: boolean;
117
+ fp8?: boolean;
118
+ cudnn8?: boolean;
119
+ memoryPools?: boolean;
120
+ tensorCores?: boolean;
121
+ }
122
+ export interface LaunchResolvedBackendCandidate {
123
+ id: string;
124
+ backend: LaunchBackendKind;
125
+ vendor: LaunchGpuVendor;
126
+ name: string;
127
+ vramMB: number;
128
+ selectable: boolean;
129
+ gpuId?: string;
130
+ gpuOrdinal?: number;
131
+ reasons: string[];
132
+ features: LaunchCapabilityFeatureSet;
133
+ }
134
+ export interface LaunchCapabilityResolution {
135
+ candidates: LaunchResolvedBackendCandidate[];
136
+ defaultSelection: LaunchSelection;
137
+ }
138
+ export interface LaunchExecutionContext {
139
+ readonly command: string;
140
+ readonly args: readonly string[];
141
+ readonly pythonPath?: string;
142
+ readonly cwd: string;
143
+ readonly env: Readonly<Record<string, string>>;
144
+ readonly inheritEnv: boolean;
145
+ }
146
+ export interface LaunchFacts {
147
+ app: {
148
+ id: string;
149
+ name: string;
150
+ path: string;
151
+ pluginId: string;
152
+ configuredPythonPath?: string;
153
+ configuredNodePath?: string;
154
+ configuredEnv?: Record<string, string>;
155
+ };
156
+ repo?: GitInfo;
157
+ params: Record<string, unknown>;
158
+ host: LaunchHostFacts;
159
+ runtime: LaunchRuntimeFacts;
160
+ capabilities?: LaunchCapabilityResolution;
161
+ selection?: LaunchSelection;
162
+ /** Compiled once before preflight; probes and process start use this same environment. */
163
+ readonly execution?: LaunchExecutionContext;
164
+ }
165
+ export interface LaunchCheckResult extends PreCheckResult {
166
+ id: string;
167
+ stage: 'host' | 'runtime' | 'selection' | 'compile';
168
+ }
169
+ export interface LaunchCompilationResult extends LaunchResult {
170
+ checks?: LaunchCheckResult[];
171
+ }
172
+ export interface LaunchStrategy {
173
+ requirements?: LaunchFactsRequirements;
174
+ resolveSelection?(facts: LaunchFacts, api: PluginApi): Promise<LaunchSelection | undefined>;
175
+ preflight?(facts: LaunchFacts, api: PluginApi): Promise<LaunchCheckResult[]>;
176
+ executeCheckAction?(facts: LaunchFacts, check: LaunchCheckResult, action: LaunchCheckAction, api: PluginApi): Promise<void>;
177
+ compile?(facts: LaunchFacts, api: PluginApi): Promise<LaunchCompilationResult>;
178
+ }
179
+ export interface PythonDependencyRequest {
180
+ files: Array<{
181
+ path: string;
182
+ optional?: boolean;
183
+ }>;
184
+ directories?: Array<{
185
+ path: string;
186
+ requirements?: string;
187
+ exclude?: string[];
188
+ disabled_suffix?: string;
189
+ }>;
190
+ constraints?: string[];
191
+ index?: string;
192
+ execution: {
193
+ working_dir: string;
194
+ environment: Readonly<Record<string, string>>;
195
+ inherit_env: boolean;
196
+ };
197
+ }
198
+ export interface PythonDependencyReport {
199
+ satisfied: boolean;
200
+ sources: Array<{
201
+ path: string;
202
+ label: string;
203
+ }>;
204
+ issues: Array<{
205
+ requirement: string;
206
+ source: string;
207
+ kind: 'missing' | 'version' | 'python' | 'unverified';
208
+ installed?: string;
209
+ }>;
210
+ }
211
+ export interface ProcessLogEvent {
212
+ process_id: string;
213
+ name: string;
214
+ type: 'stdout' | 'stderr' | 'system';
215
+ content: string;
216
+ timestamp: string;
217
+ }
218
+ export interface LaunchPlanInput {
219
+ id: string;
220
+ name: string;
221
+ path: string;
222
+ pluginId: string;
223
+ pythonPath?: string;
224
+ nodePath?: string;
225
+ params: Record<string, unknown>;
226
+ env?: Record<string, string>;
227
+ backendSelection?: LaunchSelection;
228
+ dependencyConstraints?: string[];
229
+ pythonPackageIndex?: string;
230
+ }
231
+ export interface AppLaunchPlan {
232
+ facts: LaunchFacts;
233
+ checks: LaunchCheckResult[];
234
+ dependencies?: {
235
+ request: PythonDependencyRequest;
236
+ report: PythonDependencyReport;
237
+ };
238
+ }
239
+ export interface LaunchRunContext extends AppLaunchPlan {
240
+ readonly runId: string;
241
+ readonly appId: string;
242
+ readonly mode: 'plan-only' | 'start';
243
+ readonly signal: AbortSignal;
244
+ readonly input: LaunchPlanInput;
245
+ readonly provider: LaunchProvider;
246
+ readonly api: PluginApi;
247
+ addCheck(check: LaunchCheckResult): void;
248
+ log(source: string, message: string): void;
249
+ }
250
+ export interface LaunchParticipant {
251
+ readonly id: string;
252
+ readonly order?: number;
253
+ appliesTo?(ctx: Pick<LaunchRunContext, 'input' | 'provider'>): boolean;
254
+ collectFacts?(ctx: LaunchRunContext): Promise<void>;
255
+ afterCompile?(ctx: LaunchRunContext, draft: LaunchCompilationResult): Promise<void>;
256
+ /** Start-only, once per run. A recompile refreshes facts, the command and dependency diagnostics. */
257
+ prepareEnvironment?(ctx: LaunchRunContext): Promise<{
258
+ recompile?: boolean;
259
+ } | void>;
260
+ preflight?(ctx: LaunchRunContext): Promise<LaunchCheckResult[] | void>;
261
+ beforeSpawn?(ctx: LaunchRunContext, execution: LaunchExecutionContext): Promise<void>;
262
+ onProcessLog?(ctx: LaunchRunContext, event: ProcessLogEvent): void;
263
+ awaitReadiness?(ctx: LaunchRunContext): Promise<{
264
+ webUrl?: string;
265
+ } | void>;
266
+ }
267
+ export interface PluginLaunchParticipant extends LaunchParticipant {
268
+ filter?: {
269
+ pluginIds?: string[];
270
+ appIds?: string[];
271
+ };
272
+ }
@@ -0,0 +1,137 @@
1
+ import type { LaunchBackendKind, LaunchCapabilityResolution, LaunchFacts, LaunchHostFacts, LaunchResolvedBackendCandidate, LaunchRuntimeFacts } from './launch-pipeline';
2
+ import type { ParamAvailability } from './params';
3
+ export declare const LAUNCH_CHECK_ACTION_IDS: {
4
+ readonly RefreshHostCapabilities: "refresh-host-capabilities";
5
+ readonly OpenPythonSettings: "open-python-settings";
6
+ readonly OpenLaunchSettings: "open-launch-settings";
7
+ readonly OpenVersionManagement: "open-version-management";
8
+ readonly OpenExtensionManagement: "open-extension-management";
9
+ readonly ApplyLaunchParam: "apply-launch-param";
10
+ readonly ApplyBackendSelection: "apply-backend-selection";
11
+ readonly OpenUrl: "open-url";
12
+ };
13
+ export type StandardLaunchCheckActionId = (typeof LAUNCH_CHECK_ACTION_IDS)[keyof typeof LAUNCH_CHECK_ACTION_IDS];
14
+ export type LaunchEntry = {
15
+ type: 'python';
16
+ script: string;
17
+ prelude?: (ctx: LaunchRuleContext) => string[];
18
+ } | {
19
+ type: 'node';
20
+ script: string;
21
+ executable?: {
22
+ param: string;
23
+ };
24
+ } | {
25
+ type: 'binary';
26
+ path: string | {
27
+ param: string;
28
+ };
29
+ } | {
30
+ type: 'shell';
31
+ command: string;
32
+ };
33
+ export type FeatureDetector = {
34
+ fileExists: string;
35
+ } | {
36
+ fileContains: {
37
+ path: string;
38
+ pattern: string;
39
+ };
40
+ } | {
41
+ envSet: string;
42
+ } | {
43
+ custom: (ctx: LaunchRuleContext, api: import('../api/types').PluginApi) => Promise<boolean>;
44
+ };
45
+ export interface GitInfo {
46
+ commit: string;
47
+ commitShort: string;
48
+ branch: string;
49
+ tags: string[];
50
+ remoteUrl: string;
51
+ forkId?: string;
52
+ commitOrder?: Map<string, number>;
53
+ }
54
+ export interface LaunchRuleContext {
55
+ app: LaunchFacts['app'];
56
+ params: LaunchFacts['params'];
57
+ host: LaunchHostFacts;
58
+ os: 'windows' | 'linux' | 'macos';
59
+ repo?: GitInfo;
60
+ runtime: LaunchRuntimeFacts;
61
+ capabilities?: LaunchCapabilityResolution;
62
+ selection?: LaunchResolvedBackendCandidate;
63
+ hasFeature: (detector: FeatureDetector) => Promise<boolean>;
64
+ compareVersion: (tag: string) => number;
65
+ isCommitAfter: (commitHash: string) => boolean;
66
+ isCommitBefore: (commitHash: string) => boolean;
67
+ getParam: <T>(id: string, defaultValue?: T) => T;
68
+ getParamDefault: <T>(id: string) => T;
69
+ resolvePath: (relativePath: string) => string;
70
+ get useCPU(): boolean;
71
+ get supportsHalfPrecision(): boolean;
72
+ get vramMB(): number;
73
+ }
74
+ export interface LaunchPreset {
75
+ id: string;
76
+ name?: string;
77
+ label?: string;
78
+ description?: string;
79
+ icon?: string;
80
+ params: Record<string, unknown>;
81
+ isDefault?: boolean;
82
+ available?: ParamAvailability;
83
+ showWhen?: ParamAvailability;
84
+ }
85
+ export type PreCheckSeverity = 'error' | 'warning' | 'info';
86
+ interface LaunchCheckActionBase<TId extends string> {
87
+ id: TId;
88
+ label: string;
89
+ description?: string;
90
+ confirm?: boolean;
91
+ confirmMessage?: string;
92
+ destructive?: boolean;
93
+ }
94
+ export type RefreshHostCapabilitiesLaunchCheckAction = LaunchCheckActionBase<typeof LAUNCH_CHECK_ACTION_IDS.RefreshHostCapabilities>;
95
+ export type OpenPythonSettingsLaunchCheckAction = LaunchCheckActionBase<typeof LAUNCH_CHECK_ACTION_IDS.OpenPythonSettings>;
96
+ export type OpenLaunchSettingsLaunchCheckAction = LaunchCheckActionBase<typeof LAUNCH_CHECK_ACTION_IDS.OpenLaunchSettings>;
97
+ export type OpenVersionManagementLaunchCheckAction = LaunchCheckActionBase<typeof LAUNCH_CHECK_ACTION_IDS.OpenVersionManagement>;
98
+ export type OpenExtensionManagementLaunchCheckAction = LaunchCheckActionBase<typeof LAUNCH_CHECK_ACTION_IDS.OpenExtensionManagement>;
99
+ export interface ApplyLaunchParamLaunchCheckAction extends LaunchCheckActionBase<typeof LAUNCH_CHECK_ACTION_IDS.ApplyLaunchParam> {
100
+ payload: {
101
+ paramId: string;
102
+ value: unknown;
103
+ };
104
+ }
105
+ export interface ApplyBackendSelectionLaunchCheckAction extends LaunchCheckActionBase<typeof LAUNCH_CHECK_ACTION_IDS.ApplyBackendSelection> {
106
+ payload: {
107
+ backend: LaunchBackendKind;
108
+ gpuId?: string;
109
+ gpuOrdinal?: number;
110
+ };
111
+ }
112
+ export interface OpenUrlLaunchCheckAction extends LaunchCheckActionBase<typeof LAUNCH_CHECK_ACTION_IDS.OpenUrl> {
113
+ payload: {
114
+ url: string;
115
+ };
116
+ }
117
+ export type StandardLaunchCheckAction = RefreshHostCapabilitiesLaunchCheckAction | OpenPythonSettingsLaunchCheckAction | OpenLaunchSettingsLaunchCheckAction | OpenVersionManagementLaunchCheckAction | OpenExtensionManagementLaunchCheckAction | ApplyLaunchParamLaunchCheckAction | ApplyBackendSelectionLaunchCheckAction | OpenUrlLaunchCheckAction;
118
+ export interface CustomLaunchCheckAction extends LaunchCheckActionBase<string> {
119
+ payload?: Record<string, unknown>;
120
+ }
121
+ export type LaunchCheckAction = StandardLaunchCheckAction | CustomLaunchCheckAction;
122
+ export interface PreCheckResult {
123
+ passed: boolean;
124
+ severity: PreCheckSeverity;
125
+ message: string;
126
+ suggestion?: string;
127
+ actions?: LaunchCheckAction[];
128
+ autoFix?: () => Promise<void>;
129
+ }
130
+ export interface LaunchResult {
131
+ command: string;
132
+ args: string[];
133
+ env: Record<string, string>;
134
+ cwd: string;
135
+ warnings?: string[];
136
+ }
137
+ export {};
@@ -0,0 +1,112 @@
1
+ import type { PluginApi } from '../api/types';
2
+ /** Platform-neutral model catalog. IDs are opaque and scoped to their provider. */
3
+ export type ModelType = 'checkpoint' | 'lora' | 'lycoris' | 'vae' | 'embedding' | 'hypernetwork' | 'controlnet' | 'upscaler' | 'llm' | 'tts' | 'other';
4
+ export interface MarketModelFile {
5
+ id: string;
6
+ name: string;
7
+ format: string;
8
+ /** Bytes, not KiB. Zero means unknown. */
9
+ size: number;
10
+ /** False when this file is listed for reference but cannot be downloaded. */
11
+ downloadable?: boolean;
12
+ primary?: boolean;
13
+ sha256?: string;
14
+ metadata?: Record<string, unknown>;
15
+ }
16
+ export interface MarketModelVersion {
17
+ id: string;
18
+ name: string;
19
+ baseModel?: string;
20
+ files: MarketModelFile[];
21
+ thumbnails?: string[];
22
+ triggerWords?: string[];
23
+ changelog?: string;
24
+ createdAt: string;
25
+ }
26
+ export interface MarketModelSummary {
27
+ id: string;
28
+ name: string;
29
+ author: string;
30
+ type: ModelType;
31
+ baseModel: string;
32
+ tags: string[];
33
+ thumbnails: string[];
34
+ downloadCount: number;
35
+ rating: number;
36
+ updatedAt: string;
37
+ pageUrl?: string;
38
+ availability?: string;
39
+ }
40
+ export interface MarketModelItem extends MarketModelSummary {
41
+ /** Plain text only. The host never renders platform HTML. */
42
+ description: string;
43
+ createdAt: string;
44
+ versions: MarketModelVersion[];
45
+ }
46
+ export interface ModelMarketQuery {
47
+ search: string;
48
+ searchBy: 'name' | 'author' | 'tag';
49
+ types: ModelType[];
50
+ baseModels: string[];
51
+ sort: string;
52
+ period: string;
53
+ cursor?: string;
54
+ limit: number;
55
+ }
56
+ export interface ModelMarketPage {
57
+ items: MarketModelSummary[];
58
+ /** Opaque continuation token; omitted when there are no more results. */
59
+ nextCursor?: string;
60
+ total?: number;
61
+ }
62
+ export interface ModelMarketContext {
63
+ readonly api: PluginApi;
64
+ signal: AbortSignal;
65
+ /** Host transport: HTTPS GET, declared origins only, session credentials injected by host. */
66
+ http: {
67
+ getJson(url: string): Promise<unknown>;
68
+ /** JSON resource plus the next page advertised by the HTTP Link header. */
69
+ getJsonPage?(url: string): Promise<{
70
+ data: unknown;
71
+ next?: string;
72
+ }>;
73
+ /** Resolve an authenticated endpoint to a public/signed URL without downloading its body. */
74
+ resolveDownload(url: string): Promise<string>;
75
+ };
76
+ }
77
+ export interface ModelMarketProvider {
78
+ id: string;
79
+ name: string;
80
+ homepage: string;
81
+ /** Exact HTTPS origins permitted for metadata and authenticated requests. */
82
+ apiOrigins: string[];
83
+ capabilities: {
84
+ types: ModelType[];
85
+ baseModels: string[];
86
+ searchBy: ModelMarketQuery['searchBy'][];
87
+ sorts: Array<{
88
+ label: string;
89
+ value: string;
90
+ }>;
91
+ periods?: Array<{
92
+ label: string;
93
+ value: string;
94
+ }>;
95
+ apiKey?: {
96
+ label: string;
97
+ helpUrl: string;
98
+ };
99
+ };
100
+ search(query: ModelMarketQuery, context: ModelMarketContext): Promise<ModelMarketPage>;
101
+ getDetail(id: string, context: ModelMarketContext): Promise<MarketModelItem>;
102
+ /** Resolve the exact selected file at click time. Do not start a download here. */
103
+ resolveDownload(selection: {
104
+ modelId: string;
105
+ versionId: string;
106
+ fileId: string;
107
+ }, context: ModelMarketContext): Promise<{
108
+ url: string;
109
+ filename: string;
110
+ size?: number;
111
+ }>;
112
+ }
@@ -0,0 +1,119 @@
1
+ export interface ModelScanOptions {
2
+ base_path: string;
3
+ paths: string[];
4
+ extensions: string[];
5
+ category: string;
6
+ min_size?: number;
7
+ max_size?: number;
8
+ magic_check?: {
9
+ bytes_to_read: number;
10
+ pattern: string;
11
+ };
12
+ parse_safetensors?: boolean;
13
+ recursive?: boolean;
14
+ }
15
+ export interface ModelInfoFromBackend {
16
+ id: string;
17
+ name: string;
18
+ file_name: string;
19
+ path: string;
20
+ full_path: string;
21
+ size: number;
22
+ size_formatted: string;
23
+ mod_time: string;
24
+ extension: string;
25
+ base_model?: string;
26
+ category: string;
27
+ kano_hash?: string;
28
+ sha256?: string;
29
+ preview_path?: string;
30
+ preview_url?: string;
31
+ preview_kind?: string;
32
+ dirty: boolean;
33
+ dirty_reasons?: string[];
34
+ local_metadata_status?: string;
35
+ remote_metadata_status?: string;
36
+ metadata?: Record<string, unknown>;
37
+ }
38
+ export interface ModelScanResult {
39
+ models: ModelInfoFromBackend[];
40
+ scan_time: string;
41
+ total_size: number;
42
+ count: number;
43
+ }
44
+ export interface ModelCacheResult {
45
+ cached: boolean;
46
+ models: ModelInfoFromBackend[];
47
+ count: number;
48
+ dirty_count?: number;
49
+ total_size?: number;
50
+ cached_at?: string;
51
+ scan_time?: string;
52
+ }
53
+ export interface ModelScanCompleteEvent {
54
+ app_id: string;
55
+ category: string;
56
+ job_id?: string;
57
+ count: number;
58
+ dirty_count?: number;
59
+ total_size: number;
60
+ scan_time: string;
61
+ models: ModelInfoFromBackend[];
62
+ warnings?: string[];
63
+ }
64
+ export interface ModelScanJob {
65
+ id: string;
66
+ app_id: string;
67
+ category: string;
68
+ status: 'running' | 'completed' | 'failed' | 'cancelled';
69
+ started_at: number;
70
+ finished_at?: number;
71
+ count: number;
72
+ total_size: number;
73
+ scan_time?: string;
74
+ warnings?: string[];
75
+ error?: string;
76
+ }
77
+ export interface ModelScanBackgroundResult {
78
+ status: string;
79
+ job: ModelScanJob;
80
+ job_id: string;
81
+ reused?: boolean;
82
+ }
83
+ export interface ModelHashDetail {
84
+ kano_hash?: string;
85
+ sha256?: string;
86
+ }
87
+ export interface ModelLocalDetail {
88
+ status: 'missing' | 'ready' | 'error';
89
+ parser?: string;
90
+ metadata?: Record<string, unknown>;
91
+ updated_at?: string;
92
+ error?: string;
93
+ }
94
+ export interface ModelSourceDetail {
95
+ source: string;
96
+ kind: string;
97
+ status: 'missing' | 'ready' | 'error';
98
+ fetched_at?: string;
99
+ preview_url?: string;
100
+ preview_path?: string;
101
+ summary?: Record<string, unknown>;
102
+ raw?: Record<string, unknown>;
103
+ error?: string;
104
+ }
105
+ export interface ModelDetailResult {
106
+ model: ModelInfoFromBackend;
107
+ hash: ModelHashDetail;
108
+ local: ModelLocalDetail;
109
+ sources: ModelSourceDetail[];
110
+ }
111
+ export interface ModelRefreshResult {
112
+ updated: number;
113
+ skipped: number;
114
+ failed: number;
115
+ }
116
+ export interface ModelPreviewCacheResult {
117
+ cached: boolean;
118
+ path?: string;
119
+ }