diff --git a/README.md b/README.md index 3da5738..461762d 100644 --- a/README.md +++ b/README.md @@ -105,12 +105,6 @@ Run the editor: npm run dev:app ``` -Ingredient bulk entry uses the local Ollama service through -`http://10.0.10.211:11434/api/chat` and the purpose-built -`qwen3:4b-instruct` parsing prompt. Override these defaults with -`FORMULATION_OLLAMA_URL` and `FORMULATION_INGREDIENT_PARSER_MODEL`. The parser -endpoint is disabled whenever `FORMULATION_READ_ONLY=true`. - Open . To stop any process listening on the application port and start a fresh Astro diff --git a/docs/agent-handoff.md b/docs/agent-handoff.md index 9054c81..cafe859 100644 --- a/docs/agent-handoff.md +++ b/docs/agent-handoff.md @@ -52,6 +52,5 @@ git diff --check ``` The application supports a read-only deployment with -`FORMULATION_READ_ONLY=true`. Ingredient bulk parsing additionally accepts -`FORMULATION_OLLAMA_URL` and `FORMULATION_INGREDIENT_PARSER_MODEL`; USDA imports -read `USDA_FDC_API_KEY` from the environment. +`FORMULATION_READ_ONLY=true`. USDA imports read `USDA_FDC_API_KEY` from the +environment. diff --git a/src/application/pages/api/app/recipes/parse-ingredients.ts b/src/application/pages/api/app/recipes/parse-ingredients.ts deleted file mode 100644 index 5aa1596..0000000 --- a/src/application/pages/api/app/recipes/parse-ingredients.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { APIRoute } from "astro"; -import { parseIngredientsDeterministic } from "../../../../../lib/ingredient-parser"; -import { readOnlyMode } from "../../../../../lib/runtime"; - -export const prerender = false; - -export const POST: APIRoute = async ({ request }) => { - if (readOnlyMode) return Response.json({ error: "Ingredient parsing is unavailable in read-only mode." }, { status: 403 }); - try { - const body = await request.json() as { text?: unknown }; - if (typeof body.text !== "string") return Response.json({ error: "Ingredient text is required." }, { status: 400 }); - if (body.text.length > 20_000) return Response.json({ error: "Ingredient text is too long." }, { status: 413 }); - return Response.json(parseIngredientsDeterministic(body.text)); - } catch (error) { - const message = error instanceof Error && error.name === "TimeoutError" - ? "Ingredient parser timed out. Try again." - : error instanceof Error ? error.message : "Unable to parse ingredients."; - return Response.json({ error: message }, { status: 502 }); - } -}; diff --git a/src/components/RecipeStructureEditor.tsx b/src/components/RecipeStructureEditor.tsx index c937fe4..147dd6f 100644 --- a/src/components/RecipeStructureEditor.tsx +++ b/src/components/RecipeStructureEditor.tsx @@ -1,6 +1,5 @@ import { useState } from "preact/hooks"; import { - BulkIngredientImportModal, BulkPrepStepsModal, RecipeItemRow, RecipeMethodEditor, @@ -31,13 +30,6 @@ export default function RecipeStructureEditor(props: RecipeEditorProps) { setFocusedItem, draftNotes, setDraftNotes, - bulkOpen, - setBulkOpen, - bulkText, - setBulkText, - bulkError, - setBulkError, - bulkParsing, prepOpen, setPrepOpen, prepText, @@ -65,7 +57,6 @@ export default function RecipeStructureEditor(props: RecipeEditorProps) { createPendingRowIngredient, createPendingIngredient, createPendingRecipe, - addBulkIngredients, addBulkPrepSteps, unconvertedYieldItems, } = useRecipeStructure(props); @@ -662,32 +653,9 @@ export default function RecipeStructureEditor(props: RecipeEditorProps) { Add Note - - { - setBulkText(val); - setBulkError(""); - }} - onClose={() => setBulkOpen(false)} - onSubmit={addBulkIngredients} - /> - void; - onClose: () => void; - onSubmit: () => void; -}; - -export default function BulkIngredientImportModal({ - open, - text, - error, - parsing, - onTextChange, - onClose, - onSubmit, -}: Props) { - if (!open) return null; - - return ( -