/** * Built-in whisper.cpp resolution — Agim's open-source local STT. * * Layout (created under AGIM_HOME): * ~/.agim/whisper/bin/whisper-cli (+ shared libs from official release) * ~/.agim/whisper/models/ggml-base.bin * * Resolution order for the binary: * 1. AGIM_STT_WHISPERCPP_BIN * 2. AGIM_WHISPERCPP_BIN (ops short name) * 3. ~/.agim/whisper/bin/whisper-cli[.exe] * 4. PATH: whisper-cli / whisper * 5. Common brew / usr paths * 6. Auto-download official prebuild (Linux x64/arm64, Windows x64) * * Model: * 1. AGIM_STT_WHISPERCPP_MODEL / AGIM_WHISPERCPP_MODEL * 2. ~/.agim/whisper/models/ggml-base.bin (auto-downloaded on first use) */ /** Multilingual base — better default for zh than base.en. */ export declare const WHISPER_DEFAULT_MODEL_NAME = "ggml-base.bin"; /** Pinned official release used for silent CLI install. */ export declare const WHISPER_CPP_RELEASE = "v1.9.1"; export declare function whisperHomeDir(): string; export declare function defaultWhisperBinPath(): string; export declare function defaultWhisperModelPath(): string; export interface WhisperReleaseAsset { url: string; archive: 'tar.gz' | 'zip'; cliName: string; } /** Official prebuild for this host, or null when unsupported (e.g. macOS). */ export declare function whisperReleaseAssetForHost(platform?: NodeJS.Platform, arch?: string): WhisperReleaseAsset | null; export declare function canAutoInstallWhisperBin(platform?: NodeJS.Platform, arch?: string): boolean; /** Resolve whisper.cpp CLI path (sync — used by detectProvider). */ export declare function resolveWhisperBin(): string | undefined; /** Resolve model path if the file already exists (sync). */ export declare function resolveWhisperModelExisting(): string | undefined; /** * True when local STT can run now, or Auto may silently install it. * Auto-install only counts as "configured" when no cloud STT keys exist — * otherwise a cloud failure would surprise-download a multi-MB CLI. */ export declare function isWhisperCppReady(): boolean; /** * Operator-facing hint when local STT cannot run. Emphasizes missing CLI * when the model file is already present (common confusion after prefetch). */ export declare function whisperCppInstallHintZh(): string; export declare function whisperCppInstallHintEn(): string; export interface WhisperModelStatus { ready: boolean; path: string | null; defaultPath: string; downloading: boolean; lastError: string | null; /** Resolved CLI path when the file exists; else null. */ bin: string | null; /** Default install path for whisper-cli (may not exist yet). */ defaultBinPath: string; binDownloading: boolean; binLastError: string | null; canAutoInstallBin: boolean; } export declare function getWhisperModelStatus(): WhisperModelStatus; /** True when local whisper STT is likely to be used soon (model and/or CLI). */ export declare function shouldWarmupWhisperModel(): boolean; /** Ensure whisper-cli exists; download official prebuild when supported. */ export declare function ensureWhisperBin(): Promise; /** Ensure model file exists; download ggml-base.bin on first use / warmup / UI init. */ export declare function ensureWhisperModel(): Promise; /** Ensure CLI + model (downloads when missing). */ export declare function ensureWhisperRuntime(): Promise<{ bin: string; model: string; }>; export interface WhisperModelDownloadStart { alreadyReady: boolean; alreadyRunning: boolean; started: boolean; path?: string; binPath?: string; } /** * Explicit operator-triggered install (settings). Always attempts ensure for * both CLI (when auto-installable) and model — unlike silent warmup skips. */ export declare function startWhisperModelDownload(): WhisperModelDownloadStart; /** * Fire-and-forget CLI + model install at `agim start`. Never throws; never * blocks boot. Skips when local STT is unlikely or everything is present. */ export declare function startWhisperModelWarmup(): void; /** Resolve bin + model for a transcription call (may download both). */ export declare function resolveWhisperCppForTranscribe(): Promise<{ bin: string; model: string; }>; //# sourceMappingURL=transcribe-whispercpp-resolve.d.ts.map