import type { ExtensionCommandContext } from "../../core/extensions/types.ts"; import type { LlamaModelInfo, LlamaProgress } from "./client.ts"; import type { HuggingFaceModel } from "./huggingface.ts"; export type LlamaManagerAction = { type: "model"; model: LlamaModelInfo; } | { type: "download"; } | { type: "close"; }; interface ProgressState extends LlamaProgress { title: string; model: string; } export interface LlamaUi { showModels(serverUrl: string, models: LlamaModelInfo[]): Promise; select(title: string, options: string[]): Promise; confirm(title: string, message: string): Promise; connectionError(serverUrl: string, message: string): Promise<"retry" | "close">; searchModels(search: (query: string, signal: AbortSignal) => Promise): Promise; showStatus(title: string, message: string): void; progress(state: ProgressState): Promise; updateProgress(state: ProgressState): void; } export declare function showLlamaUi(ctx: ExtensionCommandContext, run: (ui: LlamaUi) => Promise): Promise; export declare function runWithProgress(ui: LlamaUi, options: { title: string; model: string; initialMessage: string; cancelTitle: string; cancelMessage: string; run(signal: AbortSignal, update: (progress: LlamaProgress) => void): Promise; cancel(): Promise; }): Promise<{ cancelled: true; } | { cancelled: false; value: T; }>; export {}; //# sourceMappingURL=ui.d.ts.map