managarten/apps/cards/apps/web
Till JS e3cca9e271 feat(cards-web): PWA installability + AI card generation from text
PWA:
  • SvelteKitPWA in vite.config via @mana/shared-pwa preset (name +
    theme color). Layout injects pwaInfo.webManifest.linkTag so
    Chrome's manifest pickup works → install icon + A2HS.
  • Service worker registers automatically (workbox auto-update); the
    cards-already-cached path now keeps working offline as long as the
    user has visited a deck once.

AI generation:
  • lib/ai/generate.ts — direct fetch to mana-llm /v1/chat/completions
    (OpenAI-compatible, mirrors playground module). System prompt
    constrains the model to a JSON array of {front, back}. Code-fence
    stripping handles models that wrap JSON in ```json blocks despite
    the prompt.
  • AiCardGen.svelte — text in, list of generated cards out, per-card
    checkbox preview, "X übernehmen" creates them via cardStore.
    Phase-1 lands them as basic cards.
  • Mounted on the deck-detail page next to "Neue Karte".

Wiring:
  • hooks.server.ts injects __PUBLIC_MANA_LLM_URL__.
  • compose adds PUBLIC_MANA_LLM_URL_CLIENT=https://llm.mana.how to the
    cards-web service.
  • app.d.ts gets vite-plugin-pwa virtual-module references so
    svelte-check can resolve `virtual:pwa-info`.

Phase 2: PDF/image input, mana-credits gating, model selector,
streaming preview as cards arrive.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 13:24:42 +02:00
..
src feat(cards-web): PWA installability + AI card generation from text 2026-05-07 13:24:42 +02:00
static feat(cards-web): Anki .apkg import — first acquisition lever 2026-05-07 13:02:29 +02:00
.gitignore feat(cards): Phase-1 Spinoff — standalone cards.mana.how + cards-core extraction 2026-05-07 01:20:43 +02:00
Dockerfile feat(cards): Phase-1 Spinoff — standalone cards.mana.how + cards-core extraction 2026-05-07 01:20:43 +02:00
package.json chore(infra): drop status-page-gen from Mini, status.mana.how → GPU-Box tunnel 2026-05-07 13:22:20 +02:00
svelte.config.js feat(cards): Phase-1 Spinoff — standalone cards.mana.how + cards-core extraction 2026-05-07 01:20:43 +02:00
tsconfig.json feat(cards): Phase-1 Spinoff — standalone cards.mana.how + cards-core extraction 2026-05-07 01:20:43 +02:00
vite.config.ts chore(infra): drop status-page-gen from Mini, status.mana.how → GPU-Box tunnel 2026-05-07 13:22:20 +02:00