From f80181199b9f63aacaddbe9cee6d665bf57b70fb Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sun, 8 Mar 2026 02:20:25 +0900 Subject: [PATCH] fix(shared): add vision-capable model cache store Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus --- src/shared/vision-capable-models-cache.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/shared/vision-capable-models-cache.ts diff --git a/src/shared/vision-capable-models-cache.ts b/src/shared/vision-capable-models-cache.ts new file mode 100644 index 000000000..3aaf629b5 --- /dev/null +++ b/src/shared/vision-capable-models-cache.ts @@ -0,0 +1,17 @@ +import type { VisionCapableModel } from "../plugin-state" + +let visionCapableModelsCache = new Map() + +export function setVisionCapableModelsCache( + cache: Map, +): void { + visionCapableModelsCache = cache +} + +export function readVisionCapableModelsCache(): VisionCapableModel[] { + return Array.from(visionCapableModelsCache.values()) +} + +export function clearVisionCapableModelsCache(): void { + visionCapableModelsCache = new Map() +}