feat(writing): M5 expansion — kontext, goal, me-image references

Three more reference kinds the resolver previously stubbed out are now
fully wired through the briefing form into the LLM prompt.

- reference-resolver: three new resolveX functions.
  * Kontext is a singleton per space (the picker uses a sentinel
    targetId; the resolver ignores it and reads via scopedForModule
    + first non-deleted row). Decrypts content and trims to budget.
  * Goal reads from companionGoals (plaintext today) and surfaces
    title + description + status + current/target so the model can
    tie the draft into the user's actual progress.
  * MeImage reads from the space-scoped meImages table; encrypts
    label + tags. Hands the model a textual descriptor (kind / label /
    tags) since the binary blob can't help prose generation.

- ReferencePicker: three new kind-tabs (🗂 Kontext, 🎯 Ziel, 🖼 Bild).
  Kontext renders as a single-click "Kontext-Dokument verknüpfen" entry
  if the space has one (with /kontext deep-link otherwise). Goals
  active-first, then archived/done. Me-images render with thumbnail +
  label + tags. Live-resolved chips via labelFor() for all three.

- i18n baseline bumped by one for ReferencePicker (the new
  "Kontext-Dokument verknüpfen" string is intentional, in line with
  the rest of the picker's existing German labels).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-25 11:43:12 +02:00
parent fbbadc91f0
commit 26e25b7694
4 changed files with 245 additions and 7 deletions

View file

@ -280,7 +280,7 @@
"apps/mana/apps/web/src/lib/modules/wishes/views/DetailView.svelte": 3,
"apps/mana/apps/web/src/lib/modules/writing/components/BriefingForm.svelte": 11,
"apps/mana/apps/web/src/lib/modules/writing/components/ExportMenu.svelte": 1,
"apps/mana/apps/web/src/lib/modules/writing/components/ReferencePicker.svelte": 3,
"apps/mana/apps/web/src/lib/modules/writing/components/ReferencePicker.svelte": 4,
"apps/mana/apps/web/src/lib/modules/writing/components/RefinementPanel.svelte": 12,
"apps/mana/apps/web/src/lib/modules/writing/components/StyleForm.svelte": 2,
"apps/mana/apps/web/src/lib/modules/writing/components/VersionEditor.svelte": 1,