feat: list, pick and manage Ollama models from a command

This commit is contained in:
2026-10-05 17:26:57 +08:00
parent 05fd9ff13b
commit 6b063f2246
16 changed files with 1281 additions and 31 deletions
+5 -2
View File
@@ -1,6 +1,6 @@
import { LaunchType, closeMainWindow, launchCommand, showHUD, type LaunchProps } from "@vicinae/api";
import { captureRegion } from "./lib/capture";
import { getLamPreferences } from "./lib/preferences";
import { loadPreferences } from "./lib/preferences";
import { describeCaptureFailure, readSnipContext, snipDirectory } from "./lib/snip";
import { visionSupport } from "./lib/vision";
@@ -34,7 +34,10 @@ function settleWindow(): Promise<void> {
* Bind it to a global shortcut for one-key "snip and ask".
*/
export default async function SnipCommand(props: LaunchProps) {
const preferences = getLamPreferences();
// Awaited because the model can come from a pick in the Models command, which
// lives in storage. The vision check below is about whichever model is in use,
// so it has to be the resolved one.
const preferences = await loadPreferences();
const context = readSnipContext(props.launchContext);
// Before anything else. Everything below is pointless if the selector is