diff --git a/ui/desktop/src/recipe/recipeStorage.ts b/ui/desktop/src/recipe/recipeStorage.ts index 407be48229..5d6f21ba66 100644 --- a/ui/desktop/src/recipe/recipeStorage.ts +++ b/ui/desktop/src/recipe/recipeStorage.ts @@ -51,37 +51,6 @@ function getRecipeFilePath(recipeName: string, isGlobal: boolean): string { return `${dir}/${recipeName}.yaml`; } -/** - * Load recipe from file - */ -async function loadRecipeFromFile( - recipeName: string, - isGlobal: boolean -): Promise { - const filePath = getRecipeFilePath(recipeName, isGlobal); - - try { - const result = await window.electron.readFile(filePath); - if (!result.found || result.error) { - return null; - } - - const recipeData = yaml.parse(result.file) as SavedRecipe; - - // Convert lastModified string to Date if needed - recipeData.lastModified = parseLastModified(recipeData.lastModified); - - return { - ...recipeData, - isGlobal: isGlobal, - filename: recipeName, - }; - } catch (error) { - console.warn(`Failed to load recipe from ${filePath}:`, error); - return null; - } -} - /** * Save recipe to file */ @@ -144,34 +113,6 @@ export async function saveRecipe(recipe: Recipe, options: SaveRecipeOptions): Pr } } -/** - * Load a recipe by name from file. - */ -export async function loadRecipe(recipeName: string, isGlobal: boolean): Promise { - try { - const savedRecipe = await loadRecipeFromFile(recipeName, isGlobal); - - if (!savedRecipe) { - throw new Error('Recipe not found'); - } - - // Validate the loaded recipe has required fields - if (!savedRecipe.recipe.title || !savedRecipe.recipe.description) { - throw new Error('Loaded recipe is missing required fields'); - } - - if (!savedRecipe.recipe.instructions && !savedRecipe.recipe.prompt) { - throw new Error('Loaded recipe must have either instructions or prompt'); - } - - return savedRecipe.recipe; - } catch (error) { - throw new Error( - `Failed to load recipe: ${error instanceof Error ? error.message : 'Unknown error'}` - ); - } -} - export async function listSavedRecipes(): Promise { try { const listRecipeResponse = await listRecipes();