[GH-ISSUE #3254] docs: docs/FRONTEND.md is out of date - stale hooks, store count, modal/endpoint tables, missing Game Mode #1751

Closed
opened 2026-10-21 05:42:17 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Jul 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3254

Originally assigned to: @SpicyMarinara on GitHub.

docs/FRONTEND.md has drifted from the shipped app. Found in a full docs-vs-code audit against v2.1.0. Each item below is independently checkable: open the doc at the noted spot and compare against the app or code. These can all land in one PR that refreshes the file.

8 items found.


1. Agent System > Built-in Agents (21) table, html row (line 603)

(outdated)

The html row says phase pre_generation / "Adds immersive HTML/CSS instructions", but Immersive HTML was converted in v2.0.9 from static main-prompt injection into a Roleplay post-processing rewrite agent. Its manifest phase is post_processing.

Suggested fix: Change the html row's phase to post_processing and reword the description to something like "Rewrites the finished Roleplay response to add diegetic HTML/CSS/JS visuals (runs in the same rewrite pass as Prose Guardian and Continuity)".


2. Hooks Reference > Generation Hook (use-generate.ts) (lines 208-219)

(outdated)

The documented hook API is wrong on all three counts: the return shape ({ generate, regenerateMessage } - actual is { generate, retryAgents }), the call signature (generate(chatId, prompt, signal) - actual takes one params object), and the SSE event list (agent_update and encounter_init do not exist as events anywhere in client or server code).

Suggested fix: Document the real shape: useGenerate() returns { generate, retryAgents }; generate(params) takes an options object (chatId, connectionId, userMessage, regenerateMessageId, continueMessageId, impersonate, attachments, ...) and returns false if a generation is already in flight for that chat. Replace the event list with the key real events - token, agent_start / agent_result / agent_error, thinking, tool_call, game_state / game_state_patch, text_rewrite, scene_created, done, error - noting it is a subset of the full set handled in use-generate.ts.


3. Hooks Reference > Preset Hooks (use-presets.ts) table, useChoiceBlocks(presetId) and usePresetPreview(presetId) rows (lines 194-195)

(outdated)

Both documented hooks no longer exist under those names: choice-block fetching is now usePresetVariables(presetId) (choice blocks were rebranded "Preset Variables", served from /prompts/:id/variables), and the preview hook is usePreviewPreset() - a mutation, not a (presetId) query.

Suggested fix: Replace the two rows with usePresetVariables(presetId) - Query - "Preset variables (choice blocks)" and usePreviewPreset() - Mutation - "Rendered prompt preview for a preset + chat (accepts { presetId, chatId, choices })".


4. State Management > Zustand Stores (Client State) intro (line 64)

(outdated)

"Six stores manage UI and runtime state" is stale: there are now 14 Zustand stores. The doc omits backfill, chess-game, dialog, game-asset, game-mode, sidecar, translation, and uno-game - several of which back major shipped features (Game Mode, UNO/Chess turn games, the local-model sidecar).

Suggested fix: Update the count to 14 and add short entries (or a one-line catch-all) for the newer stores: game-mode.store / game-asset.store (Game Mode), chess-game.store / uno-game.store (turn games), sidecar.store (local model runtime), translation.store, dialog.store, backfill.store. Keep the note that ui.store remains the only persisted store.


5. Overview (line 5), Shared Package > Constants chat-modes.ts row (line 425), and the "Chat Modes" section (lines 618-648)

(missing)

The doc presents exactly three chat modes (conversation, roleplay, visual_novel) everywhere, but a fourth mode, game (Game Mode: AI Game Master, sessions, dice, journals, storyboards, its own API routes and stores), shipped in the 2.0.x line and is completely absent.

Suggested fix: Add game to the Overview mode list and the CHAT_MODES row, and add a Game Mode subsection under "Chat Modes" (GM-driven sessions, party members, dice, Game Assets, storyboards, journal; link to docs/GAME_MODE.md), including its commonly used agents.


6. Component Guide > Modal System (components/modals/) (lines 297-315)

(outdated)

The "Available modal types" table lists 9 of 15 shipped modal types - missing create-connection, import-connection, create-persona, character-card-update, agent-write-approval, and (as of this branch) docs-viewer - and ModalRenderer.tsx actually lives in components/layout/, not components/modals/ as the section heading implies.

Suggested fix: State that ModalRenderer.tsx lives in components/layout/ (the modal components themselves are in components/modals/), and add rows for create-connection, import-connection, create-persona, character-card-update (agent-proposed card evolutions), agent-write-approval (agent write consent), and docs-viewer (in-app documentation browser).


7. API Endpoints section (lines 474-547)

(missing)

The endpoint tables, presented as the server's REST surface, omit roughly 20 shipped route groups - including /api/themes (which the doc's own Custom Themes section depends on), /api/extensions, /api/tts, /api/game, /api/game-assets, /api/turn-games, /api/sidecar, /api/app-settings, /api/achievements, /api/youtube, /api/global-gallery, /api/conversation-calls, /api/chat-presets, /api/connection-folders, /api/custom-emojis, /api/custom-stickers, /api/prompt-overrides, /api/professor-mari/workspace, and the /api/bot-browser/datacat source.

Suggested fix: Extend the tables with the missing prefixes grouped sensibly (themes/extensions/app-settings under System or a new Customization group; game, game-assets, turn-games under a Game Mode group; tts, youtube, global-gallery, custom-emojis, custom-stickers under Media; sidecar, conversation-calls, chat-presets, connection-folders, prompt-overrides, achievements, professor-mari/workspace, bot-browser datacat, docs where they fit) - or at minimum mark the section as non-exhaustive and point to packages/server/src/routes/index.ts as the authoritative list. Note /api/sidecar is disabled in Lite builds.


8. Agent System > Agent Result Types list (line 614) and Built-in Agents table spotify row (line 604)

(outdated)

The result-type list omits local_music_control (it otherwise mirrors the AgentResultType union exactly), and the Music DJ row says the agent controls "Spotify or YouTube" - the Custom Music DJ mode that plays local Game Assets music through the embedded player shipped in v2.0.3.

Suggested fix: Insert local_music_control into the result-type list (after youtube_control, matching the union order) and change the Music DJ description to "Controls Music DJ playback for Spotify, YouTube, or local Custom Music (Game Assets / local folder via the embedded player)".

Originally created by @kolacheee on GitHub (Jul 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3254 Originally assigned to: @SpicyMarinara on GitHub. `docs/FRONTEND.md` has drifted from the shipped app. Found in a full docs-vs-code audit against **v2.1.0**. Each item below is independently checkable: open the doc at the noted spot and compare against the app or code. These can all land in one PR that refreshes the file. **8 items found.** --- ### 1. Agent System > Built-in Agents (21) table, `html` row (line 603) *(outdated)* The `html` row says phase `pre_generation` / "Adds immersive HTML/CSS instructions", but Immersive HTML was converted in v2.0.9 from static main-prompt injection into a Roleplay post-processing rewrite agent. Its manifest phase is `post_processing`. **Suggested fix:** Change the `html` row's phase to `post_processing` and reword the description to something like "Rewrites the finished Roleplay response to add diegetic HTML/CSS/JS visuals (runs in the same rewrite pass as Prose Guardian and Continuity)". --- ### 2. Hooks Reference > Generation Hook (use-generate.ts) (lines 208-219) *(outdated)* The documented hook API is wrong on all three counts: the return shape (`{ generate, regenerateMessage }` - actual is `{ generate, retryAgents }`), the call signature (`generate(chatId, prompt, signal)` - actual takes one params object), and the SSE event list (`agent_update` and `encounter_init` do not exist as events anywhere in client or server code). **Suggested fix:** Document the real shape: `useGenerate()` returns `{ generate, retryAgents }`; `generate(params)` takes an options object (`chatId`, `connectionId`, `userMessage`, `regenerateMessageId`, `continueMessageId`, `impersonate`, `attachments`, ...) and returns false if a generation is already in flight for that chat. Replace the event list with the key real events - token, agent_start / agent_result / agent_error, thinking, tool_call, game_state / game_state_patch, text_rewrite, scene_created, done, error - noting it is a subset of the full set handled in use-generate.ts. --- ### 3. Hooks Reference > Preset Hooks (use-presets.ts) table, `useChoiceBlocks(presetId)` and `usePresetPreview(presetId)` rows (lines 194-195) *(outdated)* Both documented hooks no longer exist under those names: choice-block fetching is now `usePresetVariables(presetId)` (choice blocks were rebranded "Preset Variables", served from `/prompts/:id/variables`), and the preview hook is `usePreviewPreset()` - a mutation, not a `(presetId)` query. **Suggested fix:** Replace the two rows with `usePresetVariables(presetId)` - Query - "Preset variables (choice blocks)" and `usePreviewPreset()` - Mutation - "Rendered prompt preview for a preset + chat (accepts { presetId, chatId, choices })". --- ### 4. State Management > Zustand Stores (Client State) intro (line 64) *(outdated)* "Six stores manage UI and runtime state" is stale: there are now 14 Zustand stores. The doc omits backfill, chess-game, dialog, game-asset, game-mode, sidecar, translation, and uno-game - several of which back major shipped features (Game Mode, UNO/Chess turn games, the local-model sidecar). **Suggested fix:** Update the count to 14 and add short entries (or a one-line catch-all) for the newer stores: game-mode.store / game-asset.store (Game Mode), chess-game.store / uno-game.store (turn games), sidecar.store (local model runtime), translation.store, dialog.store, backfill.store. Keep the note that ui.store remains the only persisted store. --- ### 5. Overview (line 5), Shared Package > Constants `chat-modes.ts` row (line 425), and the "Chat Modes" section (lines 618-648) *(missing)* The doc presents exactly three chat modes (conversation, roleplay, visual_novel) everywhere, but a fourth mode, `game` (Game Mode: AI Game Master, sessions, dice, journals, storyboards, its own API routes and stores), shipped in the 2.0.x line and is completely absent. **Suggested fix:** Add `game` to the Overview mode list and the CHAT_MODES row, and add a Game Mode subsection under "Chat Modes" (GM-driven sessions, party members, dice, Game Assets, storyboards, journal; link to docs/GAME_MODE.md), including its commonly used agents. --- ### 6. Component Guide > Modal System (components/modals/) (lines 297-315) *(outdated)* The "Available modal types" table lists 9 of 15 shipped modal types - missing `create-connection`, `import-connection`, `create-persona`, `character-card-update`, `agent-write-approval`, and (as of this branch) `docs-viewer` - and ModalRenderer.tsx actually lives in components/layout/, not components/modals/ as the section heading implies. **Suggested fix:** State that ModalRenderer.tsx lives in components/layout/ (the modal components themselves are in components/modals/), and add rows for create-connection, import-connection, create-persona, character-card-update (agent-proposed card evolutions), agent-write-approval (agent write consent), and docs-viewer (in-app documentation browser). --- ### 7. API Endpoints section (lines 474-547) *(missing)* The endpoint tables, presented as the server's REST surface, omit roughly 20 shipped route groups - including /api/themes (which the doc's own Custom Themes section depends on), /api/extensions, /api/tts, /api/game, /api/game-assets, /api/turn-games, /api/sidecar, /api/app-settings, /api/achievements, /api/youtube, /api/global-gallery, /api/conversation-calls, /api/chat-presets, /api/connection-folders, /api/custom-emojis, /api/custom-stickers, /api/prompt-overrides, /api/professor-mari/workspace, and the /api/bot-browser/datacat source. **Suggested fix:** Extend the tables with the missing prefixes grouped sensibly (themes/extensions/app-settings under System or a new Customization group; game, game-assets, turn-games under a Game Mode group; tts, youtube, global-gallery, custom-emojis, custom-stickers under Media; sidecar, conversation-calls, chat-presets, connection-folders, prompt-overrides, achievements, professor-mari/workspace, bot-browser datacat, docs where they fit) - or at minimum mark the section as non-exhaustive and point to packages/server/src/routes/index.ts as the authoritative list. Note /api/sidecar is disabled in Lite builds. --- ### 8. Agent System > Agent Result Types list (line 614) and Built-in Agents table `spotify` row (line 604) *(outdated)* The result-type list omits `local_music_control` (it otherwise mirrors the AgentResultType union exactly), and the Music DJ row says the agent controls "Spotify or YouTube" - the Custom Music DJ mode that plays local Game Assets music through the embedded player shipped in v2.0.3. **Suggested fix:** Insert `local_music_control` into the result-type list (after `youtube_control`, matching the union order) and change the Music DJ description to "Controls Music DJ playback for Spotify, YouTube, or local Custom Music (Game Assets / local folder via the embedded player)".
bsakaguchi 2026-10-21 05:42:17 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Jul 5, 2026):

Addressed in #3289.

<!-- gh-comment-id:4887421172 --> @SpicyMarinara commented on GitHub (Jul 5, 2026): Addressed in #3289.
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#1751
No description provided.