mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-16 17:59:39 +02:00
Introduces packages/shared-types/src/ai-schemas.ts as the single source
of truth for the wire format between mana-api and the unified Mana app.
Two schemas:
- MealAnalysisSchema (foods, totalNutrition, description, confidence,
warnings, suggestions) — consumed by nutriphi /analysis/photo and
/analysis/text routes
- PlantIdentificationSchema (scientificName, commonNames, confidence,
health/watering/light advice, generalTips) — consumed by planta
/analysis/identify
Both schemas include .describe() annotations on every field. The Vercel
AI SDK passes these through to the model as part of the structured-output
prompt, which materially improves accuracy on Gemini Vision (the model
sees both the field name AND the German-language hint about what to put
there).
Schemas use plain .optional() rather than .nullable() because
generateObject() guides the model with strict schema adherence — it
won't emit JSON null for missing fields, just omit them.
Deps wired up:
- apps/api: + ai@6, + @ai-sdk/openai-compatible@2, + @mana/shared-types
- apps/mana/apps/web: + zod (for z.infer of the shared schemas)
- packages/shared-types: + zod (for the schema definitions themselves)
All three on zod ^3.23 to stay in lockstep with the existing
apps/api zod usage.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
88 lines
2.7 KiB
JSON
88 lines
2.7 KiB
JSON
{
|
|
"name": "@mana/web",
|
|
"version": "0.2.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "vite dev",
|
|
"build": "vite build",
|
|
"preview": "vite preview",
|
|
"prepare": "svelte-kit sync || echo ''",
|
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
"format": "prettier --write .",
|
|
"lint": "prettier --check . && NODE_OPTIONS=--max-old-space-size=8192 eslint .",
|
|
"test": "vitest",
|
|
"test:ui": "vitest --ui",
|
|
"test:e2e": "playwright test"
|
|
},
|
|
"devDependencies": {
|
|
"@mana/shared-pwa": "workspace:*",
|
|
"@mana/shared-vite-config": "workspace:*",
|
|
"@playwright/test": "^1.51.0",
|
|
"@sveltejs/adapter-node": "^5.0.0",
|
|
"@sveltejs/kit": "^2.47.1",
|
|
"@sveltejs/vite-plugin-svelte": "^5.0.4",
|
|
"@tailwindcss/typography": "^0.5.19",
|
|
"@tailwindcss/vite": "^4.1.7",
|
|
"@types/node": "^22.10.5",
|
|
"@vite-pwa/sveltekit": "^1.1.0",
|
|
"@vitest/coverage-v8": "^4.1.2",
|
|
"@vitest/ui": "^4.1.2",
|
|
"autoprefixer": "^10.4.20",
|
|
"fake-indexeddb": "^6.2.5",
|
|
"postcss": "^8.4.49",
|
|
"postgres": "^3.4.9",
|
|
"prettier": "^3.4.2",
|
|
"prettier-plugin-svelte": "^3.3.2",
|
|
"prettier-plugin-tailwindcss": "^0.6.10",
|
|
"svelte": "^5.41.0",
|
|
"svelte-check": "^4.3.3",
|
|
"tailwindcss": "^4.1.17",
|
|
"tslib": "^2.8.1",
|
|
"typescript": "^5.9.3",
|
|
"vite": "^6.0.7",
|
|
"vitest": "^4.1.2"
|
|
},
|
|
"dependencies": {
|
|
"@calc/shared": "workspace:*",
|
|
"@huggingface/transformers": "^4.0.0",
|
|
"@mana/credits": "workspace:^",
|
|
"@mana/feedback": "workspace:*",
|
|
"@mana/help": "workspace:*",
|
|
"@mana/local-llm": "workspace:*",
|
|
"@mana/local-store": "workspace:*",
|
|
"@mana/qr-export": "workspace:*",
|
|
"@mana/shared-auth": "workspace:*",
|
|
"@mana/shared-auth-ui": "workspace:*",
|
|
"@mana/shared-branding": "workspace:*",
|
|
"@mana/shared-error-tracking": "workspace:*",
|
|
"@mana/shared-i18n": "workspace:*",
|
|
"@mana/shared-icons": "workspace:*",
|
|
"@mana/shared-links": "workspace:*",
|
|
"@mana/shared-llm": "workspace:*",
|
|
"@mana/shared-stores": "workspace:*",
|
|
"@mana/shared-tags": "workspace:*",
|
|
"@mana/shared-tailwind": "workspace:*",
|
|
"@mana/shared-theme": "workspace:*",
|
|
"@mana/shared-theme-ui": "workspace:*",
|
|
"@mana/shared-types": "workspace:*",
|
|
"@mana/shared-ui": "workspace:*",
|
|
"@mana/shared-uload": "workspace:*",
|
|
"@mana/shared-utils": "workspace:*",
|
|
"@mana/spiral-db": "workspace:*",
|
|
"@mana/subscriptions": "workspace:*",
|
|
"@mana/wallpaper-generator": "workspace:*",
|
|
"@types/suncalc": "^1.9.2",
|
|
"@zitare/content": "workspace:*",
|
|
"date-fns": "^4.1.0",
|
|
"dexie": "^4.0.11",
|
|
"marked": "^17.0.5",
|
|
"rrule": "^2.8.1",
|
|
"suncalc": "^1.9.0",
|
|
"svelte-dnd-action": "^0.9.68",
|
|
"svelte-i18n": "^4.0.0",
|
|
"svelte-sonner": "^1.0.5",
|
|
"zod": "^3.25.76"
|
|
},
|
|
"type": "module"
|
|
}
|