mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1457] [Feature]: Migrate remaining raw invokeTauri callers to focused shared API wrappers #725
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#725
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?
Originally created by @Xelvanis on GitHub (May 28, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1457
Originally assigned to: @SpicyMarinara on GitHub.
What problem does this solve?
Some feature-facing code still calls
src/shared/api/tauri-clientdirectly instead of going through focusedsrc/shared/apiwrappers. That spreads command names, payload shapes, response validation, error behavior, remote-runtime allowlisting expectations, and test seams across UI-facing code.This makes future command changes harder to review because a command contract can be duplicated across hooks, components, and broad utility modules instead of being owned by one small API wrapper.
Proposed behavior
Continue migrating raw
invokeTauricallers behind focused shared API wrappers, one bounded owner slice at a time.Suggested shape:
src/shared/apifor each command family.invokeTauridirectly.Migration status
Completed / in progress:
tts-api.tsandtranslation-api.ts.invokeTauri.url-binary-api.tsforload_url_binary.src/shared/lib/url-blob.tsoff directinvokeTauri.Scan note: the remaining-work list below is based on a direct-caller scan of current
origin/refactorafter PR #1458, with the TTS/translation paths covered by PR #1458 and the URL-binary path covered by PR #1460 removed from the future-work set.Remaining work after PR #1460 lands
The remaining work is not one giant mechanical rename. It should be split by owner/command family so each PR can prove behavior and failure paths.
Catalog resource command wrappers
Create or extend focused wrappers for catalog-owned command families, then update catalog hooks/components to use them:
src/features/catalog/chats/hooks/use-chats.tssrc/features/catalog/characters/hooks/use-characters.ts,src/features/catalog/personas/hooks/use-personas.ts,src/features/catalog/characters/components/CharacterEditor.tsx,src/features/catalog/characters/components/CharactersPanel.tsxuse-chat-presets.ts,use-lorebooks.ts,LorebookEditor.tsx,use-connections.ts,use-agents.ts,use-custom-tools.tsLikely outcome: either extend existing wrappers such as
storage-api.ts/storage-commands-api.ts, or add focused wrappers such as chat-memory/chat-notes/chat-swipes, catalog-character/persona, lorebook-assets, connection-test, and agent-admin APIs.Shared chat UI and mode command wrappers
Move direct command calls out of shared mode UI and roleplay/conversation components:
ChatSettingsDrawer.tsx,ChatSetupWizard.tsx,EchoChamberPanel.tsxuse-background-autonomous.ts,ContextInjectionPanel.tsx,SecretPlotPanel.tsxLikely outcome: reuse catalog/chat wrappers where the command is already chat-owned, and add focused agent-memory / agent-cadence wrappers for agent-owned commands.
Shell and admin wrappers
Move shell-level direct command calls behind focused shared API wrappers:
src/features/shell/bot-browser/api/bot-browser-api.tsbot_browser_get,bot_browser_post.src/features/shell/settings/hooks/use-admin-data-reset.tsadmin_expunge_command,admin_clear_all_command.Expected owner or impact area
Refactor branch considerations
invokeTauriimports while migrating old ones.remote-runtime.tsand the corresponding Rust HTTP dispatch path.Alternatives considered
Leaving direct
invokeTauricalls in feature code keeps each small call site simple, but it makes command contract drift harder to audit and test. Keeping everything in one broad integration utility file also reduces file count, but it preserves mixed ownership and makes unrelated integrations change together.Focused wrappers add a little indirection, but they make each command family easier to test, review, and route through embedded or remote runtime paths.
Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: