feat(magic-rewrite): V1 — AI-assisted text rewriting for editors#1238
feat(magic-rewrite): V1 — AI-assisted text rewriting for editors#1238kevin-ho wants to merge 3 commits into
Conversation
Resolve tracker characters through active-chat names, aliases, title/comment aliases, and bracketed aliases so group chats can match card names that differ from tracker names. Preserve uploaded NPC tracker avatars and portrait focus across agent refreshes, including first snapshot writes, without copying manual avatars onto real character-card IDs. Reuse the shared temperature display helpers in the roleplay HUD so the tracker temperature unit setting applies there too. Backfill changelog entries for recent Xel PRs and record the tracker hotfix under 1.6.1.
Slim V1 of Magic Rewrite: AI-assisted text rewriting for lorebook, character, and persona editors. - POST /api/magic-rewrite/generate endpoint using existing default agent connection fallback - MagicRewritePanel: instruction textarea, word-level diff view, HelpTooltip noting agent connection usage - Integrated into ExpandedTextarea and LorebookFormFields modals with Apply/Back flow Addresses Pasta-Devs#1183 (scoped V1 per maintainer feedback).
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
v1 ported in #1260 ! |
Linked issue
Closes #1183
Why this change
Writing and maintaining long-form text entries — character descriptions, persona definitions, lorebook entries — is tedious. Other RP platforms offer AI-assisted rewriting with natural language instructions ("add more detail about their childhood," "convert to XML format," "make this more token-efficient"). Currently Marinara has no built-in mechanism for this. A third-party extension exists as a proof of concept but requires users to manually enter API keys. This PR ships the feature natively, reusing Marinara's existing connection infrastructure.
What changed
packages/server/src/routes/magic-rewrite.routes.ts(new):POST /api/magic-rewrite/generate— acceptstextandinstruction, resolves an LLM connection through the existing default → default agent fallback chain, returns rewritten text. No new DB columns, no migrations.packages/client/src/components/ui/MagicRewritePanel.tsx(new): Instruction textarea, generate button, word-level LCS diff view (green additions, red deletions). Falls back to plain text for inputs over 3 000 words. IncludesHelpTooltipnoting agent connection usage.packages/client/src/components/ui/ExpandedTextarea.tsx(modified): Rewrite button in fullscreen editor header, Apply/Back controls. Escape key suppressed during rewrite mode.packages/client/src/components/lorebooks/LorebookFormFields.tsx(modified): Same rewrite integration in lorebook expanded content modal. Modal widened tomax-w-5xl.packages/server/src/routes/index.ts(modified): Registered magic-rewrite routes under/api/magic-rewrite.Intentionally omitted (follow-up PRs)
Per maintainer feedback on #1184, V1 is scoped to the core rewrite flow:
defaultForRewriteflag)Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Docs and release impact
UI evidence (if applicable)