mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8415] [MERGED] feat(mari): composer @ references and / commands #8588
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#8588
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8415
Author: @ylli-selmani
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ylli-selmani
Base:
staging← Head:feat/mari-composer-references📝 Commits (10+)
e27c7a1feat(mari): resolve composer @ references on the serverc214966feat(mari): composer @ and / trigger detection and key priority702c2aefeat(mari): mark @ tokens inline in the composer draft35ef7c3Merge origin/staging into feat/mari-composer-referencesa42fb33feat(mari): @ reference picker, chips and send wiring6b5a31efeat(mari): slash commands and a sectioned paperclip menu69d0880feat(mari): link chats, docs and agents with @44c5dbedocs(mari): the paperclip menu, @ links and / commands4e7dfb8feat(mari): show avatars and artwork in the @ picker475a2e4refactor(mari): rank the @ and / pickers with the omnibar's scorer📊 Changes
36 files changed (+3450 additions, -95 deletions)
View changed files
📝
docs/home/professor-mari.md(+57 -2)📝
packages/client/src/components/characters/CharacterEditor.tsx(+1 -1)📝
packages/client/src/components/chat/HomeProfessorMariChat.tsx(+105 -4)📝
packages/client/src/components/chat/MariAttachButton.tsx(+66 -30)📝
packages/client/src/components/chat/mari/CompactMariMessage.tsx(+9 -3)📝
packages/client/src/components/chat/mari/MariComposer.tsx(+158 -19)➕
packages/client/src/components/chat/mari/MariReferencePicker.tsx(+189 -0)📝
packages/client/src/components/chat/mari/MariReplyContent.tsx(+42 -1)📝
packages/client/src/components/chat/mari/mari-chat-helpers.tsx(+32 -1)📝
packages/client/src/components/chat/mari/use-mari-message-actions.ts(+9 -2)📝
packages/client/src/components/chat/mari/use-mari-workspace-run.ts(+4 -1)➕
packages/client/src/components/ui/InlineDraftOverlay.tsx(+82 -0)➕
packages/client/src/hooks/use-mari-composer-references.ts(+338 -0)➕
packages/client/src/hooks/use-mari-docs.ts(+13 -0)📝
packages/client/src/lib/command-icons.ts(+4 -0)➕
packages/client/src/lib/composer-triggers.ts(+184 -0)📝
packages/client/src/lib/inline-completion.ts(+8 -2)➕
packages/client/src/lib/mari-commands.ts(+121 -0)➕
packages/client/src/lib/mari-composer-references.ts(+442 -0)📝
packages/client/src/lib/mari-editor-fields.ts(+25 -2)...and 16 more files
📄 Description
Linked issue
Part of #7913. Everything the issue asks for except
@connection, which is deferred to a follow-up: it waits on the accounts → connections rework, which will take longer than this PR.Why this change
To work on "this character", you name it in prose to Professor Mari today. She spends a round looking it up and often guesses which "Alice" you meant. Her composer also has no way to run her own commands: new chat, history, skills, memories, model and permissions are scattered across header buttons and menus, and the paperclip is three bare rows.
This PR adds three things:
@links an exact resource, by id, with what she would have read herself./lists her commands, plus the skills and memories you can link.What changed
Server: references (new
professor-mari/mari-composer-references.ts)references: {kind, id, label, parentId?}[], max 8, besideattachments.app_dataread (character.get,lorebook.getEntry,agent.get, …).chat.getplus its newest 30 messages.docs_read's reader for a whole file. No heading lookup is used, so the known heading-matcher bug never comes up.<linked_references>block between the handoff and continuity blocks. It is rendered byrenderMariWorkspaceContextPrompt(delimiters neutralized, evidence preamble). That renderer gained optionaltag/preambleoptions; its defaults are unchanged.min(60k chars, maxContext)per message. That is about a quarter of the context at ~4 chars/token, and 60k when the connection has no limit. What doesn't fit drops to a line naming the read that gets it.saveRunStart). Later turns get one line per reference still in the history window, with its own re-read hint (app_data character.get X,app_data chat.messages X,docs_read docs/…).<active_handbooks>and opens the gate with noskill.getround.handbookTurnFromResultsgained alinkedReadsargument for this.GET /professor-mari/workspace/docslists the canonical docs (path + first heading) for the picker. It sits behind the sameprivileged()gate as/skills.Client: triggers and keys (new
lib/composer-triggers.ts,MariComposer.tsx)activeToken(text, caret)finds the live@//token. Names with spaces need no quotes at the end of the draft. It is email-safe (me@mail.comis not a trigger), and/triggers only at the start of a line, never inside a path.composerKeyActiondecides who owns a key: the picker first, then the ghost, then Send.Client: marked tokens (new
InlineDraftOverlay)InlineGhostText, shared with the omnibar, is untouched.Client: the
@picker (newMariReferencePicker.tsx,hooks/use-mari-composer-references.ts,lib/mari-composer-references.ts)useChats,useAgentConfigsand the new docs route.scoreText, exported asscoreOmnibarTextwith no change to the omnibar). That means exact, then prefix, then whole word, then substring, then typo or initials, with accents folded. Typo rows only show while nothing matches literally (filterOmnibarFuzzyFallback)./commands rank the same way over their aliases.ResultTypeIconlike her reply rows. A chat shows its characters' faces, badged with its mode. Kinds without an image keep their icon.@(@scen) lists matching ones directly.@text. It is the deliberate way to change field, since clicking around the page does not.@also ends the drill, and drilling in starts from a bare@, so typing narrows the entries or fields inside it.character.onboarding.getreturns (block, problems, sample persona) in an<editor_field>block, so she needs no read round.@charactertogether with the built-in onboarding skill appends that character'scharacter.onboarding.getto its payload.@Namein your bubble with the same pill as the composer, read from the message's saved references.alice→@Alice). Inside a live@token, a single Tab links. Chats, agents, docs, skills and memories are picks only, never ghost targets.Client:
/commands and the paperclip (newlib/mari-commands.ts,MariAttachButton.tsx)/new/history/skills/memories/context/attach/model/permissions/approvals./restartand/clear→ new,/chats→ history,/connection→ model, …/approvalsis listed only while a review is pending./wordand calls the handler that already exists inHomeProfessorMariChat. Skills and memories in the/list become@links.MariRow(the permissions menu's precedent):@at the caret and opens the picker./list and the paperclip read one command list.Docs
docs/home/professor-mari.md: new sections for the paperclip menu, linking with@(what each kind sends, sent once, cap and budget, links read as information) and commands with/. Chat history now names/new.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Agent-run checks (filtered, not the full suite; CI runs the rest):
run-regressions --filter composer-references: both pass./commands, the new groups, field rows, entries past the 30th by query.<editor_field>read; the onboarding skill pairing; a throwing doc read does not stop later links; a 250-character label is cut to 200.tsc --noEmiton client and server: clean.serverRundeps inHomeProfessorMariChat.tsx) was already there.localization:check: passes.Agent browser checks at 375px:
/,/cha(Chat history first) and/hist+ Enter, which opens Chats./becomes@Decisionswith a pill.@rven(a typo) finds and highlights Raven, and@fellists both Fel personas.@rows show character and persona avatars and the preset's artwork, and rows without an image keep their icon.@Ravenshows the pill in its bubble.@ageand@lorelist Docs with their paths, and/leaves agents and docs out.To verify by hand:
@+ a character name + Enter shows a pill and a chip, and that Mari's answer uses the card without callingcharacter.getfirst.@on a lorebook + ArrowRight lists its entries, and that an entry can be linked.@+ a chat name links it, and that she can quote its recent messages.character.onboarding.getcall./command opens its panel or menu, and that/approvalsappears only while a change is pending.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)docs/home/professor-mari.mdis updated. Translations are tracked in #8425.UI evidence (if applicable)
Screenshots at 375px (paperclip menu,
@picker with avatars,@picker with Docs) to be attached.Follow-ups
@connection: deferred until the accounts → connections rework lands, so its payload follows the new model (never credentials).🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.