mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 19:41:09 +02:00
Drafts can now pull in saved articles, notes, library entries, and raw URLs as prompt context. This is the Writing module's main differentiator against standalone LLM chat: the user's own SSOT flows straight into the ghostwriter without copy-paste. - utils/reference-resolver.ts: resolveReference() per kind (article, note, library, url) via scopedGet + decryptRecords + module type converter. Each ref truncates to MAX_CHARS_PER_REF=1500 (with a "[… gekürzt …]" marker); resolveReferences() caps the aggregate at MAX_TOTAL_REFERENCE_CHARS=8000 and drops extras rather than slicing mid-sentence. Deleted or missing refs silently fall out. - prompt-builder: buildDraftPrompt() takes resolvedReferences and renders them as a "--- Quellen ---" block in the user message with [Quelle N] headers + optional "Kontext:" lines (the user's own per-ref note). System prompt gets a sentence instructing the model to paraphrase from the sources and not fabricate facts when a source has nothing useful. - generations store: startDraftGeneration resolves references in parallel before building the prompt. No changes to the refineSelection path — M5 keeps selection-refinement context-free on purpose. - UI: ReferencePicker.svelte inline in the BriefingForm with four kind tabs (Artikel / Notiz / Library / URL). Searchable lists per kind for module refs (max 20 visible, debounced); URL kind takes a url + an optional context note. ReferenceChip.svelte pills render live- resolved titles; parent resolves labels via the module queries. Hard cap at 6 references per draft. - Scope limits: kontext / goal / me-image refs are on the roadmap but deliberately skipped in M5 — they require different resolution paths (singletons, structured metadata, image descriptors) that would sprawl this commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| api | ||
| calc/packages/shared | ||
| calendar | ||
| cards | ||
| chat | ||
| citycorners | ||
| contacts | ||
| context | ||
| docs | ||
| food | ||
| guides | ||
| inventory | ||
| mana | ||
| manavoxel | ||
| memoro | ||
| moodlit | ||
| mukke | ||
| news | ||
| photos | ||
| picture | ||
| plants | ||
| presi | ||
| questions | ||
| quotes/packages/content | ||
| skilltree | ||
| storage | ||
| times | ||
| todo | ||
| traces | ||
| uload | ||