[PR #8563] [MERGED] feat(mari): Prof. Mari in the Preset and Agent editors #8675

Closed
opened 2026-11-07 17:38:50 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8563
Author: @Gunterlie
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @Gunterlie

Base: staging ← Head: feat/mari-config-editors


📝 Commits (10+)

  • 2a71eb3 feat(mari): Prof. Mari in the Preset and Agent editors
  • 1069116 fix(mari): review fixes for Prof. Mari in the Preset and Agent editors
  • 705c725 fix(mari): agent Save keeps her phase, connection and settings; guard takeover restore and empty built-in prompt
  • bb44036 fix(client): track last-seen agent record on dirty refetch; send phase/connection when stored value differs
  • 4758332 fix(client): compare agent Save against normalized stored phase/connection
  • 2f4245c fix(client): clear a stale stored agent connection on Save
  • 524d5d2 Merge staging into feat/mari-config-editors
  • a8ea9b4 fix(client): leave agent renames on the chat card
  • 6171fc5 Merge staging into feat/mari-config-editors
  • d13f395 fix(client): guard nullable takenOver in agent and preset editors

📊 Changes

14 files changed (+695 additions, -169 deletions)

View changed files

📝 packages/client/src/components/agents/AgentEditor.tsx (+286 -70)
📝 packages/client/src/components/chat/HomeProfessorMariChat.tsx (+4 -2)
📝 packages/client/src/components/chat/mari/mari-tool-presentation.ts (+1 -1)
📝 packages/client/src/components/presets/PresetEditor.tsx (+268 -92)
📝 packages/client/src/hooks/use-mari-editor-fields.ts (+20 -0)
📝 packages/client/src/lib/mari-editor-fields.ts (+38 -1)
📝 packages/client/src/localization/locales/en.json (+3 -0)
📝 packages/server/src/services/mari-db/mari-db.service.ts (+4 -0)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+4 -2)
📝 packages/shared/src/types/professor-mari-workspace.ts (+1 -1)
📝 scripts/regressions/agent-home-widgets.regression.ts (+12 -0)
📝 scripts/regressions/mari-editor-fields.regression.ts (+38 -0)
📝 scripts/regressions/mari/preset-granular.regression.ts (+15 -0)
📝 scripts/regressions/professor-mari/action-result.regression.ts (+1 -0)

📄 Description

Why

Prof. Mari can already change presets (preset.update) and agents (agent.update), but her changes only showed as chat cards. Users editing a preset or an agent had to leave the editor to see what she wants to change. This slice (7c) brings the same in-editor review that the Character, Persona and Lorebook editors have to the Preset and Agent editors.

What changed

  • Preset editor: her held preset.update changes review in the editor's own fields (name, description, author, conversation prompt, game prompt): field anchors, companion panel, in-field review, pre-save on Keep, Edit takeover restore. Save now sends only the changed keys, so her applied fields are not overwritten by an older form. Prompt sections are their own records (preset.updateSection) and are not covered.
  • Agent editor: the same for agent.update (name, description, prompt template). While the form has unsaved edits, a refetch (her card Apply, Bypass) keeps them and takes her text only for fields the user left alone; Save leaves her fields out when they are unchanged. No "working off-screen" chip here: it needs a positioned wrapper around the whole editor body.
  • Tool editor: not covered. The server has no Prof. Mari update action for custom tools, and this slice adds no server actions.
  • Server: agent.update now returns an action result (agent_configs → agent), so the kept line, Undo and takeover restore work for agents. Her agent changes refresh the agent queries, and receipts name the kind ("agent"). Top-level conversation_prompt, game_prompt and prompt_template now apply (they were dropped or refused).
  • Fix: a Prof. Mari context that names a preset now resolves from the prompt presets. The server looked it up in the chat-preset store, so a request from the open preset editor failed with "The selected preset is no longer available".
  • Shared review: Edit now focuses an <input> as well as a <textarea> (the agent description is an input).
  • Regressions: kind/alias/field-id cases for preset and agent in mari-editor-fields, agent_configs in professor-mari/action-result, top-level snake_case keys in mari/preset-granular and agent-home-widgets.

Validation (local)

  • tsc --noEmit client and server, eslint on changed client files, prettier, pnpm localization:check: pass.
  • Regressions: full suite 1143/1144; the one failure is multiplayer-peer-server-security (TLS hostname ::1 vs localhost on the test host; no files touched here).
  • Playwright on a throwaway server, 1440 and 390 px: preset and agent review, Keep all, card Apply with unsaved edits, Save, Edit takeover with Keep, kept line, phone sheet and "Open at this field" and unsaved agent edits through her card Apply and Save (39 checks). Character/persona quick pass and lorebook pass also pass.

Manual verification

  • Manually verify in the browser: ask Prof. Mari to change a preset's prompts while the preset editor is open; review, Keep and Undo in the fields.
  • Manually verify the same for a custom agent's description and prompt template.
  • Manually verify that asking Prof. Mari from the open preset editor (with the "Editing …" context) no longer fails.
  • Manually verify the phone layout (390 px): sheet and "Open at this field" for both editors.

No linked issue: planned Prof. Mari editors work (slice 7c).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8563 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `feat/mari-config-editors` --- ### 📝 Commits (10+) - [`2a71eb3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2a71eb37ee2137fcfe05fd6577668836029f0619) feat(mari): Prof. Mari in the Preset and Agent editors - [`1069116`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1069116d3de4afcac22328271b9b26b78f3dfb97) fix(mari): review fixes for Prof. Mari in the Preset and Agent editors - [`705c725`](https://github.com/Pasta-Devs/Marinara-Engine/commit/705c725d2643197108a1930dab16a2ac5042df44) fix(mari): agent Save keeps her phase, connection and settings; guard takeover restore and empty built-in prompt - [`bb44036`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bb440365aff2e72b449b54a14af689b1fe0a20d2) fix(client): track last-seen agent record on dirty refetch; send phase/connection when stored value differs - [`4758332`](https://github.com/Pasta-Devs/Marinara-Engine/commit/475833257715b213252945e967daedf05c7425b4) fix(client): compare agent Save against normalized stored phase/connection - [`2f4245c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2f4245c4c191ec9a32494dde3f70dd2e40878f19) fix(client): clear a stale stored agent connection on Save - [`524d5d2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/524d5d2054549007e7cf656cf6612f49d94c9d18) Merge staging into feat/mari-config-editors - [`a8ea9b4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a8ea9b46b42f4fd278fd15301fd053e1e80fe070) fix(client): leave agent renames on the chat card - [`6171fc5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6171fc534302b1d4cfc9a4ea93d6b9c705c9bc05) Merge staging into feat/mari-config-editors - [`d13f395`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d13f395a3a050c1909d3e8890d462a84342b13aa) fix(client): guard nullable takenOver in agent and preset editors ### 📊 Changes **14 files changed** (+695 additions, -169 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/agents/AgentEditor.tsx` (+286 -70) 📝 `packages/client/src/components/chat/HomeProfessorMariChat.tsx` (+4 -2) 📝 `packages/client/src/components/chat/mari/mari-tool-presentation.ts` (+1 -1) 📝 `packages/client/src/components/presets/PresetEditor.tsx` (+268 -92) 📝 `packages/client/src/hooks/use-mari-editor-fields.ts` (+20 -0) 📝 `packages/client/src/lib/mari-editor-fields.ts` (+38 -1) 📝 `packages/client/src/localization/locales/en.json` (+3 -0) 📝 `packages/server/src/services/mari-db/mari-db.service.ts` (+4 -0) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+4 -2) 📝 `packages/shared/src/types/professor-mari-workspace.ts` (+1 -1) 📝 `scripts/regressions/agent-home-widgets.regression.ts` (+12 -0) 📝 `scripts/regressions/mari-editor-fields.regression.ts` (+38 -0) 📝 `scripts/regressions/mari/preset-granular.regression.ts` (+15 -0) 📝 `scripts/regressions/professor-mari/action-result.regression.ts` (+1 -0) </details> ### 📄 Description ## Why Prof. Mari can already change presets (`preset.update`) and agents (`agent.update`), but her changes only showed as chat cards. Users editing a preset or an agent had to leave the editor to see what she wants to change. This slice (7c) brings the same in-editor review that the Character, Persona and Lorebook editors have to the Preset and Agent editors. ## What changed - **Preset editor**: her held `preset.update` changes review in the editor's own fields (name, description, author, conversation prompt, game prompt): field anchors, companion panel, in-field review, pre-save on Keep, Edit takeover restore. Save now sends only the changed keys, so her applied fields are not overwritten by an older form. Prompt sections are their own records (`preset.updateSection`) and are not covered. - **Agent editor**: the same for `agent.update` (name, description, prompt template). While the form has unsaved edits, a refetch (her card Apply, Bypass) keeps them and takes her text only for fields the user left alone; Save leaves her fields out when they are unchanged. No "working off-screen" chip here: it needs a positioned wrapper around the whole editor body. - **Tool editor**: not covered. The server has no Prof. Mari update action for custom tools, and this slice adds no server actions. - **Server**: `agent.update` now returns an action result (`agent_configs` → `agent`), so the kept line, Undo and takeover restore work for agents. Her agent changes refresh the agent queries, and receipts name the kind ("agent"). Top-level `conversation_prompt`, `game_prompt` and `prompt_template` now apply (they were dropped or refused). - **Fix**: a Prof. Mari context that names a preset now resolves from the prompt presets. The server looked it up in the chat-preset store, so a request from the open preset editor failed with "The selected preset is no longer available". - **Shared review**: Edit now focuses an `<input>` as well as a `<textarea>` (the agent description is an input). - Regressions: kind/alias/field-id cases for preset and agent in `mari-editor-fields`, `agent_configs` in `professor-mari/action-result`, top-level snake_case keys in `mari/preset-granular` and `agent-home-widgets`. ## Validation (local) - `tsc --noEmit` client and server, eslint on changed client files, prettier, `pnpm localization:check`: pass. - Regressions: full suite 1143/1144; the one failure is `multiplayer-peer-server-security` (TLS hostname `::1` vs `localhost` on the test host; no files touched here). - Playwright on a throwaway server, 1440 and 390 px: preset and agent review, Keep all, card Apply with unsaved edits, Save, Edit takeover with Keep, kept line, phone sheet and "Open at this field" and unsaved agent edits through her card Apply and Save (39 checks). Character/persona quick pass and lorebook pass also pass. ## Manual verification - [ ] Manually verify in the browser: ask Prof. Mari to change a preset's prompts while the preset editor is open; review, Keep and Undo in the fields. - [ ] Manually verify the same for a custom agent's description and prompt template. - [ ] Manually verify that asking Prof. Mari from the open preset editor (with the "Editing …" context) no longer fails. - [ ] Manually verify the phone layout (390 px): sheet and "Open at this field" for both editors. No linked issue: planned Prof. Mari editors work (slice 7c). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:38:50 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8675
No description provided.